Merge "Test import of a EC P-521 key."
diff --git a/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h b/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
index 28e1a5a..2a06417 100644
--- a/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
+++ b/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
@@ -222,54 +222,6 @@
return ss.str();
}
-inline std::string toString(const VehiclePropValue &v) {
- std::stringstream ss;
- ss << "VehiclePropValue {n"
- << " prop: " << hexString(v.prop) << ",\n"
- << " areaId: " << hexString(v.areaId) << ",\n"
- << " timestamp: " << v.timestamp << ",\n"
- << " value {\n"
- << " int32Values: " << vecToString(v.value.int32Values) << ",\n"
- << " floatValues: " << vecToString(v.value.floatValues) << ",\n"
- << " int64Values: " << vecToString(v.value.int64Values) << ",\n"
- << " bytes: " << vecToString(v.value.bytes) << ",\n"
- << " string: " << v.value.stringValue.c_str() << ",\n"
- << " }\n"
- << "}\n";
-
- return ss.str();
-}
-
-inline std::string toString(const VehiclePropConfig &config) {
- std::stringstream ss;
- ss << "VehiclePropConfig {\n"
- << " prop: " << hexString(config.prop) << ",\n"
- << " supportedAreas: " << hexString(config.supportedAreas) << ",\n"
- << " access: " << enumToHexString(config.access) << ",\n"
- << " changeMode: " << enumToHexString(config.changeMode) << ",\n"
- << " configFlags: " << hexString(config.configFlags) << ",\n"
- << " minSampleRate: " << config.minSampleRate << ",\n"
- << " maxSampleRate: " << config.maxSampleRate << ",\n"
- << " configString: " << config.configString.c_str() << ",\n";
-
- ss << " areaConfigs {\n";
- for (size_t i = 0; i < config.areaConfigs.size(); i++) {
- const auto &area = config.areaConfigs[i];
- ss << " areaId: " << hexString(area.areaId) << ",\n"
- << " minFloatValue: " << area.minFloatValue << ",\n"
- << " minFloatValue: " << area.maxFloatValue << ",\n"
- << " minInt32Value: " << area.minInt32Value << ",\n"
- << " minInt32Value: " << area.maxInt32Value << ",\n"
- << " minInt64Value: " << area.minInt64Value << ",\n"
- << " minInt64Value: " << area.maxInt64Value << ",\n";
- }
- ss << " }\n"
- << "}\n";
-
- return ss.str();
-}
-
-
} // namespace V2_0
} // namespace vehicle
} // namespace automotive
diff --git a/automotive/vehicle/2.1/types.hal b/automotive/vehicle/2.1/types.hal
index d22f77f..2d1aa46 100644
--- a/automotive/vehicle/2.1/types.hal
+++ b/automotive/vehicle/2.1/types.hal
@@ -585,20 +585,26 @@
/** A client publishes a data packet. */
DATA = 3,
- /* A client declaring layers offering. */
+ /** A client declaring layers offering. */
OFFERING = 4,
- /* Requesting the list of available layers. */
+ /** Requesting the list of available layers. */
AVAILABILITY_REQUEST = 5,
- /* Returning the list of available layers. */
+ /** Returning the list of available layers. */
AVAILABILITY_RESPONSE = 6,
+ /** Sending to the HAL the current list of the available layers. */
+ AVAILABILITY_CHANGE = 7,
+
/** Requesting layers that have subscribers. */
- SUBSCRIPTION_REQUEST = 7,
+ SUBSCRIPTIONS_REQUEST = 8,
/** Returning layers that have subscribers. */
- SUBSCRIPTION_RESPONSE = 8,
+ SUBSCRIPTIONS_RESPONSE = 9,
+
+ /** Sending to the HAL the current list of the subscribed layers. */
+ SUBSCRIPTIONS_CHANGE = 10,
};
/**
@@ -630,11 +636,14 @@
* value properties
*/
enum VmsOfferingMessageIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex {
+ /* The ID assigend to the publisher by the VMS core. */
+ PUBLISHER_ID = 1,
+
/* The number of VMS layer dependencies. */
- VMS_NUMBER_OF_LAYERS_DEPENDENCIES = 1,
+ VMS_NUMBER_OF_LAYERS_DEPENDENCIES = 2,
/* The first index that contain dependencies */
- FIRST_DEPENDENCIES_INDEX = 2,
+ FIRST_DEPENDENCIES_INDEX = 3,
};
/**
diff --git a/bluetooth/1.0/default/bluetooth_hci.h b/bluetooth/1.0/default/bluetooth_hci.h
index 6912405..e2797b1 100644
--- a/bluetooth/1.0/default/bluetooth_hci.h
+++ b/bluetooth/1.0/default/bluetooth_hci.h
@@ -21,6 +21,8 @@
#include <hidl/MQDescriptor.h>
+#include <functional>
+
namespace android {
namespace hardware {
namespace bluetooth {
diff --git a/bluetooth/1.0/default/hci_protocol.cc b/bluetooth/1.0/default/hci_protocol.cc
index a208da1..5d6f1d1 100644
--- a/bluetooth/1.0/default/hci_protocol.cc
+++ b/bluetooth/1.0/default/hci_protocol.cc
@@ -18,6 +18,7 @@
#define LOG_TAG "android.hardware.bluetooth-hci-hci_protocol"
#include <assert.h>
+#include <errno.h>
#include <fcntl.h>
#include <log/log.h>
diff --git a/camera/common/1.0/default/Android.bp b/camera/common/1.0/default/Android.bp
index 03a71fa..6209cb8 100644
--- a/camera/common/1.0/default/Android.bp
+++ b/camera/common/1.0/default/Android.bp
@@ -1,10 +1,11 @@
cc_library_static {
name: "android.hardware.camera.common@1.0-helper",
- vendor: true,
+ vendor_available: true,
defaults: ["hidl_defaults"],
srcs: [
"CameraModule.cpp",
"CameraMetadata.cpp",
+ "CameraParameters.cpp",
"VendorTagDescriptor.cpp",
"HandleImporter.cpp"],
cflags: [
diff --git a/camera/provider/2.4/vts/functional/CameraParameters.cpp b/camera/common/1.0/default/CameraParameters.cpp
similarity index 98%
rename from camera/provider/2.4/vts/functional/CameraParameters.cpp
rename to camera/common/1.0/default/CameraParameters.cpp
index 97b263b..d224483 100644
--- a/camera/provider/2.4/vts/functional/CameraParameters.cpp
+++ b/camera/common/1.0/default/CameraParameters.cpp
@@ -24,6 +24,12 @@
#include <system/graphics.h>
namespace android {
+namespace hardware {
+namespace camera {
+namespace common {
+namespace V1_0 {
+namespace helper {
+
// Parameter keys to communicate between camera application and driver.
const char CameraParameters::KEY_PREVIEW_SIZE[] = "preview-size";
const char CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES[] = "preview-size-values";
@@ -534,4 +540,9 @@
return mMap.isEmpty();
}
+};
+};
+};
+};
+};
}; // namespace android
diff --git a/camera/provider/2.4/vts/functional/CameraParameters.h b/camera/common/1.0/default/include/CameraParameters.h
similarity index 99%
rename from camera/provider/2.4/vts/functional/CameraParameters.h
rename to camera/common/1.0/default/include/CameraParameters.h
index ba33ffe..e4ff6f2 100644
--- a/camera/provider/2.4/vts/functional/CameraParameters.h
+++ b/camera/common/1.0/default/include/CameraParameters.h
@@ -21,6 +21,11 @@
#include <utils/String8.h>
namespace android {
+namespace hardware {
+namespace camera {
+namespace common {
+namespace V1_0 {
+namespace helper {
struct Size {
int width;
@@ -694,6 +699,11 @@
DefaultKeyedVector<String8,String8> mMap;
};
-}; // namespace android
+};
+};
+};
+};
+};
+}; // namespace
#endif
diff --git a/camera/provider/2.4/vts/functional/Android.bp b/camera/provider/2.4/vts/functional/Android.bp
index 85312c1..eae58ef 100644
--- a/camera/provider/2.4/vts/functional/Android.bp
+++ b/camera/provider/2.4/vts/functional/Android.bp
@@ -17,8 +17,7 @@
cc_test {
name: "VtsHalCameraProviderV2_4TargetTest",
defaults: ["hidl_defaults"],
- srcs: ["VtsHalCameraProviderV2_4TargetTest.cpp",
- "CameraParameters.cpp" ],
+ srcs: ["VtsHalCameraProviderV2_4TargetTest.cpp"],
shared_libs: [
"liblog",
"libhidlbase",
@@ -33,7 +32,11 @@
"libgui",
"libui"
],
- static_libs: ["VtsHalHidlTargetTestBase", "libgrallocusage"],
+ static_libs: [
+ "VtsHalHidlTargetTestBase",
+ "libgrallocusage",
+ "android.hardware.camera.common@1.0-helper",
+ ],
cflags: [
"-O0",
"-g",
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index 8695e4e..49281f5 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -36,7 +36,7 @@
#include <mutex>
#include <regex>
#include <unordered_map>
-#include "CameraParameters.h"
+#include <CameraParameters.h>
#include "system/camera_metadata.h"
using ::android::hardware::Return;
@@ -52,13 +52,14 @@
using ::android::BufferQueue;
using ::android::BufferItemConsumer;
using ::android::Surface;
-using ::android::CameraParameters;
using ::android::hardware::graphics::common::V1_0::BufferUsage;
using ::android::hardware::graphics::common::V1_0::PixelFormat;
using ::android::hardware::camera::common::V1_0::Status;
using ::android::hardware::camera::common::V1_0::CameraDeviceStatus;
using ::android::hardware::camera::common::V1_0::TorchMode;
using ::android::hardware::camera::common::V1_0::TorchModeStatus;
+using ::android::hardware::camera::common::V1_0::helper::CameraParameters;
+using ::android::hardware::camera::common::V1_0::helper::Size;
using ::android::hardware::camera::provider::V2_4::ICameraProvider;
using ::android::hardware::camera::provider::V2_4::ICameraProviderCallback;
using ::android::hardware::camera::device::V3_2::ICameraDevice;
@@ -564,7 +565,7 @@
const std::vector<AvailableStream> &streamSizes,
int32_t format, AvailableStream &result);
static Status isAutoFocusModeAvailable(
- ::android::CameraParameters &cameraParams, const char *mode) ;
+ CameraParameters &cameraParams, const char *mode) ;
protected:
std::mutex mLock; // Synchronize access to member variables
@@ -1333,7 +1334,7 @@
openCameraDevice(name, env, &device1 /*out*/);
ASSERT_NE(nullptr, device1.get());
- ::android::CameraParameters cameraParams;
+ CameraParameters cameraParams;
getParameters(device1, &cameraParams /*out*/);
if (Status::OK != isAutoFocusModeAvailable(cameraParams,
@@ -1395,7 +1396,7 @@
openCameraDevice(name, env, &device1 /*out*/);
ASSERT_NE(nullptr, device1.get());
- ::android::CameraParameters cameraParams;
+ CameraParameters cameraParams;
getParameters(device1, &cameraParams /*out*/);
if (Status::OK != isAutoFocusModeAvailable(cameraParams,
@@ -1443,7 +1444,7 @@
openCameraDevice(name, env, &device1 /*out*/);
ASSERT_NE(nullptr, device1.get());
- ::android::CameraParameters cameraParams;
+ CameraParameters cameraParams;
getParameters(device1, &cameraParams /*out*/);
int32_t hwFaces = cameraParams.getInt(
@@ -1506,7 +1507,7 @@
openCameraDevice(name, env, &device1 /*out*/);
ASSERT_NE(nullptr, device1.get());
- ::android::CameraParameters cameraParams;
+ CameraParameters cameraParams;
getParameters(device1, &cameraParams /*out*/);
const char *smoothZoomStr = cameraParams.get(
@@ -1557,7 +1558,7 @@
openCameraDevice(name, env, &device1 /*out*/);
ASSERT_NE(nullptr, device1.get());
- ::android::CameraParameters cameraParams;
+ CameraParameters cameraParams;
getParameters(device1, &cameraParams /*out*/);
int32_t width, height;
@@ -1587,10 +1588,10 @@
ASSERT_TRUE((nullptr == effect) || (strcmp(
CameraParameters::EFFECT_NONE, effect) == 0));
- ::android::Vector<::android::Size> previewSizes;
+ ::android::Vector<Size> previewSizes;
cameraParams.getSupportedPreviewSizes(previewSizes);
ASSERT_FALSE(previewSizes.empty());
- ::android::Vector<::android::Size> pictureSizes;
+ ::android::Vector<Size> pictureSizes;
cameraParams.getSupportedPictureSizes(pictureSizes);
ASSERT_FALSE(pictureSizes.empty());
const char *previewFormats = cameraParams.get(
@@ -3003,7 +3004,7 @@
// Check whether the camera device supports specific focus mode.
Status CameraHidlTest::isAutoFocusModeAvailable(
- ::android::CameraParameters &cameraParams,
+ CameraParameters &cameraParams,
const char *mode) {
::android::String8 focusModes(cameraParams.get(
CameraParameters::KEY_SUPPORTED_FOCUS_MODES));
diff --git a/current.txt b/current.txt
index 8d0785f..64fafbf 100644
--- a/current.txt
+++ b/current.txt
@@ -101,7 +101,7 @@
4f6dedbcdd21c309dfc650acea81a096d6b242493ffe49c8d61bd3c43aad354e android.hardware.graphics.common@1.0::types
b3aac6c3817f039964fcd62268274b3039e17bd7d0d5b40b4d1d1c7b19a1f866 android.hardware.graphics.composer@2.1::IComposer
b19d00eb8a8b3b0034a0321f22e8f32162bf4c2aebbce6da22c025f56e459ea2 android.hardware.graphics.composer@2.1::IComposerCallback
-e992684e690dfe67a8cbeab5005bfa3fa9c2bf3d4b0b75657fb1f0c2d5dd2bae android.hardware.graphics.composer@2.1::IComposerClient
+61ee43ffe6fb6dbe8b22dc17c51ff3d5ba703fc6029cba211f901f3d79c8a72d android.hardware.graphics.composer@2.1::IComposerClient
1c98c2f5154345312ec054871792a2982ec5f3e2bc2abfb61a10c0b517978e20 android.hardware.graphics.composer@2.1::types
a695898589e1ef15b2b2510f11edd6aafac9918d9cf8d74b4b6143b309dee542 android.hardware.graphics.mapper@2.0::IMapper
28507d385a3dd224bf3c32f1bfd9f96092c4701b9c1cc66caa578fc3efc97877 android.hardware.graphics.mapper@2.0::types
@@ -189,4 +189,6 @@
# ABI preserving changes to HALs released in Android O
+760485232f6cce07f8bb05e3475509956996b702f77415ee5bff05e2ec5a5bcc android.hardware.dumpstate@1.0::IDumpstateDevice
+78589343d8ee2e1b155acad3fbdc7fcbb6af94491aee968b2383c21627264f8b android.hardware.radio@1.0::IRadioResponse
28e929b453df3d9f5060af2764e6cdb123ddb893e3e86923c877f6ff7e5f02c9 android.hardware.wifi@1.0::types
diff --git a/drm/1.0/Android.bp b/drm/1.0/Android.bp
index 7829de7..731f58f 100644
--- a/drm/1.0/Android.bp
+++ b/drm/1.0/Android.bp
@@ -89,3 +89,5 @@
"libutils",
],
}
+
+subdirs = ["default"]
diff --git a/drm/1.0/default/Android.bp b/drm/1.0/default/Android.bp
new file mode 100644
index 0000000..ed6bcde
--- /dev/null
+++ b/drm/1.0/default/Android.bp
@@ -0,0 +1,23 @@
+cc_library_static {
+ name: "android.hardware.drm@1.0-helper",
+ vendor_available: true,
+ defaults: ["hidl_defaults"],
+ srcs: [
+ "SharedLibrary.cpp",
+ ],
+ cflags: [
+ "-Werror",
+ "-Wextra",
+ "-Wall",
+ ],
+ shared_libs: [
+ "liblog",
+ ],
+ header_libs: [
+ "libutils_headers",
+ ],
+ export_header_lib_headers: [
+ "libutils_headers",
+ ],
+ export_include_dirs : ["include"]
+}
diff --git a/drm/1.0/default/Android.mk b/drm/1.0/default/Android.mk
index 4c05da8..7916fba 100644
--- a/drm/1.0/default/Android.mk
+++ b/drm/1.0/default/Android.mk
@@ -36,6 +36,9 @@
libutils \
libbinder \
+LOCAL_STATIC_LIBRARIES := \
+ android.hardware.drm@1.0-helper \
+
LOCAL_C_INCLUDES := \
hardware/interfaces/drm
@@ -71,10 +74,12 @@
libhidlmemory \
libhidltransport \
liblog \
- libmediadrm \
- libstagefright_foundation \
+ libstagefright_foundation_vendor \
libutils \
+LOCAL_STATIC_LIBRARIES := \
+ android.hardware.drm@1.0-helper \
+
LOCAL_C_INCLUDES := \
frameworks/native/include \
frameworks/av/include
diff --git a/drm/1.0/default/CryptoFactory.h b/drm/1.0/default/CryptoFactory.h
index 412b557..6b1d1ff 100644
--- a/drm/1.0/default/CryptoFactory.h
+++ b/drm/1.0/default/CryptoFactory.h
@@ -19,7 +19,7 @@
#include <android/hardware/drm/1.0/ICryptoFactory.h>
#include <hidl/Status.h>
#include <media/hardware/CryptoAPI.h>
-#include <media/PluginLoader.h>
+#include <PluginLoader.h>
#include <media/SharedLibrary.h>
namespace android {
@@ -28,6 +28,7 @@
namespace V1_0 {
namespace implementation {
+using ::android::hardware::drm::V1_0::helper::PluginLoader;
using ::android::hardware::drm::V1_0::ICryptoFactory;
using ::android::hardware::drm::V1_0::ICryptoPlugin;
using ::android::hardware::hidl_array;
@@ -51,7 +52,7 @@
override;
private:
- android::PluginLoader<android::CryptoFactory> loader;
+ PluginLoader<android::CryptoFactory> loader;
CryptoFactory(const CryptoFactory &) = delete;
void operator=(const CryptoFactory &) = delete;
diff --git a/drm/1.0/default/DrmFactory.h b/drm/1.0/default/DrmFactory.h
index a008844..726bf97 100644
--- a/drm/1.0/default/DrmFactory.h
+++ b/drm/1.0/default/DrmFactory.h
@@ -19,7 +19,7 @@
#include <android/hardware/drm/1.0/IDrmFactory.h>
#include <hidl/Status.h>
#include <media/drm/DrmAPI.h>
-#include <media/PluginLoader.h>
+#include <PluginLoader.h>
#include <media/SharedLibrary.h>
namespace android {
@@ -28,6 +28,7 @@
namespace V1_0 {
namespace implementation {
+using ::android::hardware::drm::V1_0::helper::PluginLoader;
using ::android::hardware::drm::V1_0::IDrmFactory;
using ::android::hardware::drm::V1_0::IDrmPlugin;
using ::android::hardware::hidl_array;
@@ -53,7 +54,7 @@
const hidl_string& appPackageName, createPlugin_cb _hidl_cb) override;
private:
- android::PluginLoader<android::DrmFactory> loader;
+ PluginLoader<android::DrmFactory> loader;
DrmFactory(const DrmFactory &) = delete;
void operator=(const DrmFactory &) = delete;
diff --git a/drm/1.0/vts/functional/shared_library.cpp b/drm/1.0/default/SharedLibrary.cpp
similarity index 82%
rename from drm/1.0/vts/functional/shared_library.cpp
rename to drm/1.0/default/SharedLibrary.cpp
index 6658150..0a942cd 100644
--- a/drm/1.0/vts/functional/shared_library.cpp
+++ b/drm/1.0/default/SharedLibrary.cpp
@@ -14,17 +14,19 @@
* limitations under the License.
*/
-#define LOG_TAG "drm-vts-shared-library"
+
+#include "SharedLibrary.h"
#include <dlfcn.h>
-#include <shared_library.h>
-using std::string;
+namespace android {
+namespace hardware {
+namespace drm {
+namespace V1_0 {
+namespace helper {
-namespace drm_vts {
-
-SharedLibrary::SharedLibrary(const string& path) {
- mLibHandle = dlopen(path.c_str(), RTLD_NOW);
+SharedLibrary::SharedLibrary(const String8& path) {
+ mLibHandle = dlopen(path.string(), RTLD_NOW);
}
SharedLibrary::~SharedLibrary() {
@@ -53,4 +55,9 @@
const char* error = dlerror();
return error ? error : "No errors or unknown error";
}
-};
+
+}
+}
+}
+}
+} // namespace android
diff --git a/drm/1.0/default/include/PluginLoader.h b/drm/1.0/default/include/PluginLoader.h
new file mode 100644
index 0000000..f387b3c
--- /dev/null
+++ b/drm/1.0/default/include/PluginLoader.h
@@ -0,0 +1,107 @@
+/**
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef PLUGIN_LOADER_H_
+#define PLUGIN_LOADER_H_
+
+#include "SharedLibrary.h"
+#include <utils/Log.h>
+#include <utils/String8.h>
+#include <utils/Vector.h>
+
+namespace android {
+namespace hardware {
+namespace drm {
+namespace V1_0 {
+namespace helper {
+
+template <class T>
+class PluginLoader {
+
+ public:
+ PluginLoader(const char *dir, const char *entry) {
+ /**
+ * scan all plugins in the plugin directory and add them to the
+ * factories list.
+ */
+ String8 pluginDir(dir);
+
+ DIR* pDir = opendir(pluginDir.string());
+ if (pDir == NULL) {
+ ALOGE("Failed to find plugin directory %s", pluginDir.string());
+ } else {
+ struct dirent* pEntry;
+ while ((pEntry = readdir(pDir))) {
+ String8 file(pEntry->d_name);
+ if (file.getPathExtension() == ".so") {
+ String8 path = pluginDir + "/" + pEntry->d_name;
+ T *plugin = loadOne(path, entry);
+ if (plugin) {
+ factories.push(plugin);
+ }
+ }
+ }
+ closedir(pDir);
+ }
+ }
+
+ ~PluginLoader() {
+ for (size_t i = 0; i < factories.size(); i++) {
+ delete factories[i];
+ }
+ }
+
+ T *getFactory(size_t i) const {
+ return factories[i];
+ }
+
+ size_t factoryCount() const {return factories.size();}
+
+ private:
+ T* loadOne(const char *path, const char *entry) {
+ sp<SharedLibrary> library = new SharedLibrary(String8(path));
+ if (!library.get()) {
+ ALOGE("Failed to open plugin library %s: %s", path,
+ library->lastError());
+ } else {
+ typedef T *(*CreateFactoryFunc)();
+ CreateFactoryFunc createFactoryFunc =
+ (CreateFactoryFunc)library->lookup(entry);
+ if (createFactoryFunc) {
+ ALOGV("Found plugin factory entry %s in %s", entry, path);
+ libraries.push(library);
+ T* result = createFactoryFunc();
+ return result;
+ }
+ }
+ return NULL;
+ }
+
+ Vector<T *> factories;
+ Vector<sp<SharedLibrary> > libraries;
+
+ PluginLoader(const PluginLoader &) = delete;
+ void operator=(const PluginLoader &) = delete;
+};
+
+}
+}
+}
+}
+} // namespace android
+
+#endif // PLUGIN_LOADER_H_
+
diff --git a/drm/1.0/vts/functional/shared_library.h b/drm/1.0/default/include/SharedLibrary.h
similarity index 79%
rename from drm/1.0/vts/functional/shared_library.h
rename to drm/1.0/default/include/SharedLibrary.h
index 1f32243..8e174d0 100644
--- a/drm/1.0/vts/functional/shared_library.h
+++ b/drm/1.0/default/include/SharedLibrary.h
@@ -17,13 +17,18 @@
#ifndef SHARED_LIBRARY_H_
#define SHARED_LIBRARY_H_
-#include <string>
-#include <vector>
+#include <utils/RefBase.h>
+#include <utils/String8.h>
-namespace drm_vts {
-class SharedLibrary {
+namespace android {
+namespace hardware {
+namespace drm {
+namespace V1_0 {
+namespace helper {
+
+class SharedLibrary : public RefBase {
public:
- explicit SharedLibrary(const std::string& path);
+ explicit SharedLibrary(const String8& path);
~SharedLibrary();
bool operator!() const;
@@ -36,6 +41,11 @@
SharedLibrary(const SharedLibrary&) = delete;
void operator=(const SharedLibrary&) = delete;
};
-};
+
+}
+}
+}
+}
+}
#endif // SHARED_LIBRARY_H_
diff --git a/drm/1.0/vts/functional/Android.bp b/drm/1.0/vts/functional/Android.bp
index 43ea372..b45ce84 100644
--- a/drm/1.0/vts/functional/Android.bp
+++ b/drm/1.0/vts/functional/Android.bp
@@ -19,7 +19,6 @@
srcs: [
"drm_hal_clearkey_test.cpp",
"drm_hal_vendor_test.cpp",
- "shared_library.cpp",
"vendor_modules.cpp"
],
shared_libs: [
@@ -39,7 +38,8 @@
"libutils",
],
static_libs: [
- "VtsHalHidlTargetTestBase"
+ "VtsHalHidlTargetTestBase",
+ "android.hardware.drm@1.0-helper",
],
cflags: [
"-O0",
diff --git a/drm/1.0/vts/functional/vendor_modules.cpp b/drm/1.0/vts/functional/vendor_modules.cpp
index 2bf0b28..98430f5 100644
--- a/drm/1.0/vts/functional/vendor_modules.cpp
+++ b/drm/1.0/vts/functional/vendor_modules.cpp
@@ -20,13 +20,16 @@
#include <dlfcn.h>
#include <log/log.h>
#include <memory>
+#include <utils/String8.h>
+#include <SharedLibrary.h>
-#include "shared_library.h"
#include "vendor_modules.h"
using std::string;
using std::vector;
using std::unique_ptr;
+using ::android::String8;
+using ::android::hardware::drm::V1_0::helper::SharedLibrary;
namespace drm_vts {
void VendorModules::scanModules(const std::string &directory) {
@@ -48,7 +51,7 @@
DrmHalVTSVendorModule* VendorModules::getModule(const string& path) {
if (mOpenLibraries.find(path) == mOpenLibraries.end()) {
- auto library = std::make_unique<SharedLibrary>(path);
+ auto library = std::make_unique<SharedLibrary>(String8(path.c_str()));
if (!library) {
ALOGE("failed to map shared library %s", path.c_str());
return NULL;
diff --git a/drm/1.0/vts/functional/vendor_modules.h b/drm/1.0/vts/functional/vendor_modules.h
index ca538f6..8330b0a 100644
--- a/drm/1.0/vts/functional/vendor_modules.h
+++ b/drm/1.0/vts/functional/vendor_modules.h
@@ -18,8 +18,12 @@
#define VENDOR_MODULES_H
#include <map>
+#include <vector>
+#include <string>
-#include "shared_library.h"
+#include <SharedLibrary.h>
+
+using ::android::hardware::drm::V1_0::helper::SharedLibrary;
class DrmHalVTSVendorModule;
diff --git a/dumpstate/1.0/IDumpstateDevice.hal b/dumpstate/1.0/IDumpstateDevice.hal
index 206c139..12a0db4 100644
--- a/dumpstate/1.0/IDumpstateDevice.hal
+++ b/dumpstate/1.0/IDumpstateDevice.hal
@@ -18,7 +18,14 @@
interface IDumpstateDevice {
/**
- * Dumps device-specific state into the given file descriptor.
+ * Dump device-specific state into the given file descriptors.
+ *
+ * One file descriptor must be passed to this method but two may be passed:
+ * the first descriptor must be used to dump device-specific state in text
+ * format, the second descriptor is optional and may be used to dump
+ * device-specific state in binary format.
+ *
+ * @param h A native handle with one or two valid file descriptors.
*/
dumpstateBoard(handle h);
};
diff --git a/dumpstate/1.0/vts/functional/VtsHalDumpstateV1_0TargetTest.cpp b/dumpstate/1.0/vts/functional/VtsHalDumpstateV1_0TargetTest.cpp
index 7ab4812..046bf56 100644
--- a/dumpstate/1.0/vts/functional/VtsHalDumpstateV1_0TargetTest.cpp
+++ b/dumpstate/1.0/vts/functional/VtsHalDumpstateV1_0TargetTest.cpp
@@ -59,6 +59,7 @@
// Positive test: make sure dumpstateBoard() writes something to the FD.
TEST_F(DumpstateHidlTest, TestOk) {
FILE* file = tmpfile();
+
ASSERT_NE(nullptr, file) << "Could not create temp file: " << strerror(errno);
native_handle_t* handle = native_handle_create(1, 0);
@@ -80,6 +81,29 @@
native_handle_delete(handle);
}
+// Positive test: make sure dumpstateBoard() doesn't crash with two FDs.
+TEST_F(DumpstateHidlTest, TestHandleWithTwoFds) {
+ FILE* file1 = tmpfile();
+ FILE* file2 = tmpfile();
+
+ ASSERT_NE(nullptr, file1) << "Could not create temp file #1: " << strerror(errno);
+ ASSERT_NE(nullptr, file2) << "Could not create temp file #2: " << strerror(errno);
+
+ native_handle_t* handle = native_handle_create(2, 0);
+ ASSERT_NE(handle, nullptr) << "Could not create native_handle";
+ handle->data[0] = fileno(file1);
+ handle->data[1] = fileno(file2);
+
+ Return<void> status = dumpstate->dumpstateBoard(handle);
+ ASSERT_TRUE(status.isOk()) << "Status should be ok: " << status.description();
+
+ EXPECT_EQ(0, fclose(file1)) << errno;
+ EXPECT_EQ(0, fclose(file2)) << errno;
+
+ native_handle_close(handle);
+ native_handle_delete(handle);
+}
+
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
int status = RUN_ALL_TESTS();
diff --git a/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp b/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp
index fde3171..91e75fe 100644
--- a/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp
+++ b/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp
@@ -39,7 +39,7 @@
// for command line argument on how strictly to run the test
bool sAgpsIsPresent = false; // if SUPL or XTRA assistance available
-bool sSignalIsWeak = false; // if GNSS signals are weak (e.g. light indoor)
+bool sSignalIsWeak = false; // if GNSS signals are weak (e.g. light indoor)
// The main test class for GNSS HAL.
class GnssHalTest : public ::testing::VtsHalHidlTargetTestBase {
@@ -49,6 +49,7 @@
capabilities_called_count_ = 0;
location_called_count_ = 0;
info_called_count_ = 0;
+ notify_count_ = 0;
gnss_hal_ = ::testing::VtsHalHidlTargetTestBase::getService<IGnss>();
ASSERT_NE(gnss_hal_, nullptr);
@@ -93,12 +94,15 @@
if (gnss_hal_ != nullptr) {
gnss_hal_->cleanup();
}
+ if (notify_count_ > 0) {
+ ALOGW("%d unprocessed callbacks discarded", notify_count_);
+ }
}
/* Used as a mechanism to inform the test that a callback has occurred */
inline void notify() {
std::unique_lock<std::mutex> lock(mtx_);
- count++;
+ notify_count_++;
cv_.notify_one();
}
@@ -108,14 +112,132 @@
std::cv_status status = std::cv_status::no_timeout;
auto now = std::chrono::system_clock::now();
- while (count == 0) {
- status = cv_.wait_until(lock, now + std::chrono::seconds(timeoutSeconds));
- if (status == std::cv_status::timeout) return status;
+ while (notify_count_ == 0) {
+ status = cv_.wait_until(lock, now + std::chrono::seconds(timeoutSeconds));
+ if (status == std::cv_status::timeout) return status;
}
- count--;
+ notify_count_--;
return status;
}
+ /*
+ * StartAndGetSingleLocation:
+ * Helper function to get one Location and check fields
+ *
+ * returns true if a location was successfully generated
+ */
+ bool StartAndGetSingleLocation(bool checkAccuracies) {
+ auto result = gnss_hal_->start();
+
+ EXPECT_TRUE(result.isOk());
+ EXPECT_TRUE(result);
+
+ /*
+ * GPS signals initially optional for this test, so don't expect fast fix,
+ * or no timeout, unless signal is present
+ */
+ int firstGnssLocationTimeoutSeconds = sAgpsIsPresent ? 15 : 45;
+ if (sSignalIsWeak) {
+ // allow more time for weak signals
+ firstGnssLocationTimeoutSeconds += 30;
+ }
+
+ wait(firstGnssLocationTimeoutSeconds);
+ if (sAgpsIsPresent) {
+ EXPECT_EQ(location_called_count_, 1);
+ }
+ if (location_called_count_ > 0) {
+ CheckLocation(last_location_, checkAccuracies);
+ return true;
+ }
+ return false;
+ }
+
+ /*
+ * StopAndClearLocations:
+ * Helper function to stop locations
+ *
+ * returns true if a location was successfully generated
+ */
+ void StopAndClearLocations() {
+ auto result = gnss_hal_->stop();
+
+ EXPECT_TRUE(result.isOk());
+ EXPECT_TRUE(result);
+
+ /*
+ * Clear notify/waiting counter, allowing up till the timeout after
+ * the last reply for final startup messages to arrive (esp. system
+ * info.)
+ */
+ while (wait(TIMEOUT_SEC) == std::cv_status::no_timeout) {
+ }
+ }
+
+ /*
+ * CheckLocation:
+ * Helper function to vet Location fields
+ */
+ void CheckLocation(GnssLocation& location, bool checkAccuracies) {
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG);
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE);
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED);
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_HORIZONTAL_ACCURACY);
+ // New uncertainties available in O must be provided,
+ // at least when paired with modern hardware (2017+)
+ if (checkAccuracies) {
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY);
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY);
+ if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) {
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY);
+ }
+ }
+ EXPECT_GE(location.latitudeDegrees, -90.0);
+ EXPECT_LE(location.latitudeDegrees, 90.0);
+ EXPECT_GE(location.longitudeDegrees, -180.0);
+ EXPECT_LE(location.longitudeDegrees, 180.0);
+ EXPECT_GE(location.altitudeMeters, -1000.0);
+ EXPECT_LE(location.altitudeMeters, 30000.0);
+ EXPECT_GE(location.speedMetersPerSec, 0.0);
+ EXPECT_LE(location.speedMetersPerSec, 5.0); // VTS tests are stationary.
+
+ // Non-zero speeds must be reported with an associated bearing
+ if (location.speedMetersPerSec > 0.0) {
+ EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING);
+ }
+
+ /*
+ * Tolerating some especially high values for accuracy estimate, in case of
+ * first fix with especially poor geometry (happens occasionally)
+ */
+ EXPECT_GT(location.horizontalAccuracyMeters, 0.0);
+ EXPECT_LE(location.horizontalAccuracyMeters, 250.0);
+
+ /*
+ * Some devices may define bearing as -180 to +180, others as 0 to 360.
+ * Both are okay & understandable.
+ */
+ if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) {
+ EXPECT_GE(location.bearingDegrees, -180.0);
+ EXPECT_LE(location.bearingDegrees, 360.0);
+ }
+ if (location.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY) {
+ EXPECT_GT(location.verticalAccuracyMeters, 0.0);
+ EXPECT_LE(location.verticalAccuracyMeters, 500.0);
+ }
+ if (location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY) {
+ EXPECT_GT(location.speedAccuracyMetersPerSecond, 0.0);
+ EXPECT_LE(location.speedAccuracyMetersPerSecond, 50.0);
+ }
+ if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY) {
+ EXPECT_GT(location.bearingAccuracyDegrees, 0.0);
+ EXPECT_LE(location.bearingAccuracyDegrees, 360.0);
+ }
+
+ // Check timestamp > 1.48e12 (47 years in msec - 1970->2017+)
+ EXPECT_GT(location.timestamp, 1.48e12);
+ }
+
/* Callback class for data & Event. */
class GnssCallback : public IGnssCallback {
public:
@@ -188,7 +310,7 @@
private:
std::mutex mtx_;
std::condition_variable cv_;
- int count;
+ int notify_count_;
};
/*
@@ -201,107 +323,6 @@
TEST_F(GnssHalTest, SetCallbackCapabilitiesCleanup) {}
/*
- * CheckLocation:
- * Helper function to vet Location fields
- */
-void CheckLocation(GnssLocation& location, bool checkAccuracies) {
- EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG);
- EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE);
- EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED);
- EXPECT_TRUE(location.gnssLocationFlags &
- GnssLocationFlags::HAS_HORIZONTAL_ACCURACY);
- // New uncertainties available in O must be provided,
- // at least when paired with modern hardware (2017+)
- if (checkAccuracies) {
- EXPECT_TRUE(location.gnssLocationFlags &
- GnssLocationFlags::HAS_VERTICAL_ACCURACY);
- EXPECT_TRUE(location.gnssLocationFlags &
- GnssLocationFlags::HAS_SPEED_ACCURACY);
- if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) {
- EXPECT_TRUE(location.gnssLocationFlags &
- GnssLocationFlags::HAS_BEARING_ACCURACY);
- }
- }
- EXPECT_GE(location.latitudeDegrees, -90.0);
- EXPECT_LE(location.latitudeDegrees, 90.0);
- EXPECT_GE(location.longitudeDegrees, -180.0);
- EXPECT_LE(location.longitudeDegrees, 180.0);
- EXPECT_GE(location.altitudeMeters, -1000.0);
- EXPECT_LE(location.altitudeMeters, 30000.0);
- EXPECT_GE(location.speedMetersPerSec, 0.0);
- EXPECT_LE(location.speedMetersPerSec, 5.0); // VTS tests are stationary.
-
- // Non-zero speeds must be reported with an associated bearing
- if (location.speedMetersPerSec > 0.0) {
- EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING);
- }
-
- /*
- * Tolerating some especially high values for accuracy estimate, in case of
- * first fix with especially poor geometry (happens occasionally)
- */
- EXPECT_GT(location.horizontalAccuracyMeters, 0.0);
- EXPECT_LE(location.horizontalAccuracyMeters, 250.0);
-
- /*
- * Some devices may define bearing as -180 to +180, others as 0 to 360.
- * Both are okay & understandable.
- */
- if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) {
- EXPECT_GE(location.bearingDegrees, -180.0);
- EXPECT_LE(location.bearingDegrees, 360.0);
- }
- if (location.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY) {
- EXPECT_GT(location.verticalAccuracyMeters, 0.0);
- EXPECT_LE(location.verticalAccuracyMeters, 500.0);
- }
- if (location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY) {
- EXPECT_GT(location.speedAccuracyMetersPerSecond, 0.0);
- EXPECT_LE(location.speedAccuracyMetersPerSecond, 50.0);
- }
- if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY) {
- EXPECT_GT(location.bearingAccuracyDegrees, 0.0);
- EXPECT_LE(location.bearingAccuracyDegrees, 360.0);
- }
-
- // Check timestamp > 1.48e12 (47 years in msec - 1970->2017+)
- EXPECT_GT(location.timestamp, 1.48e12);
-}
-
-/*
- * StartAndGetSingleLocation:
- * Helper function to get one Location and check fields
- *
- * returns true if a location was successfully generated
- */
-bool StartAndGetSingleLocation(GnssHalTest* test, bool checkAccuracies) {
- auto result = test->gnss_hal_->start();
-
- EXPECT_TRUE(result.isOk());
- EXPECT_TRUE(result);
-
- /*
- * GPS signals initially optional for this test, so don't expect fast fix,
- * or no timeout, unless signal is present
- */
- int firstGnssLocationTimeoutSeconds = sAgpsIsPresent ? 15 : 45;
- if (sSignalIsWeak) {
- // allow more time for weak signals
- firstGnssLocationTimeoutSeconds += 30;
- }
-
- test->wait(firstGnssLocationTimeoutSeconds);
- if (sAgpsIsPresent) {
- EXPECT_EQ(test->location_called_count_, 1);
- }
- if (test->location_called_count_ > 0) {
- CheckLocation(test->last_location_, checkAccuracies);
- return true;
- }
- return false;
-}
-
-/*
* GetLocation:
* Turns on location, waits 45 second for at least 5 locations,
* and checks them for reasonable validity.
@@ -329,21 +350,17 @@
* GPS signals initially optional for this test, so don't expect no timeout
* yet
*/
- bool gotLocation = StartAndGetSingleLocation(this, checkMoreAccuracies);
+ bool gotLocation = StartAndGetSingleLocation(checkMoreAccuracies);
if (gotLocation) {
for (int i = 1; i < LOCATIONS_TO_CHECK; i++) {
- EXPECT_EQ(std::cv_status::no_timeout,
- wait(LOCATION_TIMEOUT_SUBSEQUENT_SEC));
- EXPECT_EQ(location_called_count_, i + 1);
- CheckLocation(last_location_, checkMoreAccuracies);
+ EXPECT_EQ(std::cv_status::no_timeout, wait(LOCATION_TIMEOUT_SUBSEQUENT_SEC));
+ EXPECT_EQ(location_called_count_, i + 1);
+ CheckLocation(last_location_, checkMoreAccuracies);
}
}
- result = gnss_hal_->stop();
-
- ASSERT_TRUE(result.isOk());
- ASSERT_TRUE(result);
+ StopAndClearLocations();
}
/*
@@ -368,7 +385,9 @@
ASSERT_TRUE(resultVoid.isOk());
// Ensure we can get a good location after a bad injection has been deleted
- StartAndGetSingleLocation(this, false);
+ StartAndGetSingleLocation(false);
+
+ StopAndClearLocations();
}
/*
@@ -437,13 +456,13 @@
* stronger tests that require the presence of GPS signal.
*/
for (int i = 1; i < argc; i++) {
- if (strcmp(argv[i],"-agps") == 0) {
- sAgpsIsPresent = true;
- } else if (strcmp(argv[i],"-weak") == 0) {
- sSignalIsWeak = true;
+ if (strcmp(argv[i], "-agps") == 0) {
+ sAgpsIsPresent = true;
+ } else if (strcmp(argv[i], "-weak") == 0) {
+ sSignalIsWeak = true;
}
}
int status = RUN_ALL_TESTS();
ALOGI("Test result = %d", status);
return status;
-}
\ No newline at end of file
+}
diff --git a/graphics/composer/2.1/IComposerClient.hal b/graphics/composer/2.1/IComposerClient.hal
index 85572d4..f2ff932 100644
--- a/graphics/composer/2.1/IComposerClient.hal
+++ b/graphics/composer/2.1/IComposerClient.hal
@@ -1117,6 +1117,7 @@
VALIDATE_DISPLAY = 0x203 << OPCODE_SHIFT,
ACCEPT_DISPLAY_CHANGES = 0x204 << OPCODE_SHIFT,
PRESENT_DISPLAY = 0x205 << OPCODE_SHIFT,
+ PRESENT_OR_VALIDATE_DISPLAY = 0x206 << OPCODE_SHIFT,
/** layer commands (VALIDATE_DISPLAY not required) */
SET_LAYER_CURSOR_POSITION = 0x300 << OPCODE_SHIFT,
@@ -1135,6 +1136,7 @@
SET_LAYER_TRANSFORM = 0x408 << OPCODE_SHIFT,
SET_LAYER_VISIBLE_REGION = 0x409 << OPCODE_SHIFT,
SET_LAYER_Z_ORDER = 0x40a << OPCODE_SHIFT,
+ SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT = 0x40b << OPCODE_SHIFT,
/** 0x800 - 0xfff are reserved for vendor extensions */
/** 0x1000 - 0xffff are reserved */
diff --git a/graphics/composer/2.1/default/ComposerClient.cpp b/graphics/composer/2.1/default/ComposerClient.cpp
index ce4e17f..5a96e29 100644
--- a/graphics/composer/2.1/default/ComposerClient.cpp
+++ b/graphics/composer/2.1/default/ComposerClient.cpp
@@ -562,6 +562,8 @@
return parseSetOutputBuffer(length);
case IComposerClient::Command::VALIDATE_DISPLAY:
return parseValidateDisplay(length);
+ case IComposerClient::Command::PRESENT_OR_VALIDATE_DISPLAY:
+ return parsePresentOrValidateDisplay(length);
case IComposerClient::Command::ACCEPT_DISPLAY_CHANGES:
return parseAcceptDisplayChanges(length);
case IComposerClient::Command::PRESENT_DISPLAY:
@@ -739,6 +741,47 @@
return true;
}
+bool ComposerClient::CommandReader::parsePresentOrValidateDisplay(uint16_t length)
+{
+ if (length != CommandWriterBase::kPresentOrValidateDisplayLength) {
+ return false;
+ }
+
+ // First try to Present as is.
+ int presentFence = -1;
+ std::vector<Layer> layers;
+ std::vector<int> fences;
+ auto err = mHal.presentDisplay(mDisplay, &presentFence, &layers, &fences);
+ if (err == Error::NONE) {
+ mWriter.setPresentOrValidateResult(1);
+ mWriter.setPresentFence(presentFence);
+ mWriter.setReleaseFences(layers, fences);
+ return true;
+ }
+
+ // Present has failed. We need to fallback to validate
+ std::vector<Layer> changedLayers;
+ std::vector<IComposerClient::Composition> compositionTypes;
+ uint32_t displayRequestMask = 0x0;
+ std::vector<Layer> requestedLayers;
+ std::vector<uint32_t> requestMasks;
+
+ err = mHal.validateDisplay(mDisplay, &changedLayers,
+ &compositionTypes, &displayRequestMask,
+ &requestedLayers, &requestMasks);
+ if (err == Error::NONE) {
+ mWriter.setPresentOrValidateResult(0);
+ mWriter.setChangedCompositionTypes(changedLayers,
+ compositionTypes);
+ mWriter.setDisplayRequests(displayRequestMask,
+ requestedLayers, requestMasks);
+ } else {
+ mWriter.setError(getCommandLoc(), err);
+ }
+
+ return true;
+}
+
bool ComposerClient::CommandReader::parseAcceptDisplayChanges(uint16_t length)
{
if (length != CommandWriterBase::kAcceptDisplayChangesLength) {
diff --git a/graphics/composer/2.1/default/ComposerClient.h b/graphics/composer/2.1/default/ComposerClient.h
index 3d10f80..ee825fe 100644
--- a/graphics/composer/2.1/default/ComposerClient.h
+++ b/graphics/composer/2.1/default/ComposerClient.h
@@ -141,6 +141,7 @@
bool parseSetClientTarget(uint16_t length);
bool parseSetOutputBuffer(uint16_t length);
bool parseValidateDisplay(uint16_t length);
+ bool parsePresentOrValidateDisplay(uint16_t length);
bool parseAcceptDisplayChanges(uint16_t length);
bool parsePresentDisplay(uint16_t length);
bool parseSetLayerCursorPosition(uint16_t length);
diff --git a/graphics/composer/2.1/default/IComposerCommandBuffer.h b/graphics/composer/2.1/default/IComposerCommandBuffer.h
index fb78ef8..9ee5f4f 100644
--- a/graphics/composer/2.1/default/IComposerCommandBuffer.h
+++ b/graphics/composer/2.1/default/IComposerCommandBuffer.h
@@ -152,6 +152,13 @@
endCommand();
}
+ static constexpr uint32_t kPresentOrValidateDisplayResultLength = 1;
+ void setPresentOrValidateResult(uint32_t state) {
+ beginCommand(IComposerClient::Command::SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT, kPresentOrValidateDisplayResultLength);
+ write(state);
+ endCommand();
+ }
+
void setChangedCompositionTypes(const std::vector<Layer>& layers,
const std::vector<IComposerClient::Composition>& types)
{
@@ -284,6 +291,14 @@
endCommand();
}
+ static constexpr uint16_t kPresentOrValidateDisplayLength = 0;
+ void presentOrvalidateDisplay()
+ {
+ beginCommand(IComposerClient::Command::PRESENT_OR_VALIDATE_DISPLAY,
+ kPresentOrValidateDisplayLength);
+ endCommand();
+ }
+
static constexpr uint16_t kAcceptDisplayChangesLength = 0;
void acceptDisplayChanges()
{
diff --git a/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp b/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp
index 218c520..78353ea 100644
--- a/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp
+++ b/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp
@@ -421,7 +421,7 @@
public:
void TearDown() override {
if (key_blob_.size()) {
- EXPECT_EQ(ErrorCode::OK, DeleteKey());
+ CheckedDeleteKey();
}
AbortIfNeeded();
}
@@ -553,6 +553,13 @@
return error;
}
+ void CheckedDeleteKey(HidlBuf* key_blob, bool keep_key_blob = false) {
+ auto rc = DeleteKey(key_blob, keep_key_blob);
+ EXPECT_TRUE(rc == ErrorCode::OK || rc == ErrorCode::UNIMPLEMENTED);
+ }
+
+ void CheckedDeleteKey() { CheckedDeleteKey(&key_blob_); }
+
ErrorCode GetCharacteristics(const HidlBuf& key_blob, const HidlBuf& client_id,
const HidlBuf& app_data, KeyCharacteristics* key_characteristics) {
ErrorCode error = ErrorCode::UNKNOWN_ERROR;
@@ -773,7 +780,7 @@
KeyFormat::RAW, key));
string signature = MacMessage(message, digest, expected_mac.size() * 8);
EXPECT_EQ(expected_mac, signature) << "Test vector didn't match for digest " << (int)digest;
- DeleteKey();
+ CheckedDeleteKey();
}
void CheckAesCtrTestVector(const string& key, const string& nonce, const string& message,
@@ -1120,7 +1127,7 @@
EXPECT_TRUE(crypto_params.Contains(TAG_KEY_SIZE, key_size));
EXPECT_TRUE(crypto_params.Contains(TAG_RSA_PUBLIC_EXPONENT, 3));
- EXPECT_EQ(ErrorCode::OK, DeleteKey(&key_blob));
+ CheckedDeleteKey(&key_blob);
}
}
@@ -1165,7 +1172,7 @@
EXPECT_TRUE(crypto_params.Contains(TAG_ALGORITHM, Algorithm::EC));
EXPECT_TRUE(crypto_params.Contains(TAG_KEY_SIZE, key_size));
- EXPECT_EQ(ErrorCode::OK, DeleteKey(&key_blob));
+ CheckedDeleteKey(&key_blob);
}
}
@@ -1214,7 +1221,7 @@
EXPECT_EQ(ErrorCode::OK,
GenerateKey(AuthorizationSetBuilder().EcdsaSigningKey(size).Digest(Digest::NONE)))
<< "Failed to generate size: " << size;
- DeleteKey();
+ CheckedDeleteKey();
}
}
@@ -1230,7 +1237,7 @@
ErrorCode::OK,
GenerateKey(AuthorizationSetBuilder().EcdsaSigningKey(curve).Digest(Digest::SHA_2_512)))
<< "Failed to generate key on curve: " << curve;
- DeleteKey();
+ CheckedDeleteKey();
}
}
@@ -1280,7 +1287,7 @@
EXPECT_TRUE(softwareEnforced.Contains(TAG_KEY_SIZE, key_size));
}
- EXPECT_EQ(ErrorCode::OK, DeleteKey(&key_blob));
+ CheckedDeleteKey(&key_blob);
}
}
@@ -1308,7 +1315,7 @@
.HmacKey(key_size)
.Digest(Digest::SHA_2_256)
.Authorization(TAG_MIN_MAC_LENGTH, 256)));
- DeleteKey();
+ CheckedDeleteKey();
}
}
}
@@ -1340,7 +1347,7 @@
.HmacKey(128)
.Digest(Digest::SHA_2_256)
.Authorization(TAG_MIN_MAC_LENGTH, min_mac_length)));
- DeleteKey();
+ CheckedDeleteKey();
}
}
}
@@ -1730,7 +1737,7 @@
string message(1024, 'a');
if (digest == Digest::NONE) message.resize(key_size / 8);
SignMessage(message, AuthorizationSetBuilder().Digest(digest));
- DeleteKey();
+ CheckedDeleteKey();
}
}
}
@@ -1751,7 +1758,7 @@
string message(1024, 'a');
SignMessage(message, AuthorizationSetBuilder().Digest(Digest::SHA_2_256));
- DeleteKey();
+ CheckedDeleteKey();
}
}
@@ -1812,7 +1819,7 @@
string signature = MacMessage(message, digest, 160);
EXPECT_EQ(160U / 8U, signature.size())
<< "Failed to sign with HMAC key with digest " << digest;
- DeleteKey();
+ CheckedDeleteKey();
}
}
@@ -2199,7 +2206,8 @@
<< curve << ' ' << digest;
}
- ASSERT_EQ(ErrorCode::OK, DeleteKey());
+ auto rc = DeleteKey();
+ ASSERT_TRUE(rc == ErrorCode::OK || rc == ErrorCode::UNIMPLEMENTED);
}
}
@@ -2245,8 +2253,8 @@
VerifyMessage(verification_key, message, signature,
AuthorizationSetBuilder().Digest(Digest::SHA1));
- EXPECT_EQ(ErrorCode::OK, DeleteKey(&signing_key));
- EXPECT_EQ(ErrorCode::OK, DeleteKey(&verification_key));
+ CheckedDeleteKey(&signing_key);
+ CheckedDeleteKey(&verification_key);
}
typedef KeymasterHidlTest ExportKeyTest;
@@ -3520,14 +3528,14 @@
string key = make_string(key_bytes);
ASSERT_EQ(ErrorCode::OK, ImportKey(import_params, KeyFormat::RAW, key));
string plaintext = DecryptMessage(ciphertext, params);
- EXPECT_EQ(ErrorCode::OK, DeleteKey());
+ CheckedDeleteKey();
// Corrupt key and attempt to decrypt
key[0] = 0;
ASSERT_EQ(ErrorCode::OK, ImportKey(import_params, KeyFormat::RAW, key));
EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::DECRYPT, params));
EXPECT_EQ(ErrorCode::VERIFICATION_FAILED, Finish(ciphertext, &plaintext));
- EXPECT_EQ(ErrorCode::OK, DeleteKey());
+ CheckedDeleteKey();
}
/*
diff --git a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp
index fe67cb9..031584b 100644
--- a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp
+++ b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp
@@ -568,7 +568,8 @@
android::Vector<BufferInfo>* iBuffer,
android::Vector<BufferInfo>* oBuffer,
OMX_AUDIO_CODINGTYPE eEncoding,
- OMX_U32 kPortIndexInput, OMX_U32 kPortIndexOutput) {
+ OMX_U32 kPortIndexInput, OMX_U32 kPortIndexOutput,
+ AudioDecHidlTest::standardComp comp) {
android::hardware::media::omx::V1_0::Status status;
Message msg;
int timeOut = TIMEOUT_COUNTER;
@@ -580,7 +581,7 @@
if (status == android::hardware::media::omx::V1_0::Status::OK) {
EXPECT_EQ(msg.type, Message::Type::EVENT);
portReconfiguration(omxNode, observer, iBuffer, oBuffer, eEncoding,
- kPortIndexInput, kPortIndexOutput, msg);
+ kPortIndexInput, kPortIndexOutput, msg, comp);
}
// status == TIMED_OUT, it could be due to process time being large
// than DEFAULT_TIMEOUT or component needs output buffers to start
@@ -789,7 +790,7 @@
(int)Info.size(), compName);
eleStream.close();
waitOnInputConsumption(omxNode, observer, &iBuffer, &oBuffer, eEncoding,
- kPortIndexInput, kPortIndexOutput);
+ kPortIndexInput, kPortIndexOutput, compName);
testEOS(omxNode, observer, &iBuffer, &oBuffer, false, eosFlag);
EXPECT_EQ(timestampUslist.empty(), true);
// set state to idle
@@ -933,7 +934,7 @@
compName);
eleStream.close();
waitOnInputConsumption(omxNode, observer, &iBuffer, &oBuffer, eEncoding,
- kPortIndexInput, kPortIndexOutput);
+ kPortIndexInput, kPortIndexOutput, compName);
testEOS(omxNode, observer, &iBuffer, &oBuffer, false, eosFlag);
flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput,
kPortIndexOutput);
@@ -949,7 +950,7 @@
compName, false);
eleStream.close();
waitOnInputConsumption(omxNode, observer, &iBuffer, &oBuffer, eEncoding,
- kPortIndexInput, kPortIndexOutput);
+ kPortIndexInput, kPortIndexOutput, compName);
testEOS(omxNode, observer, &iBuffer, &oBuffer, true, eosFlag);
flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput,
kPortIndexOutput);
@@ -1034,7 +1035,7 @@
(int)Info.size(), compName, false);
eleStream.close();
waitOnInputConsumption(omxNode, observer, &iBuffer, &oBuffer, eEncoding,
- kPortIndexInput, kPortIndexOutput);
+ kPortIndexInput, kPortIndexOutput, compName);
testEOS(omxNode, observer, &iBuffer, &oBuffer, true, eosFlag);
flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput,
kPortIndexOutput);
diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp
index cd6eaf5..f6bc93a 100644
--- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp
+++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp
@@ -521,12 +521,15 @@
// Set Default port param.
void setDefaultPortParam(sp<IOmxNode> omxNode, OMX_U32 portIndex,
OMX_VIDEO_CODINGTYPE eCompressionFormat,
+ OMX_U32 nFrameWidth, OMX_U32 nFrameHeight,
OMX_U32 nBitrate, OMX_U32 xFramerate) {
android::hardware::media::omx::V1_0::Status status;
OMX_PARAM_PORTDEFINITIONTYPE portDef;
status = getPortParam(omxNode, OMX_IndexParamPortDefinition, portIndex,
&portDef);
EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+ portDef.format.video.nFrameWidth = nFrameWidth;
+ portDef.format.video.nFrameHeight = nFrameHeight;
portDef.format.video.nBitrate = nBitrate;
portDef.format.video.xFramerate = xFramerate;
portDef.format.video.bFlagErrorConcealment = OMX_TRUE;
@@ -1028,6 +1031,9 @@
} else if (msg.data.eventData.event == OMX_EventError) {
EXPECT_TRUE(false) << "Received OMX_EventError, not sure why";
break;
+ } else if (msg.data.eventData.event == OMX_EventDataSpaceChanged) {
+ // TODO: how am i supposed to respond now?
+ std::cout << "[ ] Info ! OMX_EventDataSpaceChanged \n";
} else {
ASSERT_TRUE(false);
}
@@ -1234,8 +1240,8 @@
// Configure output port
uint32_t nBitRate = 512000;
- setDefaultPortParam(omxNode, kPortIndexOutput, eCompressionFormat, nBitRate,
- xFramerate);
+ setDefaultPortParam(omxNode, kPortIndexOutput, eCompressionFormat,
+ nFrameWidth, nFrameHeight, nBitRate, xFramerate);
setRefreshPeriod(omxNode, kPortIndexOutput, 0);
unsigned int index;
@@ -1319,6 +1325,11 @@
setupRAWPort(omxNode, kPortIndexInput, nFrameWidth, nFrameHeight, 0,
xFramerate, eColorFormat);
+ // Configure output port
+ uint32_t nBitRate = 512000;
+ setDefaultPortParam(omxNode, kPortIndexOutput, eCompressionFormat,
+ nFrameWidth, nFrameHeight, nBitRate, xFramerate);
+
// CreateInputSurface
EXPECT_TRUE(omx->createInputSurface(
[&](android::hardware::media::omx::V1_0::Status _s,
diff --git a/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp b/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
index 094e8a1..e67f94f 100644
--- a/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
+++ b/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
@@ -46,8 +46,6 @@
{ 0x20, 0x01, 0x00 }
#define INVALID_COMMAND \
{ 0x20, 0x00, 0x00 }
-#define FAULTY_DATA_PACKET \
- { 0x00, 0x00, 0xFF }
#define LOOP_BACK_HEADER_SIZE 3
#define SYNTAX_ERROR 5
@@ -271,8 +269,8 @@
/*
* WriteInvalidAndThenValidCommand:
- * Sends an Faulty Data Packet
- * Waits for CORE_INTERFACE_ERROR_NTF
+ * Sends an Invalid command
+ * Waits for response
* Checks SYNTAX_ERROR status
* Repeat for 100 times appending 0xFF each time to the packet
* Send CORE_CONN_CREATE_CMD for loop-back mode
@@ -303,7 +301,7 @@
EXPECT_EQ((int)NfcStatus::OK, res.args->last_data_[3]);
// Send an Error Data Packet
- cmd = FAULTY_DATA_PACKET;
+ cmd = INVALID_COMMAND;
data = cmd;
size_t size = data.size();
@@ -311,13 +309,10 @@
data.resize(++size);
data[size - 1] = 0xFF;
EXPECT_EQ(data.size(), nfc_->write(data));
- // Wait for CORE_INTERFACE_ERROR_NTF
+ // Wait for response with SYNTAX_ERROR
res = nfc_cb_->WaitForCallback(kCallbackNameSendData);
EXPECT_TRUE(res.no_timeout);
- EXPECT_EQ(5ul, res.args->last_data_.size());
- EXPECT_EQ(0x60, res.args->last_data_[0]);
- EXPECT_EQ(0x08, res.args->last_data_[1]);
- EXPECT_EQ(0x02, res.args->last_data_[2]);
+ EXPECT_EQ(4ul, res.args->last_data_.size());
EXPECT_EQ(SYNTAX_ERROR, res.args->last_data_[3]);
}
diff --git a/radio/1.0/IRadioResponse.hal b/radio/1.0/IRadioResponse.hal
index 35ab899..8697e57 100644
--- a/radio/1.0/IRadioResponse.hal
+++ b/radio/1.0/IRadioResponse.hal
@@ -28,6 +28,12 @@
*
* Valid errors returned:
* RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getIccCardStatusResponse(RadioResponseInfo info, CardStatus cardStatus);
@@ -39,6 +45,13 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway supplyIccPinForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
@@ -50,6 +63,13 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT (PUK is invalid)
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway supplyIccPukForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
@@ -61,6 +81,13 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway supplyIccPin2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
@@ -71,6 +98,13 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT (PUK is invalid)
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway supplyIccPuk2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
@@ -82,6 +116,13 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway changeIccPinForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
@@ -93,6 +134,13 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT (old PIN2 is invalid)
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway changeIccPin2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
@@ -102,6 +150,7 @@
*
* Valid errors returned:
* RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
* RadioError:PASSWORD_INCORRECT (code is invalid)
* RadioError:NO_MEMORY
* RadioError:INVALID_SIM_STATE
@@ -109,6 +158,9 @@
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway supplyNetworkDepersonalizationResponse(RadioResponseInfo info, int32_t remainingRetries);
@@ -124,6 +176,8 @@
* RadioError:SYSTEM_ERR
* RadioError:INVALID_ARGUMENTS
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getCurrentCallsResponse(RadioResponseInfo info, vec<Call> calls);
@@ -152,6 +206,7 @@
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:CANCELLED
*/
oneway dialResponse(RadioResponseInfo info);
@@ -162,6 +217,13 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:SIM_ERR
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getIMSIForAppResponse(RadioResponseInfo info, string imsi);
@@ -177,6 +239,9 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:INVALID_CALL_ID
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway hangupConnectionResponse(RadioResponseInfo info);
@@ -196,6 +261,7 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:CANCELLED
*/
oneway hangupWaitingOrBackgroundResponse(RadioResponseInfo info);
@@ -215,6 +281,8 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway hangupForegroundResumeBackgroundResponse(RadioResponseInfo info);
@@ -235,6 +303,8 @@
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway switchWaitingOrHoldingAndActiveResponse(RadioResponseInfo info);
@@ -254,6 +324,8 @@
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway conferenceResponse(RadioResponseInfo info);
@@ -274,6 +346,8 @@
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway rejectCallResponse(RadioResponseInfo info);
@@ -322,6 +396,9 @@
* RadioError:INTERNAL_ERR
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getLastCallFailCauseResponse(RadioResponseInfo info,
LastCallFailCauseInfo failCauseinfo);
@@ -339,6 +416,8 @@
* RadioError:MODEM_ERR
* RadioError:NOT_PROVISIONED
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getSignalStrengthResponse(RadioResponseInfo info, SignalStrength sigStrength);
@@ -350,6 +429,11 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getVoiceRegistrationStateResponse(RadioResponseInfo info,
VoiceRegStateResult voiceRegResponse);
@@ -368,6 +452,8 @@
* RadioError:MODEM_ERR
* RadioError:NOT_PROVISIONED
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getDataRegistrationStateResponse(RadioResponseInfo info,
DataRegStateResult dataRegResponse);
@@ -385,6 +471,8 @@
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getOperatorResponse(RadioResponseInfo info, string longName, string shortName,
string numeric);
@@ -406,6 +494,8 @@
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:INVALID_MODEM_STATE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setRadioPowerResponse(RadioResponseInfo info);
@@ -423,6 +513,7 @@
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:CANCELLED
* RadioError:INVALID_MODEM_STATE
*/
oneway sendDtmfResponse(RadioResponseInfo info);
@@ -452,6 +543,8 @@
* RadioError:INVALID_MODEM_STATE
* RadioError:NETWORK_NOT_READY
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway sendSmsResponse(RadioResponseInfo info, SendSmsResult sms);
@@ -481,6 +574,8 @@
* RadioError:INVALID_MODEM_STATE
* RadioError:NETWORK_NOT_READY
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway sendSMSExpectMoreResponse(RadioResponseInfo info, SendSmsResult sms);
@@ -497,7 +592,10 @@
* RadioError:OP_NOT_ALLOWED_DURING_VOICE_CALL
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_ARGUMENTS
- * RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setupDataCallResponse(RadioResponseInfo info, SetupDataCallResult dcResponse);
@@ -510,6 +608,13 @@
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_PIN2
* RadioError:SIM_PUK2
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:SIM_ERR
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway iccIOForAppResponse(RadioResponseInfo info, IccIoResult iccIo);
@@ -534,6 +639,8 @@
* RadioError:INVALID_STATE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway sendUssdResponse(RadioResponseInfo info);
@@ -553,6 +660,8 @@
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway cancelPendingUssdResponse(RadioResponseInfo info);
@@ -574,6 +683,8 @@
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getClirResponse(RadioResponseInfo info, int32_t n, int32_t m);
@@ -591,6 +702,8 @@
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setClirResponse(RadioResponseInfo info);
@@ -620,6 +733,8 @@
* RadioError:FDN_CHECK_FAILURE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:SYSTEM_ERR
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getCallForwardStatusResponse(RadioResponseInfo info,
vec<CallForwardInfo> callForwardInfos);
@@ -642,6 +757,8 @@
* RadioError:FDN_CHECK_FAILURE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setCallForwardResponse(RadioResponseInfo info);
@@ -669,6 +786,8 @@
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getCallWaitingResponse(RadioResponseInfo info, bool enable, int32_t serviceClass);
@@ -690,6 +809,8 @@
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setCallWaitingResponse(RadioResponseInfo info);
@@ -699,6 +820,11 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway acknowledgeLastIncomingGsmSmsResponse(RadioResponseInfo info);
@@ -717,6 +843,8 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway acceptCallResponse(RadioResponseInfo info);
@@ -730,6 +858,10 @@
* RadioError:INVALID_STATE
* RadioError:INVALID_ARGUMENTS
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway deactivateDataCallResponse(RadioResponseInfo info);
@@ -752,6 +884,8 @@
* RadioError:SYSTEM_ERR
* RadioError:FDN_CHECK_FAILURE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getFacilityLockForAppResponse(RadioResponseInfo info, int32_t response);
@@ -774,6 +908,8 @@
* RadioError:FDN_CHECK_FAILURE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setFacilityLockForAppResponse(RadioResponseInfo info, int32_t retry);
@@ -793,6 +929,8 @@
* RadioError:SYSTEM_ERR
* RadioError:FDN_CHECK_FAILURE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setBarringPasswordResponse(RadioResponseInfo info);
@@ -809,6 +947,8 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getNetworkSelectionModeResponse(RadioResponseInfo info, bool manual);
@@ -826,6 +966,8 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*
* Returns RadioError:ILLEGAL_SIM_OR_ME when the failure is permanent and
* no retries needed, such as illegal SIM or ME.
@@ -847,6 +989,8 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*
* Returns RadioError:ILLEGAL_SIM_OR_ME when the failure is permanent and
* no retries needed, such as illegal SIM or ME.
@@ -869,6 +1013,8 @@
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:CANCELLED
+ * RadioError:NO_RESOURCES
+ * RadioError:INTERNAL_ERR
*/
oneway getAvailableNetworksResponse(RadioResponseInfo info,
vec<OperatorInfo> networkInfos);
@@ -888,6 +1034,7 @@
* RadioError:INVALID_CALL_ID
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:CANCELLED
* RadioError:INVALID_MODEM_STATE
*/
oneway startDtmfResponse(RadioResponseInfo info);
@@ -907,6 +1054,7 @@
* RadioError:INTERNAL_ERR
* RadioError:INVALID_CALL_ID
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:CANCELLED
* RadioError:INVALID_MODEM_STATE
*/
oneway stopDtmfResponse(RadioResponseInfo info);
@@ -925,6 +1073,8 @@
* RadioError:MODEM_ERR
* RadioError:NOT_PROVISIONED
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getBasebandVersionResponse(RadioResponseInfo info, string version);
@@ -945,6 +1095,7 @@
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:CANCELLED
*/
oneway separateConnectionResponse(RadioResponseInfo info);
@@ -960,6 +1111,8 @@
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setMuteResponse(RadioResponseInfo info);
@@ -979,6 +1132,8 @@
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getMuteResponse(RadioResponseInfo info, bool enable);
@@ -996,6 +1151,8 @@
* RadioError:INTERNAL_ERR
* RadioError:FDN_CHECK_FAILURE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getClipResponse(RadioResponseInfo info, ClipStatus status);
@@ -1006,6 +1163,11 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getDataCallListResponse(RadioResponseInfo info, vec<SetupDataCallResult> dcResponse);
@@ -1022,6 +1184,8 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setSuppServiceNotificationsResponse(RadioResponseInfo info);
@@ -1031,6 +1195,7 @@
*
* Valid errors returned:
* RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_FULL
* RadioError:INVALID_ARGUMENTS
* RadioError:INVALID_SMS_FORMAT
@@ -1045,6 +1210,8 @@
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway writeSmsToSimResponse(RadioResponseInfo info, int32_t index);
@@ -1053,6 +1220,8 @@
*
* Valid errors returned:
* RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SIM_FULL
* RadioError:INVALID_ARGUMENTS
* RadioError:NO_MEMORY
* RadioError:SYSTEM_ERR
@@ -1061,6 +1230,8 @@
* RadioError:INTERNAL_ERR
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
* RadioError:INVALID_MODEM_STATE
*/
oneway deleteSmsOnSimResponse(RadioResponseInfo info);
@@ -1078,6 +1249,8 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setBandModeResponse(RadioResponseInfo info);
@@ -1094,6 +1267,8 @@
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getAvailableBandModesResponse(RadioResponseInfo info, vec<RadioBandMode> bandModes);
@@ -1107,6 +1282,13 @@
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_BUSY
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:MODEM_ERR
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway sendEnvelopeResponse(RadioResponseInfo info, string commandResponse);
@@ -1118,6 +1300,12 @@
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway sendTerminalResponseToSimResponse(RadioResponseInfo info);
@@ -1126,11 +1314,15 @@
*
* Valid errors returned:
* RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway handleStkCallSetupRequestFromSimResponse(RadioResponseInfo info);
@@ -1151,6 +1343,8 @@
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway explicitCallTransferResponse(RadioResponseInfo info);
@@ -1168,6 +1362,8 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setPreferredNetworkTypeResponse(RadioResponseInfo info);
@@ -1184,6 +1380,8 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getPreferredNetworkTypeResponse(RadioResponseInfo info,
PreferredNetworkType nwType);
@@ -1202,6 +1400,8 @@
* RadioError:MODEM_ERR
* RadioError:NO_NETWORK_FOUND
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getNeighboringCidsResponse(RadioResponseInfo info, vec<NeighboringCell> cells);
@@ -1217,6 +1417,8 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setLocationUpdatesResponse(RadioResponseInfo info);
@@ -1228,6 +1430,11 @@
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_ABSENT
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway setCdmaSubscriptionSourceResponse(RadioResponseInfo info);
@@ -1244,6 +1451,8 @@
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setCdmaRoamingPreferenceResponse(RadioResponseInfo info);
@@ -1260,6 +1469,8 @@
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getCdmaRoamingPreferenceResponse(RadioResponseInfo info, CdmaRoamingType type);
@@ -1275,6 +1486,8 @@
* RadioError:NO_MEMORY
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setTTYModeResponse(RadioResponseInfo info);
@@ -1291,6 +1504,8 @@
* RadioError:NO_MEMORY
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getTTYModeResponse(RadioResponseInfo info, TtyMode mode);
@@ -1307,6 +1522,8 @@
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_CALL_ID
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setPreferredVoicePrivacyResponse(RadioResponseInfo info);
@@ -1324,6 +1541,8 @@
* RadioError:NO_MEMORY
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getPreferredVoicePrivacyResponse(RadioResponseInfo info, bool enable);
@@ -1344,6 +1563,8 @@
* RadioError:INVALID_STATE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway sendCDMAFeatureCodeResponse(RadioResponseInfo info);
@@ -1361,6 +1582,9 @@
* RadioError:INVALID_CALL_ID
* RadioError:INVALID_STATE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
* RadioError:MODE_NOT_SUPPORTED
*/
oneway sendBurstDtmfResponse(RadioResponseInfo info);
@@ -1391,6 +1615,8 @@
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:ENCODING_ERR
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway sendCdmaSmsResponse(RadioResponseInfo info, SendSmsResult sms);
@@ -1413,6 +1639,8 @@
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway acknowledgeLastIncomingCdmaSmsResponse(RadioResponseInfo info);
@@ -1432,6 +1660,9 @@
* RadioError:NO_RESOURCES
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway getGsmBroadcastConfigResponse(RadioResponseInfo info,
vec<GsmBroadcastSmsConfigInfo> configs);
@@ -1450,6 +1681,9 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway setGsmBroadcastConfigResponse(RadioResponseInfo info);
@@ -1468,6 +1702,9 @@
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway setGsmBroadcastActivationResponse(RadioResponseInfo info);
@@ -1487,6 +1724,9 @@
* RadioError:NO_RESOURCES
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway getCdmaBroadcastConfigResponse(RadioResponseInfo info,
vec<CdmaBroadcastSmsConfigInfo> configs);
@@ -1505,6 +1745,9 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway setCdmaBroadcastConfigResponse(RadioResponseInfo info);
@@ -1523,6 +1766,9 @@
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway setCdmaBroadcastActivationResponse(RadioResponseInfo info);
@@ -1547,6 +1793,8 @@
* RadioError:MODEM_ERR
* RadioError:NOT_PROVISIONED
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getCDMASubscriptionResponse(RadioResponseInfo info, string mdn, string hSid,
string hNid, string min, string prl);
@@ -1572,6 +1820,9 @@
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
*/
oneway writeSmsToRuimResponse(RadioResponseInfo info, uint32_t index);
@@ -1588,6 +1839,9 @@
* RadioError:NO_SUCH_ENTRY
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
* RadioError:INVALID_MODEM_STATE
*/
oneway deleteSmsOnRuimResponse(RadioResponseInfo info);
@@ -1608,6 +1862,9 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:NOT_PROVISIONED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*
* If a empty string value is returned for any of the device id, it means that there was error
* accessing the device.
@@ -1629,6 +1886,8 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:MODEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway exitEmergencyCallbackModeResponse(RadioResponseInfo info);
@@ -1649,6 +1908,8 @@
* RadioError:NOT_PROVISIONED
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getSmscAddressResponse(RadioResponseInfo info, string smsc);
@@ -1668,6 +1929,8 @@
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setSmscAddressResponse(RadioResponseInfo info);
@@ -1685,6 +1948,8 @@
* RadioError:INVALID_STATE
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway reportSmsMemoryStatusResponse(RadioResponseInfo info);
@@ -1694,6 +1959,11 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway reportStkServiceIsRunningResponse(RadioResponseInfo info);
@@ -1705,6 +1975,11 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getCdmaSubscriptionSourceResponse(RadioResponseInfo info, CdmaSubscriptionSource source);
@@ -1715,6 +1990,13 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway requestIsimAuthenticationResponse(RadioResponseInfo info, string response);
@@ -1724,6 +2006,11 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway acknowledgeIncomingGsmSmsWithPduResponse(RadioResponseInfo info);
@@ -1736,6 +2023,11 @@
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_BUSY
* RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway sendEnvelopeWithStatusResponse(RadioResponseInfo info, IccIoResult iccIo);
@@ -1746,6 +2038,11 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getVoiceRadioTechnologyResponse(RadioResponseInfo info, RadioTechnology rat);
@@ -1762,6 +2059,8 @@
* RadioError:MODEM_ERR
* RadioError:NO_NETWORK_FOUND
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getCellInfoListResponse(RadioResponseInfo info, vec<CellInfo> cellInfo);
@@ -1775,6 +2074,9 @@
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway setCellInfoListRateResponse(RadioResponseInfo info);
@@ -1792,6 +2094,8 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:NOT_PROVISIONED
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setInitialAttachApnResponse(RadioResponseInfo info);
@@ -1804,12 +2108,12 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:NO_MEMORY
* RadioError:INTERNAL_ERR
- * RadioError:SYSTEM_ERR
- * RadioError:REQUEST_NOT_SUPPORTED
- * RadioError:MODEM_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
* RadioError:INVALID_MODEM_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getImsRegistrationStateResponse(RadioResponseInfo info, bool isRegistered,
RadioTechnologyFamily ratFamily);
@@ -1837,6 +2141,8 @@
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:NETWORK_NOT_READY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway sendImsSmsResponse(RadioResponseInfo info, SendSmsResult sms);
@@ -1847,6 +2153,11 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway iccTransmitApduBasicChannelResponse(RadioResponseInfo info, IccIoResult result);
@@ -1861,6 +2172,14 @@
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MISSING_RESOURCE
* RadioError:NO_SUCH_ELEMENT
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:SIM_ERR
+ * RadioError:INVALID_SIM_STATE
+ * RadioError:MISSING_RESOURCE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway iccOpenLogicalChannelResponse(RadioResponseInfo info, int32_t channelId,
vec<int8_t> selectResponse);
@@ -1871,6 +2190,11 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway iccCloseLogicalChannelResponse(RadioResponseInfo info);
@@ -1881,6 +2205,11 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway iccTransmitApduLogicalChannelResponse(RadioResponseInfo info, IccIoResult result);
@@ -1891,6 +2220,7 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway nvReadItemResponse(RadioResponseInfo info, string result);
@@ -1900,6 +2230,7 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway nvWriteItemResponse(RadioResponseInfo info);
@@ -1909,6 +2240,7 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway nvWriteCdmaPrlResponse(RadioResponseInfo info);
@@ -1918,6 +2250,7 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway nvResetConfigResponse(RadioResponseInfo info);
@@ -1934,6 +2267,8 @@
* RadioError:MODEM_ERR
* RadioError:INVALID_ARGUMENTS
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setUiccSubscriptionResponse(RadioResponseInfo info);
@@ -1950,6 +2285,9 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:DEVICE_IN_USE
* RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway setDataAllowedResponse(RadioResponseInfo info);
@@ -1960,6 +2298,7 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getHardwareConfigResponse(RadioResponseInfo info, vec<HardwareConfig> config);
@@ -1970,6 +2309,14 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:INVALID_MODEM_STATE
+ * RadioError:SIM_ERR
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway requestIccSimAuthenticationResponse(RadioResponseInfo info, IccIoResult result);
@@ -1980,6 +2327,11 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway setDataProfileResponse(RadioResponseInfo info);
@@ -1994,6 +2346,8 @@
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway requestShutdownResponse(RadioResponseInfo info);
@@ -2007,6 +2361,10 @@
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:INVALID_STATE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway getRadioCapabilityResponse(RadioResponseInfo info, RadioCapability rc);
@@ -2026,6 +2384,8 @@
* RadioError:MODEM_ERR
* RadioError:INVALID_STATE
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setRadioCapabilityResponse(RadioResponseInfo info, RadioCapability rc);
@@ -2039,6 +2399,9 @@
* RadioError:LCE_NOT_SUPPORTED
* RadioError:INTERNAL_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway startLceServiceResponse(RadioResponseInfo info, LceStatusInfo statusInfo);
@@ -2050,6 +2413,11 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:LCE_NOT_SUPPORTED
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway stopLceServiceResponse(RadioResponseInfo info, LceStatusInfo statusInfo);
@@ -2062,6 +2430,10 @@
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:LCE_NOT_SUPPORTED
* RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway pullLceDataResponse(RadioResponseInfo info, LceDataInfo lceInfo);
@@ -2077,6 +2449,9 @@
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:NOT_PROVISIONED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ * RadioError:REQUEST_NOT_SUPPORTED
*/
oneway getModemActivityInfoResponse(RadioResponseInfo info, ActivityStatsInfo activityInfo);
@@ -2122,6 +2497,8 @@
* RadioError:SYSTEM_ERR
* RadioError:INVALID_ARGUMENTS
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway sendDeviceStateResponse(RadioResponseInfo info);
@@ -2136,6 +2513,8 @@
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setIndicationFilterResponse(RadioResponseInfo info);
@@ -2147,6 +2526,10 @@
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_ARGUMENTS
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
*/
oneway setSimCardPowerResponse(RadioResponseInfo info);
diff --git a/radio/1.1/Android.mk b/radio/1.1/Android.mk
index 21c4a6a..b83ac80 100644
--- a/radio/1.1/Android.mk
+++ b/radio/1.1/Android.mk
@@ -94,6 +94,82 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (KeepaliveRequest)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveRequest.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.radio@1.1::types.KeepaliveRequest
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (KeepaliveStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveStatus.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.radio@1.1::types.KeepaliveStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (KeepaliveStatusCode)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveStatusCode.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.radio@1.1::types.KeepaliveStatusCode
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (KeepaliveType)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveType.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.radio@1.1::types.KeepaliveType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (NetworkScanRequest)
#
GEN := $(intermediates)/android/hardware/radio/V1_1/NetworkScanRequest.java
@@ -275,6 +351,8 @@
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadioResponse.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
@@ -381,6 +459,82 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (KeepaliveRequest)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveRequest.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.radio@1.1::types.KeepaliveRequest
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (KeepaliveStatus)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveStatus.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.radio@1.1::types.KeepaliveStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (KeepaliveStatusCode)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveStatusCode.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.radio@1.1::types.KeepaliveStatusCode
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (KeepaliveType)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveType.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.radio@1.1::types.KeepaliveType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (NetworkScanRequest)
#
GEN := $(intermediates)/android/hardware/radio/V1_1/NetworkScanRequest.java
@@ -562,6 +716,8 @@
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadioResponse.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
diff --git a/radio/1.1/IRadio.hal b/radio/1.1/IRadio.hal
index ea9b96f..22d27d4 100644
--- a/radio/1.1/IRadio.hal
+++ b/radio/1.1/IRadio.hal
@@ -89,4 +89,24 @@
* Response function is IRadioResponse.stopNetworkScanResponse()
*/
oneway stopNetworkScan(int32_t serial);
+
+ /**
+ * Start a Keepalive session (for IPsec)
+ *
+ * @param serial Serial number of request.
+ * @param keepalive A request structure containing all necessary info to describe a keepalive
+ *
+ * Response function is IRadioResponse.startKeepaliveResponse()
+ */
+ oneway startKeepalive(int32_t serial, KeepaliveRequest keepalive);
+
+ /**
+ * Stop an ongoing Keepalive session (for IPsec)
+ *
+ * @param serial Serial number of request.
+ * @param sessionHandle The handle that was provided by IRadioResponse.startKeepaliveResponse
+ *
+ * Response function is IRadioResponse.stopKeepaliveResponse()
+ */
+ oneway stopKeepalive(int32_t serial, int32_t sessionHandle);
};
diff --git a/radio/1.1/IRadioIndication.hal b/radio/1.1/IRadioIndication.hal
index 27b6ec2..a0ad9b2 100644
--- a/radio/1.1/IRadioIndication.hal
+++ b/radio/1.1/IRadioIndication.hal
@@ -39,4 +39,15 @@
* @param result Network scan result as NetworkScanResult defined in types.hal
*/
oneway networkScanResult(RadioIndicationType type, NetworkScanResult result);
-};
\ No newline at end of file
+
+ /**
+ * Indicates a status update for a particular Keepalive session. This must include
+ * a handle for a previous session and should include a status update regarding the
+ * state of a keepalive. Unsolicited keepalive status reports should never be
+ * PENDING as unsolicited status should only be sent when known.
+ *
+ * @param type Type of radio indication
+ * @param status Status information for a Keepalive session
+ */
+ oneway keepaliveStatus(RadioIndicationType type, KeepaliveStatus status);
+};
diff --git a/radio/1.1/IRadioResponse.hal b/radio/1.1/IRadioResponse.hal
index 7415252..4e7bf43 100644
--- a/radio/1.1/IRadioResponse.hal
+++ b/radio/1.1/IRadioResponse.hal
@@ -71,4 +71,26 @@
* RadioError:MODEM_ERR
*/
oneway stopNetworkScanResponse(RadioResponseInfo info);
+
+ /**
+ * @param info Response info struct containing response type, serial no. and error
+ * @param status Status object containing a new handle and a current status. The
+ * status returned here may be PENDING to indicate that the radio has not yet
+ * processed the keepalive request.
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:NO_RESOURCES
+ * RadioError:INVALID_ARGUMENTS
+ */
+ oneway startKeepaliveResponse(RadioResponseInfo info, KeepaliveStatus status);
+
+ /**
+ * @param info Response info struct containing response type, serial no. and error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:INVALID_ARGUMENTS
+ */
+ oneway stopKeepaliveResponse(RadioResponseInfo info);
};
diff --git a/radio/1.1/types.hal b/radio/1.1/types.hal
index bdd0338..a8d836c 100644
--- a/radio/1.1/types.hal
+++ b/radio/1.1/types.hal
@@ -132,6 +132,19 @@
COMPLETE = 2, // The result contains the last part of the scan results
};
+enum KeepaliveType : int32_t {
+ NATT_IPV4 = 0, // Keepalive specified by RFC 3948 Sec. 2.3 using IPv4
+ NATT_IPV6 = 1, // Keepalive specified by RFC 3948 Sec. 2.3 using IPv6
+};
+
+enum KeepaliveStatusCode : int32_t {
+ ACTIVE, // Keepalive is currently active
+ INACTIVE, // Keepalive is inactive, which indicates an error
+ PENDING, // Requested keepalive has not yet been processed by
+ // the modem. Only allowed in a RESPONSE message to
+ // a REQUEST
+};
+
struct RadioAccessSpecifier {
RadioAccessNetworks radioAccessNetwork; // The type of network to scan
vec<GeranBands> geranBands; // Valid only if radioAccessNetwork = GERAN
@@ -182,3 +195,24 @@
// identity.
int64_t expirationTime; // date-time in UTC when the key will expire.
};
+
+struct KeepaliveRequest {
+ KeepaliveType type; // The format of the keepalive packet
+ vec<uint8_t> sourceAddress; // source address with type = family, in network
+ // byte order
+ int32_t sourcePort; // source port if relevant for the given type
+ // INT_MAX: 0x7FFFFFFF denotes that the field is unused
+ vec<uint8_t> destinationAddress; // destination address with type = family, in network
+ // byte order
+ int32_t destinationPort; // destination if relevant for the given type
+ // INT_MAX: 0x7FFFFFFF denotes that the field is unused
+ int32_t maxKeepaliveIntervalMillis; // the max interval between packets, in milliseconds
+ int32_t cid; // Context ID, returned in setupDataCallResponse
+ // that uniquely identifies the data call to which
+ // this keepalive must applied
+};
+
+struct KeepaliveStatus {
+ int32_t sessionHandle; // the sessionHandle provided by the api
+ KeepaliveStatusCode code; // status for the given keepalive
+};
diff --git a/sensors/1.0/default/convert.cpp b/sensors/1.0/default/convert.cpp
index 2908737..a5747d4 100644
--- a/sensors/1.0/default/convert.cpp
+++ b/sensors/1.0/default/convert.cpp
@@ -67,9 +67,11 @@
typedef ::android::hardware::sensors::V1_0::SensorType SensorType;
typedef ::android::hardware::sensors::V1_0::MetaDataEventType MetaDataEventType;
- dst->sensorHandle = src.sensor;
- dst->sensorType = (SensorType)src.type;
- dst->timestamp = src.timestamp;
+ *dst = {
+ .sensorHandle = src.sensor,
+ .sensorType = (SensorType)src.type,
+ .timestamp = src.timestamp
+ };
switch (dst->sensorType) {
case SensorType::META_DATA:
@@ -206,13 +208,13 @@
}
void convertToSensorEvent(const Event &src, sensors_event_t *dst) {
- dst->version = sizeof(sensors_event_t);
- dst->sensor = src.sensorHandle;
- dst->type = (int32_t)src.sensorType;
- dst->reserved0 = 0;
- dst->timestamp = src.timestamp;
- dst->flags = 0;
- dst->reserved1[0] = dst->reserved1[1] = dst->reserved1[2] = 0;
+ *dst = {
+ .version = sizeof(sensors_event_t),
+ .sensor = src.sensorHandle,
+ .type = (int32_t)src.sensorType,
+ .reserved0 = 0,
+ .timestamp = src.timestamp
+ };
switch (src.sensorType) {
case SensorType::META_DATA:
diff --git a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
index c92603b..4842946 100644
--- a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
+++ b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
@@ -697,6 +697,7 @@
SensorFlagBits SensorsHidlTest::expectedReportModeForType(SensorType type) {
switch (type) {
case SensorType::ACCELEROMETER:
+ case SensorType::ACCELEROMETER_UNCALIBRATED:
case SensorType::GYROSCOPE:
case SensorType::MAGNETIC_FIELD:
case SensorType::ORIENTATION:
@@ -719,7 +720,6 @@
case SensorType::AMBIENT_TEMPERATURE:
case SensorType::HEART_RATE:
case SensorType::DEVICE_ORIENTATION:
- case SensorType::MOTION_DETECT:
case SensorType::STEP_COUNTER:
case SensorType::LOW_LATENCY_OFFBODY_DETECT:
return SensorFlagBits::ON_CHANGE_MODE;
@@ -728,6 +728,8 @@
case SensorType::WAKE_GESTURE:
case SensorType::GLANCE_GESTURE:
case SensorType::PICK_UP_GESTURE:
+ case SensorType::MOTION_DETECT:
+ case SensorType::STATIONARY_DETECT:
return SensorFlagBits::ONE_SHOT_MODE;
case SensorType::STEP_DETECTOR:
diff --git a/vibrator/1.1/Android.bp b/vibrator/1.1/Android.bp
index 86562a0..ee81d83 100644
--- a/vibrator/1.1/Android.bp
+++ b/vibrator/1.1/Android.bp
@@ -41,6 +41,7 @@
cc_library_shared {
name: "android.hardware.vibrator@1.1",
+ defaults: ["hidl-module-defaults"],
generated_sources: ["android.hardware.vibrator@1.1_genc++"],
generated_headers: ["android.hardware.vibrator@1.1_genc++_headers"],
export_generated_headers: ["android.hardware.vibrator@1.1_genc++_headers"],
diff --git a/wifi/offload/1.0/IOffload.hal b/wifi/offload/1.0/IOffload.hal
index 7ad902c..4819519 100644
--- a/wifi/offload/1.0/IOffload.hal
+++ b/wifi/offload/1.0/IOffload.hal
@@ -25,21 +25,28 @@
*
* @param ScanParam paramters for scanning
* @param ScanFilter settings to filter scan result
- * @return boolean status indicating success (true) when configuration
- * is applied or failure (false) for invalid configuration
+ * @return OffloadStatus indicating status of operation provided by this API
+ * If OffloadStatusCode::OK is returned, the operation was successful
+ * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost
+ * If OffloadStatusCode::ERROR is returned, requested operation could not be completed
*/
@entry
@callflow(next={"setEventCallback", "subscribeScanResults"})
- configureScans(ScanParam param, ScanFilter filter);
+ configureScans(ScanParam param, ScanFilter filter) generates (OffloadStatus status);
/**
* Get scan statistics
*
+ * @return OffloadStatus indicating status of operation provided by this API
* @return ScanStats statistics of scans performed
+ * If OffloadStatusCode::OK is returned, the operation was successful
+ * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost
+ * If OffloadStatusCode::ERROR is returned, requested operation could not be completed
+ * If OffloadStatusCode::TIMEOUT is returned, time out waiting for the requested data
*/
@exit
@callflow(next={"subscribeScanResults", "unsubscribeScanResults", "getScanStats"})
- getScanStats() generates (ScanStats scanStats);
+ getScanStats() generates (OffloadStatus status, ScanStats scanStats);
/**
* Subscribe to asynchronous scan events sent by offload module. This enables
@@ -50,9 +57,13 @@
*
* @param delayMs an integer expressing the minimum delay in mS after
* subscribing when scan results must be delivered to the client
+ * @return OffloadStatus indicating status of operation provided by this API
+ * If OffloadStatusCode::OK is returned, the operation was successful
+ * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost
+ * If OffloadStatusCode::ERROR is returned, requested operation could not be completed
*/
@callflow(next={"unsubscribeScanResults", "getScanStats"})
- subscribeScanResults(uint32_t delayMs);
+ subscribeScanResults(uint32_t delayMs) generates (OffloadStatus status);
/**
* Unsubscribe to scan events sent by the offload module, hence disabling scans.
diff --git a/wifi/offload/1.0/types.hal b/wifi/offload/1.0/types.hal
index 38d5eda..234f3fc 100644
--- a/wifi/offload/1.0/types.hal
+++ b/wifi/offload/1.0/types.hal
@@ -202,18 +202,25 @@
/**
* Defines a list of return codes to indicate status of Offload HAL
*/
-enum OffloadStatus : uint32_t {
+enum OffloadStatusCode : uint32_t {
/* No error */
- OFFLOAD_STATUS_OK,
+ OK,
/* No Connection to underlying implementation */
- OFFLOAD_STATUS_NO_CONNECTION,
+ NO_CONNECTION,
/* Operation timeout */
- OFFLOAD_STATUS_TIMEOUT,
+ TIMEOUT,
/* Other errors */
- OFFLOAD_STATUS_ERROR
+ ERROR
};
-
+/**
+ * Generic structures to return the status of an operation
+ */
+struct OffloadStatus {
+ OffloadStatusCode code;
+ /* Error message */
+ string description;
+};
diff --git a/wifi/offload/1.0/vts/functional/VtsHalWifiOffloadV1_0TargetTest.cpp b/wifi/offload/1.0/vts/functional/VtsHalWifiOffloadV1_0TargetTest.cpp
index 3020542..55f5a87 100644
--- a/wifi/offload/1.0/vts/functional/VtsHalWifiOffloadV1_0TargetTest.cpp
+++ b/wifi/offload/1.0/vts/functional/VtsHalWifiOffloadV1_0TargetTest.cpp
@@ -26,6 +26,8 @@
#include <vector>
+#include "hidl_call_util.h"
+
using ::android::hardware::wifi::offload::V1_0::IOffload;
using ::android::hardware::wifi::offload::V1_0::IOffloadCallback;
using ::android::hardware::wifi::offload::V1_0::ScanResult;
@@ -33,6 +35,7 @@
using ::android::hardware::wifi::offload::V1_0::ScanFilter;
using ::android::hardware::wifi::offload::V1_0::ScanStats;
using ::android::hardware::wifi::offload::V1_0::OffloadStatus;
+using ::android::hardware::wifi::offload::V1_0::OffloadStatusCode;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -89,7 +92,7 @@
return Void();
};
- Return<void> onError(OffloadStatus status) {
+ Return<void> onError(const OffloadStatus& status) override {
OffloadCallbackArgs args;
args.error_code_ = status;
NotifyFromCallback(kOffloadCallbackSendError, args);
@@ -106,15 +109,15 @@
*/
TEST_F(WifiOffloadHidlTest, setEventCallback) {
auto returnObject = wifi_offload_->setEventCallback(wifi_offload_cb_);
- ASSERT_EQ(returnObject.isOk(), true);
+ ASSERT_EQ(true, returnObject.isOk());
}
/*
* Verify that subscribeScanResults method returns without errors
*/
TEST_F(WifiOffloadHidlTest, subscribeScanResults) {
- auto returnObject = wifi_offload_->subscribeScanResults(0);
- ASSERT_EQ(returnObject.isOk(), true);
+ const auto& result = HIDL_INVOKE(wifi_offload_, subscribeScanResults, 0);
+ ASSERT_EQ(OffloadStatusCode::OK, result.code);
}
/*
@@ -122,7 +125,7 @@
*/
TEST_F(WifiOffloadHidlTest, unsubscribeScanResults) {
auto returnObject = wifi_offload_->unsubscribeScanResults();
- ASSERT_EQ(returnObject.isOk(), true);
+ ASSERT_EQ(true, returnObject.isOk());
}
/*
@@ -131,21 +134,18 @@
TEST_F(WifiOffloadHidlTest, configureScans) {
ScanParam* pScanParam = new ScanParam();
ScanFilter* pScanFilter = new ScanFilter();
- auto returnObject =
- wifi_offload_->configureScans(*pScanParam, *pScanFilter);
- ASSERT_EQ(returnObject.isOk(), true);
+ const auto& result =
+ HIDL_INVOKE(wifi_offload_, configureScans, *pScanParam, *pScanFilter);
+ ASSERT_EQ(OffloadStatusCode::OK, result.code);
}
/*
* Verify that getScanStats returns without any errors
*/
TEST_F(WifiOffloadHidlTest, getScanStats) {
- ScanStats* pScanStats = new ScanStats();
- const auto& returnObject =
- wifi_offload_->getScanStats([pScanStats](ScanStats scanStats) -> void {
- *pScanStats = std::move(scanStats);
- });
- ASSERT_EQ(returnObject.isOk(), true);
+ const auto& result = HIDL_INVOKE(wifi_offload_, getScanStats);
+ OffloadStatus status = result.first;
+ ASSERT_EQ(OffloadStatusCode::OK, status.code);
}
/*
@@ -167,7 +167,7 @@
wifi_offload_cb_->onScanResult(scan_results);
auto res =
wifi_offload_cb_->WaitForCallback(kOffloadCallbackSendScanResult);
- ASSERT_EQ(res.no_timeout, true);
+ ASSERT_EQ(true, res.no_timeout);
}
/*
@@ -175,9 +175,10 @@
*/
TEST_F(WifiOffloadHidlTest, getError) {
wifi_offload_->setEventCallback(wifi_offload_cb_);
- wifi_offload_cb_->onError(OffloadStatus::OFFLOAD_STATUS_ERROR);
+ OffloadStatus status = {OffloadStatusCode::ERROR, ""};
+ wifi_offload_cb_->onError(status);
auto res = wifi_offload_cb_->WaitForCallback(kOffloadCallbackSendError);
- ASSERT_EQ(res.no_timeout, true);
+ ASSERT_EQ(true, res.no_timeout);
}
// A class for test environment setup
diff --git a/wifi/offload/1.0/vts/functional/hidl_call_util.h b/wifi/offload/1.0/vts/functional/hidl_call_util.h
new file mode 100644
index 0000000..f3ca517
--- /dev/null
+++ b/wifi/offload/1.0/vts/functional/hidl_call_util.h
@@ -0,0 +1,123 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include <functional>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+
+#include <VtsHalHidlTargetTestBase.h>
+
+namespace {
+namespace detail {
+template <typename>
+struct functionArgSaver;
+
+// Provides a std::function that takes one argument, and a buffer
+// wherein the function will store its argument. The buffer has
+// the same type as the argument, but with const and reference
+// modifiers removed.
+template <typename ArgT>
+struct functionArgSaver<std::function<void(ArgT)>> final {
+ using StorageT = typename std::remove_const<
+ typename std::remove_reference<ArgT>::type>::type;
+
+ std::function<void(ArgT)> saveArgs = [this](ArgT arg) {
+ this->saved_values = arg;
+ };
+
+ StorageT saved_values;
+};
+
+// Provides a std::function that takes two arguments, and a buffer
+// wherein the function will store its arguments. The buffer is a
+// std::pair, whose elements have the same types as the arguments
+// (but with const and reference modifiers removed).
+template <typename Arg1T, typename Arg2T>
+struct functionArgSaver<std::function<void(Arg1T, Arg2T)>> final {
+ using StorageT =
+ std::pair<typename std::remove_const<
+ typename std::remove_reference<Arg1T>::type>::type,
+ typename std::remove_const<
+ typename std::remove_reference<Arg2T>::type>::type>;
+
+ std::function<void(Arg1T, Arg2T)> saveArgs = [this](Arg1T arg1,
+ Arg2T arg2) {
+ this->saved_values = {arg1, arg2};
+ };
+
+ StorageT saved_values;
+};
+
+// Provides a std::function that takes three or more arguments, and a
+// buffer wherein the function will store its arguments. The buffer is a
+// std::tuple whose elements have the same types as the arguments (but
+// with const and reference modifiers removed).
+template <typename... ArgT>
+struct functionArgSaver<std::function<void(ArgT...)>> final {
+ using StorageT = std::tuple<typename std::remove_const<
+ typename std::remove_reference<ArgT>::type>::type...>;
+
+ std::function<void(ArgT...)> saveArgs = [this](ArgT... arg) {
+ this->saved_values = {arg...};
+ };
+
+ StorageT saved_values;
+};
+
+// Invokes |method| on |object|, providing |method| a CallbackT as the
+// final argument. Returns a copy of the parameters that |method| provided
+// to CallbackT. (The parameters are returned by value.)
+template <typename CallbackT, typename MethodT, typename ObjectT,
+ typename... ArgT>
+typename functionArgSaver<CallbackT>::StorageT invokeMethod(
+ MethodT method, ObjectT object, ArgT&&... methodArg) {
+ functionArgSaver<CallbackT> result_buffer;
+ const auto& res = ((*object).*method)(std::forward<ArgT>(methodArg)...,
+ result_buffer.saveArgs);
+ EXPECT_TRUE(res.isOk());
+ return result_buffer.saved_values;
+}
+} // namespace detail
+} // namespace
+
+// Invokes |method| on |strong_pointer|, passing provided arguments through to
+// |method|.
+//
+// Returns either:
+// - A copy of the result callback parameter (for callbacks with a single
+// parameter), OR
+// - A pair containing a copy of the result callback parameters (for callbacks
+// with two parameters), OR
+// - A tuple containing a copy of the result callback paramters (for callbacks
+// with three or more parameters).
+//
+// Example usage:
+// EXPECT_EQ(WifiStatusCode::SUCCESS,
+// HIDL_INVOKE(strong_pointer, methodReturningWifiStatus).code);
+// EXPECT_EQ(WifiStatusCode::SUCCESS,
+// HIDL_INVOKE(strong_pointer, methodReturningWifiStatusAndOneMore)
+// .first.code);
+// EXPECT_EQ(WifiStatusCode::SUCCESS, std::get<0>(
+// HIDL_INVOKE(strong_pointer, methodReturningWifiStatusAndTwoMore))
+// .code);
+#define HIDL_INVOKE(strong_pointer, method, ...) \
+ (detail::invokeMethod< \
+ std::remove_reference<decltype(*strong_pointer)>::type::method##_cb>( \
+ &std::remove_reference<decltype(*strong_pointer)>::type::method, \
+ strong_pointer, ##__VA_ARGS__))