Merge "wifi(tests): Fix runtest.sh"
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 1af439a..edde1cb 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -72,3 +72,11 @@
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.cas@1.0*)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.cas@1.0*)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/vintf/manifest/android.hardware.cas@1.0*)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.configstore@1.2-service.rc)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.configstore@1.2-service)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/seccomp_policy/configstore.policy)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/apex/com.android.media.swcodec/lib64/android.hardware.configstore@1.2.so)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib64/vndk-Q/android.hardware.configstore@1.2.so)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib64/android.hardware.configstore@1.2.so)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/vndk-Q/android.hardware.configstore@1.2.so)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/android.hardware.configstore@1.2.so)
diff --git a/camera/device/3.5/types.hal b/camera/device/3.5/types.hal
index e3c2350..f98c603 100644
--- a/camera/device/3.5/types.hal
+++ b/camera/device/3.5/types.hal
@@ -142,7 +142,9 @@
* To capture a JPEG APP segments blob, a stream is created using the pixel format
* HAL_PIXEL_FORMAT_BLOB and dataspace HAL_DATASPACE_JPEG_APP_SEGMENTS. The buffer
* size for the stream is calculated by the framework, based on the static
- * metadata field android.heic.maxAppSegmentsCount.
+ * metadata field android.heic.maxAppSegmentsCount, and is assigned to both
+ * @3.2::Stream::width and @3.4::Stream::bufferSize. Camera framework sets
+ * @3.2::Stream::height to 1.
*
* Similar to JPEG image, the JPEG APP segment images can be of variable size,
* so the HAL needs to include the final size of all APP segments using this
diff --git a/configstore/1.2/default/Android.mk b/configstore/1.1/default/Android.mk
similarity index 70%
rename from configstore/1.2/default/Android.mk
rename to configstore/1.1/default/Android.mk
index b807357..104e15e 100644
--- a/configstore/1.2/default/Android.mk
+++ b/configstore/1.1/default/Android.mk
@@ -2,15 +2,15 @@
################################################################################
include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.configstore@1.2-service
+LOCAL_MODULE := android.hardware.configstore@1.1-service
# seccomp is not required for coverage build.
ifneq ($(NATIVE_COVERAGE),true)
-LOCAL_REQUIRED_MODULES_arm64 := configstore.policy
+LOCAL_REQUIRED_MODULES_arm64 := configstore@1.1.policy
endif
LOCAL_VENDOR_MODULE := true
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_INIT_RC := android.hardware.configstore@1.2-service.rc
+LOCAL_INIT_RC := android.hardware.configstore@1.1-service.rc
LOCAL_SRC_FILES:= service.cpp
include $(LOCAL_PATH)/surfaceflinger.mk
@@ -23,17 +23,16 @@
liblog \
libutils \
android.hardware.configstore@1.0 \
- android.hardware.configstore@1.1 \
- android.hardware.configstore@1.2
+ android.hardware.configstore@1.1
include $(BUILD_EXECUTABLE)
# seccomp filter for configstore
ifeq ($(TARGET_ARCH), $(filter $(TARGET_ARCH), arm64))
include $(CLEAR_VARS)
-LOCAL_MODULE := configstore.policy
+LOCAL_MODULE := configstore@1.1.policy
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/seccomp_policy
-LOCAL_SRC_FILES := seccomp_policy/configstore-$(TARGET_ARCH).policy
+LOCAL_SRC_FILES := seccomp_policy/configstore@1.1-$(TARGET_ARCH).policy
include $(BUILD_PREBUILT)
endif
diff --git a/configstore/1.1/default/SurfaceFlingerConfigs.cpp b/configstore/1.1/default/SurfaceFlingerConfigs.cpp
new file mode 100644
index 0000000..377e467
--- /dev/null
+++ b/configstore/1.1/default/SurfaceFlingerConfigs.cpp
@@ -0,0 +1,196 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.1 (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.1
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "SurfaceFlingerConfigs.h"
+
+#include <android/hardware/configstore/1.1/types.h>
+#include <log/log.h>
+
+namespace android {
+namespace hardware {
+namespace configstore {
+namespace V1_1 {
+namespace implementation {
+
+// ::android::hardware::configstore::V1_0::ISurfaceFlingerConfigs implementation.
+Return<void> SurfaceFlingerConfigs::vsyncEventPhaseOffsetNs(vsyncEventPhaseOffsetNs_cb _hidl_cb) {
+#ifdef VSYNC_EVENT_PHASE_OFFSET_NS
+ _hidl_cb({true, VSYNC_EVENT_PHASE_OFFSET_NS});
+#else
+ _hidl_cb({false, 0});
+#endif
+ return Void();
+}
+
+Return<void> SurfaceFlingerConfigs::vsyncSfEventPhaseOffsetNs(vsyncEventPhaseOffsetNs_cb _hidl_cb) {
+#ifdef SF_VSYNC_EVENT_PHASE_OFFSET_NS
+ _hidl_cb({true, SF_VSYNC_EVENT_PHASE_OFFSET_NS});
+#else
+ _hidl_cb({false, 0});
+#endif
+ return Void();
+}
+
+Return<void> SurfaceFlingerConfigs::useContextPriority(useContextPriority_cb _hidl_cb) {
+#ifdef USE_CONTEXT_PRIORITY
+ _hidl_cb({true, USE_CONTEXT_PRIORITY});
+#else
+ _hidl_cb({false, false});
+#endif
+ return Void();
+}
+
+Return<void> SurfaceFlingerConfigs::maxFrameBufferAcquiredBuffers(
+ maxFrameBufferAcquiredBuffers_cb _hidl_cb) {
+#ifdef NUM_FRAMEBUFFER_SURFACE_BUFFERS
+ _hidl_cb({true, NUM_FRAMEBUFFER_SURFACE_BUFFERS});
+#else
+ _hidl_cb({false, 0});
+#endif
+ return Void();
+}
+
+Return<void> SurfaceFlingerConfigs::hasWideColorDisplay(hasWideColorDisplay_cb _hidl_cb) {
+ bool value = false;
+#ifdef HAS_WIDE_COLOR_DISPLAY
+ value = true;
+#endif
+ _hidl_cb({true, value});
+ return Void();
+}
+
+Return<void> SurfaceFlingerConfigs::hasSyncFramework(hasSyncFramework_cb _hidl_cb) {
+ bool value = true;
+#ifdef RUNNING_WITHOUT_SYNC_FRAMEWORK
+ value = false;
+#endif
+ _hidl_cb({true, value});
+ return Void();
+}
+
+Return<void> SurfaceFlingerConfigs::hasHDRDisplay(hasHDRDisplay_cb _hidl_cb) {
+ bool value = false;
+#ifdef HAS_HDR_DISPLAY
+ value = true;
+#endif
+ _hidl_cb({true, value});
+ return Void();
+}
+
+Return<void> SurfaceFlingerConfigs::presentTimeOffsetFromVSyncNs(
+ presentTimeOffsetFromVSyncNs_cb _hidl_cb) {
+#ifdef PRESENT_TIME_OFFSET_FROM_VSYNC_NS
+ _hidl_cb({true, PRESENT_TIME_OFFSET_FROM_VSYNC_NS});
+#else
+ _hidl_cb({false, 0});
+#endif
+ return Void();
+}
+
+Return<void> SurfaceFlingerConfigs::useHwcForRGBtoYUV(useHwcForRGBtoYUV_cb _hidl_cb) {
+ bool value = false;
+#ifdef FORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
+ value = true;
+#endif
+ _hidl_cb({true, value});
+ return Void();
+}
+
+Return<void> SurfaceFlingerConfigs::maxVirtualDisplaySize(maxVirtualDisplaySize_cb _hidl_cb) {
+ uint64_t maxSize = 0;
+#ifdef MAX_VIRTUAL_DISPLAY_DIMENSION
+ maxSize = MAX_VIRTUAL_DISPLAY_DIMENSION;
+ _hidl_cb({true, maxSize});
+#else
+ _hidl_cb({false, maxSize});
+#endif
+ return Void();
+}
+
+Return<void> SurfaceFlingerConfigs::useVrFlinger(useVrFlinger_cb _hidl_cb) {
+ bool value = false;
+ bool specified = false;
+#ifdef USE_VR_FLINGER
+ value = true;
+ specified = true;
+#endif
+ _hidl_cb({specified, value});
+ return Void();
+}
+
+Return<void> SurfaceFlingerConfigs::startGraphicsAllocatorService(
+ startGraphicsAllocatorService_cb _hidl_cb) {
+ bool value = false;
+#ifdef START_GRAPHICS_ALLOCATOR_SERVICE
+ value = true;
+#endif
+ _hidl_cb({true, value});
+ return Void();
+}
+
+// ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs implementation.
+
+#ifdef PRIMARY_DISPLAY_ORIENTATION
+static_assert(PRIMARY_DISPLAY_ORIENTATION == 0 || PRIMARY_DISPLAY_ORIENTATION == 90 ||
+ PRIMARY_DISPLAY_ORIENTATION == 180 || PRIMARY_DISPLAY_ORIENTATION == 270,
+ "Primary display orientation must be 0/90/180/270");
+#endif
+
+Return<void> SurfaceFlingerConfigs::primaryDisplayOrientation(
+ primaryDisplayOrientation_cb _hidl_cb) {
+ using ::android::hardware::configstore::V1_1::DisplayOrientation;
+
+ bool specified = false;
+ DisplayOrientation value = DisplayOrientation::ORIENTATION_0;
+
+ int orientation = 0;
+#ifdef PRIMARY_DISPLAY_ORIENTATION
+ specified = true;
+ orientation = PRIMARY_DISPLAY_ORIENTATION;
+#endif
+
+ switch (orientation) {
+ case 0: {
+ value = DisplayOrientation::ORIENTATION_0;
+ break;
+ }
+ case 90: {
+ value = DisplayOrientation::ORIENTATION_90;
+ break;
+ }
+ case 180: {
+ value = DisplayOrientation::ORIENTATION_180;
+ break;
+ }
+ case 270: {
+ value = DisplayOrientation::ORIENTATION_270;
+ break;
+ }
+ default: {
+ // statically checked above -> memory corruption
+ LOG_ALWAYS_FATAL("Invalid orientation %d", orientation);
+ }
+ }
+
+ _hidl_cb({specified, value});
+ return Void();
+}
+
+} // namespace implementation
+} // namespace V1_1
+} // namespace configstore
+} // namespace hardware
+} // namespace android
diff --git a/configstore/1.2/default/SurfaceFlingerConfigs.h b/configstore/1.1/default/SurfaceFlingerConfigs.h
similarity index 76%
rename from configstore/1.2/default/SurfaceFlingerConfigs.h
rename to configstore/1.1/default/SurfaceFlingerConfigs.h
index 54a6e62..c2f5fef 100644
--- a/configstore/1.2/default/SurfaceFlingerConfigs.h
+++ b/configstore/1.1/default/SurfaceFlingerConfigs.h
@@ -14,23 +14,23 @@
* limitations under the License.
*/
-#ifndef ANDROID_HARDWARE_CONFIGSTORE_V1_2_SURFACEFLINGERCONFIGS_H
-#define ANDROID_HARDWARE_CONFIGSTORE_V1_2_SURFACEFLINGERCONFIGS_H
+#ifndef ANDROID_HARDWARE_CONFIGSTORE_V1_1_SURFACEFLINGERCONFIGS_H
+#define ANDROID_HARDWARE_CONFIGSTORE_V1_1_SURFACEFLINGERCONFIGS_H
-#include <android/hardware/configstore/1.2/ISurfaceFlingerConfigs.h>
+#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace configstore {
-namespace V1_2 {
+namespace V1_1 {
namespace implementation {
using ::android::sp;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::configstore::V1_2::ISurfaceFlingerConfigs;
+using ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs;
struct SurfaceFlingerConfigs : public ISurfaceFlingerConfigs {
// ::android::hardware::configstore::V1_0::ISurfaceFlingerConfigs implementation.
@@ -49,17 +49,12 @@
// ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs follow implementation.
Return<void> primaryDisplayOrientation(primaryDisplayOrientation_cb _hidl_cb) override;
-
- // ::android::hardware::configstore::V1_2::ISurfaceFlingerConfigs follow implementation.
- Return<void> useColorManagement(useColorManagement_cb _hidl_cb) override;
- Return<void> getCompositionPreference(getCompositionPreference_cb _hidl_cb) override;
- Return<void> getDisplayNativePrimaries(getDisplayNativePrimaries_cb _hidl_cb) override;
};
} // namespace implementation
-} // namespace V1_2
+} // namespace V1_1
} // namespace configstore
} // namespace hardware
} // namespace android
-#endif // ANDROID_HARDWARE_CONFIGSTORE_V1_2_SURFACEFLINGERCONFIGS_H
+#endif // ANDROID_HARDWARE_CONFIGSTORE_V1_1_SURFACEFLINGERCONFIGS_H
diff --git a/configstore/1.2/default/android.hardware.configstore@1.2-service.rc b/configstore/1.1/default/android.hardware.configstore@1.1-service.rc
similarity index 83%
rename from configstore/1.2/default/android.hardware.configstore@1.2-service.rc
rename to configstore/1.1/default/android.hardware.configstore@1.1-service.rc
index d6c5d10..105678a 100644
--- a/configstore/1.2/default/android.hardware.configstore@1.2-service.rc
+++ b/configstore/1.1/default/android.hardware.configstore@1.1-service.rc
@@ -1,4 +1,4 @@
-service vendor.configstore-hal /vendor/bin/hw/android.hardware.configstore@1.2-service
+service vendor.configstore-hal /vendor/bin/hw/android.hardware.configstore@1.1-service
class hal animation
user system
group system
diff --git a/configstore/1.2/default/seccomp_policy/configstore-arm64.policy b/configstore/1.1/default/seccomp_policy/configstore@1.1-arm64.policy
similarity index 100%
rename from configstore/1.2/default/seccomp_policy/configstore-arm64.policy
rename to configstore/1.1/default/seccomp_policy/configstore@1.1-arm64.policy
diff --git a/configstore/1.2/default/service.cpp b/configstore/1.1/default/service.cpp
similarity index 80%
rename from configstore/1.2/default/service.cpp
rename to configstore/1.1/default/service.cpp
index 65a42f5..e21de0b 100644
--- a/configstore/1.2/default/service.cpp
+++ b/configstore/1.1/default/service.cpp
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-#define LOG_TAG "android.hardware.configstore@1.2-service"
+#define LOG_TAG "android.hardware.configstore@1.1-service"
-#include <android/hardware/configstore/1.2/ISurfaceFlingerConfigs.h>
+#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
#include <hidl/HidlTransportSupport.h>
#include <hwminijail/HardwareMinijail.h>
@@ -28,13 +28,13 @@
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using android::hardware::SetupMinijail;
-using android::hardware::configstore::V1_2::ISurfaceFlingerConfigs;
-using android::hardware::configstore::V1_2::implementation::SurfaceFlingerConfigs;
+using android::hardware::configstore::V1_1::ISurfaceFlingerConfigs;
+using android::hardware::configstore::V1_1::implementation::SurfaceFlingerConfigs;
int main() {
configureRpcThreadpool(10, true);
- SetupMinijail("/vendor/etc/seccomp_policy/configstore.policy");
+ SetupMinijail("/vendor/etc/seccomp_policy/configstore@1.1.policy");
sp<ISurfaceFlingerConfigs> surfaceFlingerConfigs = new SurfaceFlingerConfigs;
status_t status = surfaceFlingerConfigs->registerAsService();
diff --git a/configstore/1.1/default/surfaceflinger.mk b/configstore/1.1/default/surfaceflinger.mk
new file mode 100644
index 0000000..35922eb
--- /dev/null
+++ b/configstore/1.1/default/surfaceflinger.mk
@@ -0,0 +1,56 @@
+
+LOCAL_SRC_FILES += SurfaceFlingerConfigs.cpp
+
+ifneq ($(VSYNC_EVENT_PHASE_OFFSET_NS),)
+ LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=$(VSYNC_EVENT_PHASE_OFFSET_NS)
+endif
+
+ifneq ($(SF_VSYNC_EVENT_PHASE_OFFSET_NS),)
+ LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=$(SF_VSYNC_EVENT_PHASE_OFFSET_NS)
+endif
+
+ifeq ($(TARGET_USE_CONTEXT_PRIORITY),true)
+ LOCAL_CFLAGS += -DUSE_CONTEXT_PRIORITY=1
+endif
+
+ifeq ($(TARGET_HAS_WIDE_COLOR_DISPLAY),true)
+ LOCAL_CFLAGS += -DHAS_WIDE_COLOR_DISPLAY
+endif
+
+ifeq ($(TARGET_HAS_HDR_DISPLAY),true)
+ LOCAL_CFLAGS += -DHAS_HDR_DISPLAY
+endif
+
+ifneq ($(PRESENT_TIME_OFFSET_FROM_VSYNC_NS),)
+ LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=$(PRESENT_TIME_OFFSET_FROM_VSYNC_NS)
+else
+ LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0
+endif
+
+ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true)
+ LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
+endif
+
+ifneq ($(MAX_VIRTUAL_DISPLAY_DIMENSION),)
+ LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=$(MAX_VIRTUAL_DISPLAY_DIMENSION)
+endif
+
+ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
+ LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
+endif
+
+ifneq ($(USE_VR_FLINGER),)
+ LOCAL_CFLAGS += -DUSE_VR_FLINGER
+endif
+
+ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
+ LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
+endif
+
+ifneq ($(SF_START_GRAPHICS_ALLOCATOR_SERVICE),)
+ LOCAL_CFLAGS += -DSTART_GRAPHICS_ALLOCATOR_SERVICE
+endif
+
+ifneq ($(SF_PRIMARY_DISPLAY_ORIENTATION),)
+ LOCAL_CFLAGS += -DPRIMARY_DISPLAY_ORIENTATION=$(SF_PRIMARY_DISPLAY_ORIENTATION)
+endif
diff --git a/configstore/1.2/Android.bp b/configstore/1.2/Android.bp
deleted file mode 100644
index a3976b6..0000000
--- a/configstore/1.2/Android.bp
+++ /dev/null
@@ -1,27 +0,0 @@
-// This file is autogenerated by hidl-gen -Landroidbp.
-
-hidl_interface {
- name: "android.hardware.configstore@1.2",
- root: "android.hardware",
- vndk: {
- enabled: true,
- },
- srcs: [
- "types.hal",
- "ISurfaceFlingerConfigs.hal",
- ],
- interfaces: [
- "android.hardware.configstore@1.0",
- "android.hardware.configstore@1.1",
- "android.hardware.graphics.common@1.0",
- "android.hardware.graphics.common@1.1",
- "android.hardware.graphics.common@1.2",
- "android.hidl.base@1.0",
- ],
- types: [
- "CieXyz",
- "DisplayPrimaries",
- ],
- gen_java: true,
-}
-
diff --git a/configstore/1.2/ISurfaceFlingerConfigs.hal b/configstore/1.2/ISurfaceFlingerConfigs.hal
deleted file mode 100644
index 431b3fc..0000000
--- a/configstore/1.2/ISurfaceFlingerConfigs.hal
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.1 (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.1
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package android.hardware.configstore@1.2;
-
-import android.hardware.graphics.common@1.2::PixelFormat;
-import android.hardware.graphics.common@1.2::Dataspace;
-import @1.1::ISurfaceFlingerConfigs;
-import @1.0::OptionalBool;
-
-/**
- * New revision of ISurfaceFlingerConfigs
- */
-interface ISurfaceFlingerConfigs extends @1.1::ISurfaceFlingerConfigs {
- /**
- * useColorManagement indicates whether SurfaceFlinger should manage color
- * by switching to appropriate color mode automatically depending on the
- * Dataspace of the surfaces on screen.
- * This function must return true when hasWideColorDisplay or hasHDRDisplay
- * return true.
- */
- useColorManagement() generates (OptionalBool value);
-
- /**
- * Returns the default data space and pixel format that SurfaceFlinger
- * expects to receive and output as well as the wide color gamut data space
- * and pixel format for wide color gamut surfaces.
- * To determine the data space and pixel format, there are a few things
- * we recommend to consider:
- *
- * 1. Hardware composer's capability to composite contents with the chosen
- * data space and pixel format efficiently;
- * 2. Hardware composer's ability to composite contents when sRGB contents
- * and the chosen wide color gamut data space contents coexist;
- * 3. For better blending, consider using pixel format where the alpha
- * channel has as many bits as the RGB color channel.
- * 4. Memory consumption and efficient buffer compression when considering
- * more bits in pixel format.
- *
- * @return dataspace is the default data space that SurfaceFlinger expects.
- * The data space must not be Dataspace::UNKNOWN, if unspecified,
- * the default data space is Dataspace::V0_SRGB;
- * @return pixelFormat is the default pixel format that SurfaceFlinger
- * expects. If unspecified, the default pixel format is
- * PixelFormat::RGBA_8888.
- * @return wcgDataspace is the data space that SurfaceFlinger expects for
- * wide color gamut surfaces.
- * When hasWideColorDisplay returns true, this API must return a
- * valid wide color gamut data space.
- * The data space must not be UNKNOWN, if unspecified, the data space
- * is V0_SRGB by default, which essentially indicates there's no wide
- * color gamut, meaning hasWideColorDisplay returns false.
- * @return wcgPixelFormat is the pixel format that SurfaceFlinger expects for
- * wide color gamut surfaces. If unspecified, the pixel format is
- * PixelFormat::RGBA_8888 by default.
- */
- getCompositionPreference()
- generates (Dataspace dataspace, PixelFormat pixelFormat,
- Dataspace wcgDataspace, PixelFormat wcgPixelFormat);
-
- /**
- * Returns the native panel primary data. The data includes red, green,
- * blue and white. The primary format is CIE 1931 XYZ color space. If
- * unspecified, the primaries is sRGB gamut by default.
- */
- getDisplayNativePrimaries() generates (DisplayPrimaries primaries);
-};
diff --git a/configstore/1.2/default/SurfaceFlingerConfigs.cpp b/configstore/1.2/default/SurfaceFlingerConfigs.cpp
deleted file mode 100644
index 714442b..0000000
--- a/configstore/1.2/default/SurfaceFlingerConfigs.cpp
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.1 (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.1
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "SurfaceFlingerConfigs.h"
-
-#include <android/hardware/configstore/1.1/types.h>
-#include <android/hardware/configstore/1.2/types.h>
-#include <android/hardware/graphics/common/1.1/types.h>
-#include <log/log.h>
-
-namespace android {
-namespace hardware {
-namespace configstore {
-namespace V1_2 {
-namespace implementation {
-
-using ::android::hardware::graphics::common::V1_2::Dataspace;
-using ::android::hardware::graphics::common::V1_2::PixelFormat;
-
-// ::android::hardware::configstore::V1_0::ISurfaceFlingerConfigs implementation.
-Return<void> SurfaceFlingerConfigs::vsyncEventPhaseOffsetNs(vsyncEventPhaseOffsetNs_cb _hidl_cb) {
-#ifdef VSYNC_EVENT_PHASE_OFFSET_NS
- _hidl_cb({true, VSYNC_EVENT_PHASE_OFFSET_NS});
-#else
- _hidl_cb({false, 0});
-#endif
- return Void();
-}
-
-Return<void> SurfaceFlingerConfigs::vsyncSfEventPhaseOffsetNs(vsyncEventPhaseOffsetNs_cb _hidl_cb) {
-#ifdef SF_VSYNC_EVENT_PHASE_OFFSET_NS
- _hidl_cb({true, SF_VSYNC_EVENT_PHASE_OFFSET_NS});
-#else
- _hidl_cb({false, 0});
-#endif
- return Void();
-}
-
-Return<void> SurfaceFlingerConfigs::useContextPriority(useContextPriority_cb _hidl_cb) {
-#ifdef USE_CONTEXT_PRIORITY
- _hidl_cb({true, USE_CONTEXT_PRIORITY});
-#else
- _hidl_cb({false, false});
-#endif
- return Void();
-}
-
-Return<void> SurfaceFlingerConfigs::maxFrameBufferAcquiredBuffers(
- maxFrameBufferAcquiredBuffers_cb _hidl_cb) {
-#ifdef NUM_FRAMEBUFFER_SURFACE_BUFFERS
- _hidl_cb({true, NUM_FRAMEBUFFER_SURFACE_BUFFERS});
-#else
- _hidl_cb({false, 0});
-#endif
- return Void();
-}
-
-Return<void> SurfaceFlingerConfigs::hasWideColorDisplay(hasWideColorDisplay_cb _hidl_cb) {
- bool value = false;
-#ifdef HAS_WIDE_COLOR_DISPLAY
- value = true;
-#endif
- _hidl_cb({true, value});
- return Void();
-}
-
-Return<void> SurfaceFlingerConfigs::hasSyncFramework(hasSyncFramework_cb _hidl_cb) {
- bool value = true;
-#ifdef RUNNING_WITHOUT_SYNC_FRAMEWORK
- value = false;
-#endif
- _hidl_cb({true, value});
- return Void();
-}
-
-Return<void> SurfaceFlingerConfigs::hasHDRDisplay(hasHDRDisplay_cb _hidl_cb) {
- bool value = false;
-#ifdef HAS_HDR_DISPLAY
- value = true;
-#endif
- _hidl_cb({true, value});
- return Void();
-}
-
-Return<void> SurfaceFlingerConfigs::presentTimeOffsetFromVSyncNs(
- presentTimeOffsetFromVSyncNs_cb _hidl_cb) {
-#ifdef PRESENT_TIME_OFFSET_FROM_VSYNC_NS
- _hidl_cb({true, PRESENT_TIME_OFFSET_FROM_VSYNC_NS});
-#else
- _hidl_cb({false, 0});
-#endif
- return Void();
-}
-
-Return<void> SurfaceFlingerConfigs::useHwcForRGBtoYUV(useHwcForRGBtoYUV_cb _hidl_cb) {
- bool value = false;
-#ifdef FORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
- value = true;
-#endif
- _hidl_cb({true, value});
- return Void();
-}
-
-Return<void> SurfaceFlingerConfigs::maxVirtualDisplaySize(maxVirtualDisplaySize_cb _hidl_cb) {
- uint64_t maxSize = 0;
-#ifdef MAX_VIRTUAL_DISPLAY_DIMENSION
- maxSize = MAX_VIRTUAL_DISPLAY_DIMENSION;
- _hidl_cb({true, maxSize});
-#else
- _hidl_cb({false, maxSize});
-#endif
- return Void();
-}
-
-Return<void> SurfaceFlingerConfigs::useVrFlinger(useVrFlinger_cb _hidl_cb) {
- bool value = false;
- bool specified = false;
-#ifdef USE_VR_FLINGER
- value = true;
- specified = true;
-#endif
- _hidl_cb({specified, value});
- return Void();
-}
-
-Return<void> SurfaceFlingerConfigs::startGraphicsAllocatorService(
- startGraphicsAllocatorService_cb _hidl_cb) {
- bool value = false;
-#ifdef START_GRAPHICS_ALLOCATOR_SERVICE
- value = true;
-#endif
- _hidl_cb({true, value});
- return Void();
-}
-
-// ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs implementation.
-
-#ifdef PRIMARY_DISPLAY_ORIENTATION
-static_assert(PRIMARY_DISPLAY_ORIENTATION == 0 || PRIMARY_DISPLAY_ORIENTATION == 90 ||
- PRIMARY_DISPLAY_ORIENTATION == 180 || PRIMARY_DISPLAY_ORIENTATION == 270,
- "Primary display orientation must be 0/90/180/270");
-#endif
-
-Return<void> SurfaceFlingerConfigs::primaryDisplayOrientation(
- primaryDisplayOrientation_cb _hidl_cb) {
- using ::android::hardware::configstore::V1_1::DisplayOrientation;
-
- bool specified = false;
- DisplayOrientation value = DisplayOrientation::ORIENTATION_0;
-
- int orientation = 0;
-#ifdef PRIMARY_DISPLAY_ORIENTATION
- specified = true;
- orientation = PRIMARY_DISPLAY_ORIENTATION;
-#endif
-
- switch (orientation) {
- case 0: {
- value = DisplayOrientation::ORIENTATION_0;
- break;
- }
- case 90: {
- value = DisplayOrientation::ORIENTATION_90;
- break;
- }
- case 180: {
- value = DisplayOrientation::ORIENTATION_180;
- break;
- }
- case 270: {
- value = DisplayOrientation::ORIENTATION_270;
- break;
- }
- default: {
- // statically checked above -> memory corruption
- LOG_ALWAYS_FATAL("Invalid orientation %d", orientation);
- }
- }
-
- _hidl_cb({specified, value});
- return Void();
-}
-
-// ::android::hardware::configstore::V1_2::ISurfaceFlingerConfigs implementation.
-Return<void> SurfaceFlingerConfigs::useColorManagement(useColorManagement_cb _hidl_cb) {
-#if defined(USE_COLOR_MANAGEMENT) || defined(HAS_WIDE_COLOR_DISPLAY) || defined(HAS_HDR_DISPLAY)
- _hidl_cb({true, true});
-#else
- _hidl_cb({true, false});
-#endif
- return Void();
-}
-
-#ifdef DEFAULT_COMPOSITION_DATA_SPACE
-static_assert(DEFAULT_COMPOSITION_DATA_SPACE != 0,
- "Default composition data space must not be UNKNOWN");
-#endif
-
-#ifdef WCG_COMPOSITION_DATA_SPACE
-static_assert(WCG_COMPOSITION_DATA_SPACE != 0,
- "Wide color gamut composition data space must not be UNKNOWN");
-#endif
-
-Return<void> SurfaceFlingerConfigs::getCompositionPreference(getCompositionPreference_cb _hidl_cb) {
- Dataspace defaultDataspace = Dataspace::V0_SRGB;
- PixelFormat defaultPixelFormat = PixelFormat::RGBA_8888;
-
-#ifdef DEFAULT_COMPOSITION_DATA_SPACE
- defaultDataspace = static_cast<Dataspace>(DEFAULT_COMPOSITION_DATA_SPACE);
-#endif
-
-#ifdef DEFAULT_COMPOSITION_PIXEL_FORMAT
- defaultPixelFormat = static_cast<PixelFormat>(DEFAULT_COMPOSITION_PIXEL_FORMAT);
-#endif
-
- Dataspace wideColorGamutDataspace = Dataspace::V0_SRGB;
- PixelFormat wideColorGamutPixelFormat = PixelFormat::RGBA_8888;
-
-#ifdef WCG_COMPOSITION_DATA_SPACE
- wideColorGamutDataspace = static_cast<Dataspace>(WCG_COMPOSITION_DATA_SPACE);
-#endif
-
-#ifdef WCG_COMPOSITION_PIXEL_FORMAT
- wideColorGamutPixelFormat = static_cast<PixelFormat>(WCG_COMPOSITION_PIXEL_FORMAT);
-#endif
-
- _hidl_cb(defaultDataspace, defaultPixelFormat, wideColorGamutDataspace,
- wideColorGamutPixelFormat);
- return Void();
-}
-
-Return<void> SurfaceFlingerConfigs::getDisplayNativePrimaries(getDisplayNativePrimaries_cb _hidl_cb) {
- DisplayPrimaries primaries;
- // The default XYZ is sRGB gamut in CIE1931 color space
-#ifdef TARGET_DISPLAY_PRIMARY_RED_X
- primaries.red.X = TARGET_DISPLAY_PRIMARY_RED_X;
-#else
- primaries.red.X = 0.4123;
-#endif
-
-#ifdef TARGET_DISPLAY_PRIMARY_RED_Y
- primaries.red.Y = TARGET_DISPLAY_PRIMARY_RED_Y;
-#else
- primaries.red.Y = 0.2126;
-#endif
-
-#ifdef TARGET_DISPLAY_PRIMARY_RED_Z
- primaries.red.Z = TARGET_DISPLAY_PRIMARY_RED_Z;
-#else
- primaries.red.Z = 0.0193;
-#endif
-
-#ifdef TARGET_DISPLAY_PRIMARY_GREEN_X
- primaries.green.X = TARGET_DISPLAY_PRIMARY_GREEN_X;
-#else
- primaries.green.X = 0.3576;
-#endif
-
-#ifdef TARGET_DISPLAY_PRIMARY_GREEN_Y
- primaries.green.Y = TARGET_DISPLAY_PRIMARY_GREEN_Y;
-#else
- primaries.green.Y = 0.7152;
-#endif
-
-#ifdef TARGET_DISPLAY_PRIMARY_GREEN_Z
- primaries.green.Z = TARGET_DISPLAY_PRIMARY_GREEN_Z;
-#else
- primaries.green.Z = 0.1192;
-#endif
-
-#ifdef TARGET_DISPLAY_PRIMARY_BLUE_X
- primaries.blue.X = TARGET_DISPLAY_PRIMARY_BLUE_X;
-#else
- primaries.blue.X = 0.1805;
-#endif
-
-#ifdef TARGET_DISPLAY_PRIMARY_BLUE_Y
- primaries.blue.Y = TARGET_DISPLAY_PRIMARY_BLUE_Y;
-#else
- primaries.blue.Y = 0.0722;
-#endif
-
-#ifdef TARGET_DISPLAY_PRIMARY_BLUE_Z
- primaries.blue.Z = TARGET_DISPLAY_PRIMARY_BLUE_Z;
-#else
- primaries.blue.Z = 0.9506;
-#endif
-
-#ifdef TARGET_DISPLAY_PRIMARY_WHITE_X
- primaries.white.X = TARGET_DISPLAY_PRIMARY_WHITE_X;
-#else
- primaries.white.X = 0.9505;
-#endif
-
-#ifdef TARGET_DISPLAY_PRIMARY_WHITE_Y
- primaries.white.Y = TARGET_DISPLAY_PRIMARY_WHITE_Y;
-#else
- primaries.white.Y = 1.0000;
-#endif
-
-#ifdef TARGET_DISPLAY_PRIMARY_WHITE_Z
- primaries.white.Z = TARGET_DISPLAY_PRIMARY_WHITE_Z;
-#else
- primaries.white.Z = 1.0891;
-#endif
-
- _hidl_cb(primaries);
- return Void();
-}
-
-} // namespace implementation
-} // namespace V1_2
-} // namespace configstore
-} // namespace hardware
-} // namespace android
diff --git a/configstore/1.2/default/surfaceflinger.mk b/configstore/1.2/default/surfaceflinger.mk
deleted file mode 100644
index 9a67256..0000000
--- a/configstore/1.2/default/surfaceflinger.mk
+++ /dev/null
@@ -1,124 +0,0 @@
-
-LOCAL_SRC_FILES += SurfaceFlingerConfigs.cpp
-
-ifneq ($(VSYNC_EVENT_PHASE_OFFSET_NS),)
- LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=$(VSYNC_EVENT_PHASE_OFFSET_NS)
-endif
-
-ifneq ($(SF_VSYNC_EVENT_PHASE_OFFSET_NS),)
- LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=$(SF_VSYNC_EVENT_PHASE_OFFSET_NS)
-endif
-
-ifeq ($(TARGET_USE_CONTEXT_PRIORITY),true)
- LOCAL_CFLAGS += -DUSE_CONTEXT_PRIORITY=1
-endif
-
-ifeq ($(TARGET_HAS_WIDE_COLOR_DISPLAY),true)
- LOCAL_CFLAGS += -DHAS_WIDE_COLOR_DISPLAY
-endif
-
-ifeq ($(TARGET_HAS_HDR_DISPLAY),true)
- LOCAL_CFLAGS += -DHAS_HDR_DISPLAY
-endif
-
-ifneq ($(PRESENT_TIME_OFFSET_FROM_VSYNC_NS),)
- LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=$(PRESENT_TIME_OFFSET_FROM_VSYNC_NS)
-else
- LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0
-endif
-
-ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true)
- LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
-endif
-
-ifneq ($(MAX_VIRTUAL_DISPLAY_DIMENSION),)
- LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=$(MAX_VIRTUAL_DISPLAY_DIMENSION)
-endif
-
-ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
- LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
-endif
-
-ifneq ($(USE_VR_FLINGER),)
- LOCAL_CFLAGS += -DUSE_VR_FLINGER
-endif
-
-ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
- LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
-endif
-
-ifneq ($(SF_START_GRAPHICS_ALLOCATOR_SERVICE),)
- LOCAL_CFLAGS += -DSTART_GRAPHICS_ALLOCATOR_SERVICE
-endif
-
-ifneq ($(SF_PRIMARY_DISPLAY_ORIENTATION),)
- LOCAL_CFLAGS += -DPRIMARY_DISPLAY_ORIENTATION=$(SF_PRIMARY_DISPLAY_ORIENTATION)
-endif
-
-ifeq ($(TARGET_USE_COLOR_MANAGEMENT),true)
- LOCAL_CFLAGS += -DUSE_COLOR_MANAGEMENT
-endif
-
-ifneq ($(SF_DEFAULT_COMPOSITION_DATA_SPACE),)
- LOCAL_CFLAGS += -DDEFAULT_COMPOSITION_DATA_SPACE=$(SF_DEFAULT_COMPOSITION_DATA_SPACE)
-endif
-
-ifneq ($(SF_DEFAULT_COMPOSITION_PIXEL_FORMAT),)
- LOCAL_CFLAGS += -DDEFAULT_COMPOSITION_PIXEL_FORMAT=$(SF_DEFAULT_COMPOSITION_PIXEL_FORMAT)
-endif
-
-ifneq ($(SF_WCG_COMPOSITION_DATA_SPACE),)
- LOCAL_CFLAGS += -DWCG_COMPOSITION_DATA_SPACE=$(SF_WCG_COMPOSITION_DATA_SPACE)
-endif
-
-ifneq ($(SF_WCG_COMPOSITION_PIXEL_FORMAT),)
- LOCAL_CFLAGS += -DWCG_COMPOSITION_PIXEL_FORMAT=$(SF_WCG_COMPOSITION_PIXEL_FORMAT)
-endif
-
-ifneq ($(TARGET_DISPLAY_PRIMARY_RED_X),)
- LOCAL_CFLAGS += -DTARGET_DISPLAY_PRIMARY_RED_X=$(TARGET_DISPLAY_PRIMARY_RED_X)
-endif
-
-ifneq ($(TARGET_DISPLAY_PRIMARY_RED_Y),)
- LOCAL_CFLAGS += -DTARGET_DISPLAY_PRIMARY_RED_Y=$(TARGET_DISPLAY_PRIMARY_RED_Y)
-endif
-
-ifneq ($(TARGET_DISPLAY_PRIMARY_RED_Z),)
- LOCAL_CFLAGS += -DTARGET_DISPLAY_PRIMARY_RED_Z=$(TARGET_DISPLAY_PRIMARY_RED_Z)
-endif
-
-ifneq ($(TARGET_DISPLAY_PRIMARY_GREEN_X),)
- LOCAL_CFLAGS += -DTARGET_DISPLAY_PRIMARY_GREEN_X=$(TARGET_DISPLAY_PRIMARY_GREEN_X)
-endif
-
-ifneq ($(TARGET_DISPLAY_PRIMARY_GREEN_Y),)
- LOCAL_CFLAGS += -DTARGET_DISPLAY_PRIMARY_GREEN_Y=$(TARGET_DISPLAY_PRIMARY_GREEN_Y)
-endif
-
-ifneq ($(TARGET_DISPLAY_PRIMARY_GREEN_Z),)
- LOCAL_CFLAGS += -DTARGET_DISPLAY_PRIMARY_GREEN_Z=$(TARGET_DISPLAY_PRIMARY_GREEN_Z)
-endif
-
-ifneq ($(TARGET_DISPLAY_PRIMARY_BLUE_X),)
- LOCAL_CFLAGS += -DTARGET_DISPLAY_PRIMARY_BLUE_X=$(TARGET_DISPLAY_PRIMARY_BLUE_X)
-endif
-
-ifneq ($(TARGET_DISPLAY_PRIMARY_BLUE_Y),)
- LOCAL_CFLAGS += -DTARGET_DISPLAY_PRIMARY_BLUE_Y=$(TARGET_DISPLAY_PRIMARY_BLUE_Y)
-endif
-
-ifneq ($(TARGET_DISPLAY_PRIMARY_BLUE_Z),)
- LOCAL_CFLAGS += -DTARGET_DISPLAY_PRIMARY_BLUE_Z=$(TARGET_DISPLAY_PRIMARY_BLUE_Z)
-endif
-
-ifneq ($(TARGET_DISPLAY_PRIMARY_WHITE_X),)
- LOCAL_CFLAGS += -DTARGET_DISPLAY_PRIMARY_WHITE_X=$(TARGET_DISPLAY_PRIMARY_WHITE_X)
-endif
-
-ifneq ($(TARGET_DISPLAY_PRIMARY_WHITE_Y),)
- LOCAL_CFLAGS += -DTARGET_DISPLAY_PRIMARY_WHITE_Y=$(TARGET_DISPLAY_PRIMARY_WHITE_Y)
-endif
-
-ifneq ($(TARGET_DISPLAY_PRIMARY_WHITE_Z),)
- LOCAL_CFLAGS += -DTARGET_DISPLAY_PRIMARY_WHITE_Z=$(TARGET_DISPLAY_PRIMARY_WHITE_Z)
-endif
diff --git a/configstore/1.2/types.hal b/configstore/1.2/types.hal
deleted file mode 100644
index 5b2c9a6..0000000
--- a/configstore/1.2/types.hal
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package android.hardware.configstore@1.2;
-
-struct CieXyz {
- float X;
- float Y;
- float Z;
-};
-struct DisplayPrimaries {
- CieXyz red;
- CieXyz green;
- CieXyz blue;
- CieXyz white;
-};
diff --git a/configstore/1.2/vts/functional/Android.bp b/configstore/1.2/vts/functional/Android.bp
deleted file mode 100644
index 5f1eca6..0000000
--- a/configstore/1.2/vts/functional/Android.bp
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// Copyright (C) 2018 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-cc_test {
- name: "VtsHalConfigstoreV1_2TargetTest",
- defaults: ["VtsHalTargetTestDefaults"],
- srcs: ["VtsHalConfigstoreV1_2TargetTest.cpp"],
- static_libs: [
- "android.hardware.configstore@1.0",
- "android.hardware.configstore@1.1",
- "android.hardware.configstore@1.2",
- ],
-}
-
diff --git a/configstore/1.2/vts/functional/OWNERS b/configstore/1.2/vts/functional/OWNERS
deleted file mode 100644
index 2b4fb8c..0000000
--- a/configstore/1.2/vts/functional/OWNERS
+++ /dev/null
@@ -1,7 +0,0 @@
-# Graphics team
-lpy@google.com
-olv@google.com
-stoza@google.com
-
-# VTS team
-yim@google.com
diff --git a/configstore/1.2/vts/functional/VtsHalConfigstoreV1_2TargetTest.cpp b/configstore/1.2/vts/functional/VtsHalConfigstoreV1_2TargetTest.cpp
deleted file mode 100644
index d7f4dcf..0000000
--- a/configstore/1.2/vts/functional/VtsHalConfigstoreV1_2TargetTest.cpp
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "ConfigstoreHidlHalTest"
-
-#include <VtsHalHidlTargetTestBase.h>
-#include <VtsHalHidlTargetTestEnvBase.h>
-#include <android-base/logging.h>
-#include <android/hardware/configstore/1.0/types.h>
-#include <android/hardware/configstore/1.2/ISurfaceFlingerConfigs.h>
-#include <android/hardware/configstore/1.2/types.h>
-#include <unistd.h>
-
-using ::android::sp;
-using ::android::hardware::hidl_vec;
-using ::android::hardware::Return;
-using ::android::hardware::Void;
-using ::android::hardware::configstore::V1_0::OptionalBool;
-using ::android::hardware::configstore::V1_0::OptionalInt64;
-using ::android::hardware::configstore::V1_0::OptionalUInt64;
-using ::android::hardware::configstore::V1_2::DisplayPrimaries;
-using ::android::hardware::configstore::V1_2::ISurfaceFlingerConfigs;
-using ::android::hardware::graphics::common::V1_2::Dataspace;
-using ::android::hardware::graphics::common::V1_2::PixelFormat;
-
-#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
-#define EXPECT_OK(ret) EXPECT_TRUE(ret.isOk())
-
-// Test environment for Configstore HIDL HAL.
-class ConfigstoreHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
- public:
- // get the test environment singleton
- static ConfigstoreHidlEnvironment* Instance() {
- static ConfigstoreHidlEnvironment* instance = new ConfigstoreHidlEnvironment;
- return instance;
- }
-
- virtual void registerTestServices() override { registerTestService<ISurfaceFlingerConfigs>(); }
-};
-
-class ConfigstoreHidlTest : public ::testing::VtsHalHidlTargetTestBase {
- public:
- sp<ISurfaceFlingerConfigs> sfConfigs;
-
- virtual void SetUp() override {
- sfConfigs = ::testing::VtsHalHidlTargetTestBase::getService<ISurfaceFlingerConfigs>(
- ConfigstoreHidlEnvironment::Instance()->getServiceName<ISurfaceFlingerConfigs>());
- ASSERT_NE(sfConfigs, nullptr);
- }
-
- virtual void TearDown() override {}
-
- bool isSupportedWideColorGamut(Dataspace dataspace) {
- Dataspace standard = static_cast<Dataspace>(dataspace & Dataspace::STANDARD_MASK);
- return standard == Dataspace::STANDARD_DCI_P3 || standard == Dataspace::STANDARD_BT2020;
- }
-};
-
-/**
- * Make sure the constrains of hasWideColorDisplay, hasHDRDisplay
- * and useColorManagement are enforced.
- */
-TEST_F(ConfigstoreHidlTest, TestColorConstrainsWithColorManagement) {
- bool hasWideColorDisplay;
- bool hasHDRDisplay;
- bool useColorManagement;
-
- Return<void> status = sfConfigs->hasWideColorDisplay(
- [&](OptionalBool arg) { hasWideColorDisplay = arg.specified; });
- EXPECT_OK(status);
-
- status = sfConfigs->hasHDRDisplay([&](OptionalBool arg) { hasHDRDisplay = arg.specified; });
- EXPECT_OK(status);
-
- status = sfConfigs->useColorManagement(
- [&](OptionalBool arg) { useColorManagement = arg.specified; });
- EXPECT_OK(status);
-
- // When hasHDRDisplay returns true, hasWideColorDisplay must also return true.
- if (hasHDRDisplay) {
- ASSERT_TRUE(hasWideColorDisplay);
- }
-
- // When hasWideColorDisplay returns true, useColorManagement
- // must also return true.
- if (hasWideColorDisplay) {
- ASSERT_TRUE(useColorManagement);
- }
-}
-
-TEST_F(ConfigstoreHidlTest, TestGetCompositionPreference) {
- bool hasWideColorDisplay;
-
- Return<void> status = sfConfigs->hasWideColorDisplay(
- [&](OptionalBool arg) { hasWideColorDisplay = arg.specified; });
- EXPECT_OK(status);
-
- Dataspace defaultDataspace, wcgDataspace;
-
- status = sfConfigs->getCompositionPreference(
- [&](auto tmpDefaultDataspace, PixelFormat, auto tmpWcgDataspace, PixelFormat) {
- defaultDataspace = tmpDefaultDataspace;
- wcgDataspace = tmpWcgDataspace;
- });
- EXPECT_OK(status);
-
- // Default data space and wide color gamut data space must not be UNKNOWN.
- ASSERT_TRUE(defaultDataspace != Dataspace::UNKNOWN && wcgDataspace != Dataspace::UNKNOWN);
-
- // If hasWideColorDisplay returns true, the wide color gamut data space must be a valid wide
- // color gamut.
- if (hasWideColorDisplay) {
- ASSERT_TRUE(isSupportedWideColorGamut(wcgDataspace));
- }
-}
-
-TEST_F(ConfigstoreHidlTest, TestGetDisplayNativePrimaries) {
- DisplayPrimaries primaries;
-
- Return<void> status = sfConfigs->getDisplayNativePrimaries(
- [&](DisplayPrimaries tmpPrimaries) {
- primaries.red = tmpPrimaries.red;
- primaries.green = tmpPrimaries.green;
- primaries.blue = tmpPrimaries.blue;
- primaries.white = tmpPrimaries.white;
- });
- EXPECT_OK(status);
-
- // Display primaries should be greater than or equal to zero.
- // Or it returns defualt value if there is no definition.
- // RED
- EXPECT_GE(primaries.red.X, 0.0);
- EXPECT_GE(primaries.red.Y, 0.0);
- EXPECT_GE(primaries.red.Z, 0.0);
-
- // GREEN
- EXPECT_GE(primaries.green.X, 0.0);
- EXPECT_GE(primaries.green.Y, 0.0);
- EXPECT_GE(primaries.green.Z, 0.0);
-
-
- // BLUE
- EXPECT_GE(primaries.blue.X, 0.0);
- EXPECT_GE(primaries.blue.Y, 0.0);
- EXPECT_GE(primaries.blue.Z, 0.0);
-
-
- // WHITE
- EXPECT_GE(primaries.white.X, 0.0);
- EXPECT_GE(primaries.white.Y, 0.0);
- EXPECT_GE(primaries.white.Z, 0.0);
-}
-
-int main(int argc, char** argv) {
- ::testing::AddGlobalTestEnvironment(ConfigstoreHidlEnvironment::Instance());
- ::testing::InitGoogleTest(&argc, argv);
- ConfigstoreHidlEnvironment::Instance()->init(&argc, argv);
- int status = RUN_ALL_TESTS();
- LOG(INFO) << "Test result = " << status;
- return status;
-}
diff --git a/configstore/utils/Android.bp b/configstore/utils/Android.bp
index e0d4aa8..178f245 100644
--- a/configstore/utils/Android.bp
+++ b/configstore/utils/Android.bp
@@ -30,14 +30,12 @@
shared_libs: [
"android.hardware.configstore@1.0",
"android.hardware.configstore@1.1",
- "android.hardware.configstore@1.2",
"libbase",
"libhidlbase"
],
export_shared_lib_headers: [
"android.hardware.configstore@1.0",
"android.hardware.configstore@1.1",
- "android.hardware.configstore@1.2",
"libbase",
"libhidlbase"
],
diff --git a/current.txt b/current.txt
index 94b40c2..caadefe 100644
--- a/current.txt
+++ b/current.txt
@@ -394,6 +394,7 @@
da33234403ff5d60f3473711917b9948e6484a4260b5247acdafb111193a9de2 android.hardware.configstore@1.0::ISurfaceFlingerConfigs
21165b8e30c4b2d52980e4728f661420adc16e38bbe73476c06b2085be908f4c android.hardware.gnss@1.0::IGnssCallback
d702fb01dc2a0733aa820b7eb65435ee3334f75632ef880bafd2fb8803a20a58 android.hardware.gnss@1.0::IGnssMeasurementCallback
+d4fea995378bb4f421b4e24ccf68cad2734ab07fe4f874a126ba558b99df5766 android.hardware.graphics.composer@2.1::IComposerClient
b7ecf29927055ec422ec44bf776223f07d79ad9f92ccf9becf167e62c2607e7a android.hardware.keymaster@4.0::IKeymasterDevice
574e8f1499436fb4075894dcae0b36682427956ecb114f17f1fe22d116a83c6b android.hardware.neuralnetworks@1.0::IPreparedModel
417ab60fe1ef786778047e4486f3d868ebce570d91addd8fe4251515213072de android.hardware.neuralnetworks@1.0::types
@@ -444,15 +445,13 @@
09ab9b24994429d9bb32a3fb420b6f6be3e47eb655139a2c08c4e80d3f33ff95 android.hardware.camera.device@3.5::ICameraDevice
06237de53c42890029e3f8fe7d1480d078469c0d07608e51c37b4d485d342992 android.hardware.camera.device@3.5::ICameraDeviceCallback
08c68b196e2fc4e5ba67ba0d0917bde828a87cbe2cffec19d04733972da9eb49 android.hardware.camera.device@3.5::ICameraDeviceSession
-acaba39216973e58949f50978762bcda1c29f5f7e0bca3e08db21f0767356130 android.hardware.camera.device@3.5::types
+a848f7cb3cb3d080cf175bf08412322bfddb535168253796cdf777afdbf05b38 android.hardware.camera.device@3.5::types
74ec7732fdacb22292c907b49f8f933510851ea1b3ed195c4dcdff35a20387f5 android.hardware.camera.metadata@3.4::types
0fb39a7809ad1c52b3efbbed5ef4749b06c2a4f1f19cdc3efa2e3d9b28f1205c android.hardware.camera.provider@2.5::ICameraProvider
f5777403d65135a5407723671bc7a864cdca83aea13ee3ce2894b95e6588ca3a android.hardware.camera.provider@2.5::types
44c88954b3c201b26f64fcdb6f278024ab3aae864a9e1ec70e8a74274ae9d6aa android.hardware.cas@1.1::ICas
25012d1778f7396f967bbc0231397d544bde421ba5b98706c9e48ac790612683 android.hardware.cas@1.1::ICasListener
dffacdbe0bcf8443013de5bdc56a83479ad979d4919ed15a5585539f46091f07 android.hardware.cas@1.1::IMediaCasService
-bc742c6b17c834010f90c06ce2939c845198eecd2706be18da99e14bceb2acc0 android.hardware.configstore@1.2::ISurfaceFlingerConfigs
-aadac6b9fcf660384d73cbb97f3732ff9eeb8e8c67001e3fdbf4add108e5b1dc android.hardware.configstore@1.2::types
5b1f4a4fb88c239e07d76026467a1f2ee0d08f4d52c1805bd93bd7c05e3fe69c android.hardware.drm@1.2::ICryptoFactory
4895f98e9ef210e9acb01982f5d07b654538377e1404b8db5e19e7858835e9d8 android.hardware.drm@1.2::ICryptoPlugin
976116b9033b2c222b940109fdf0ffcc29b77cbe631ef6b4fcc2ad5ce8e605f7 android.hardware.drm@1.2::IDrmFactory
@@ -465,7 +464,7 @@
2e5ad983734069e84a760004b32da0d09e4170c05380abe27e6eb80e4aa70d5a android.hardware.gnss@2.0::IAGnssCallback
1f4ac068a88a72360280d94a7f6fd7c63813c1eea4891a0eb01394d3e7e775f2 android.hardware.gnss@2.0::IAGnssRil
6e2f9a44375a0ae0b49ca7d711cb88945189d398535078408269e1e85889061d android.hardware.gnss@2.0::IGnss
-54d253b10c7da2a4a708d11acda3118b283df1540bc10323a5a3773c94cc8e71 android.hardware.gnss@2.0::IGnssCallback
+d815623a6d1ba4abf21248b84eca70a2bfab03058a88b68a29c063ce8aee6b5c android.hardware.gnss@2.0::IGnssCallback
ecc966c68bddbd95c8dae782b84204cf01c75734675e8769963f3b5106ec128b android.hardware.gnss@2.0::IGnssConfiguration
c67759f5d6387d273b66729180d03690e827f0b6b8d4e13ce2ff42d31b224065 android.hardware.gnss@2.0::IGnssMeasurement
089338944c45f66f25ba4ee958c161c42fefeb73ec60e4451f3535a1b3fd10c7 android.hardware.gnss@2.0::IGnssMeasurementCallback
diff --git a/gnss/2.0/IGnssCallback.hal b/gnss/2.0/IGnssCallback.hal
index e2ac02a..7924b64 100644
--- a/gnss/2.0/IGnssCallback.hal
+++ b/gnss/2.0/IGnssCallback.hal
@@ -52,4 +52,27 @@
*/
gnssLocationCb_2_0(GnssLocation location);
+ /**
+ * Callback for requesting Location.
+ *
+ * HAL implementation must call this when it wants the framework to provide locations to assist
+ * with GNSS HAL operation, for example, to assist with time to first fix, error recovery, or to
+ * supplement GNSS location for other clients of the GNSS HAL.
+ *
+ * If a request is made with independentFromGnss set to true, the framework must avoid
+ * providing locations derived from GNSS locations (such as "fused" location), to help improve
+ * information independence for situations such as error recovery.
+ *
+ * In response to this method call, GNSS HAL can expect zero, one, or more calls to
+ * IGnss::injectLocation or IGnss::injectBestLocation, dependent on availability of location
+ * from other sources, which may happen at some arbitrary delay. Generally speaking, HAL
+ * implementations must be able to handle calls to IGnss::injectLocation or
+ * IGnss::injectBestLocation at any time.
+ *
+ * @param independentFromGnss True if requesting a location that is independent from GNSS.
+ * @param isUserEmergency True if the location request is for delivery of this location to an
+ * emergency services endpoint, during a user-initiated emergency session (e.g.
+ * during-call to E911, or up to 5 minutes after end-of-call or text to E911).
+ */
+ gnssRequestLocationCb_2_0(bool independentFromGnss, bool isUserEmergency);
};
\ No newline at end of file
diff --git a/gnss/2.0/default/Gnss.cpp b/gnss/2.0/default/Gnss.cpp
index 599681b..33edbd5 100644
--- a/gnss/2.0/default/Gnss.cpp
+++ b/gnss/2.0/default/Gnss.cpp
@@ -122,8 +122,7 @@
Return<bool> Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode,
V1_0::IGnss::GnssPositionRecurrence, uint32_t, uint32_t,
uint32_t) {
- // TODO(b/124012850): Implement function.
- return bool{};
+ return true;
}
Return<sp<V1_0::IAGnssRil>> Gnss::getExtensionAGnssRil() {
@@ -267,7 +266,7 @@
sGnssCallback_2_0 = callback;
- uint32_t capabilities = 0x0;
+ uint32_t capabilities = static_cast<uint32_t>(V1_0::IGnssCallback::Capabilities::MEASUREMENTS);
auto ret = sGnssCallback_2_0->gnssSetCapabilitesCb(capabilities);
if (!ret.isOk()) {
ALOGE("%s: Unable to invoke callback", __func__);
diff --git a/gnss/2.0/vts/functional/gnss_hal_test.h b/gnss/2.0/vts/functional/gnss_hal_test.h
index 7793eb7..31750a6 100644
--- a/gnss/2.0/vts/functional/gnss_hal_test.h
+++ b/gnss/2.0/vts/functional/gnss_hal_test.h
@@ -99,12 +99,18 @@
// Actual (test) callback handlers
Return<void> gnssNameCb(const android::hardware::hidl_string& name) override;
Return<void> gnssLocationCb(const GnssLocation_1_0& location) override;
- Return<void> gnssLocationCb_2_0(const GnssLocation_2_0& location) override;
Return<void> gnssSetCapabilitesCb(uint32_t capabilities) override;
- Return<void> gnssSetCapabilitiesCb_2_0(uint32_t capabilities) override;
Return<void> gnssSetSystemInfoCb(const IGnssCallback::GnssSystemInfo& info) override;
Return<void> gnssSvStatusCb(const IGnssCallback::GnssSvStatus& svStatus) override;
+ // New in v2.0
+ Return<void> gnssLocationCb_2_0(const GnssLocation_2_0& location) override;
+ Return<void> gnssRequestLocationCb_2_0(bool /* independentFromGnss */,
+ bool /* isUserEmergency */) override {
+ return Void();
+ }
+ Return<void> gnssSetCapabilitiesCb_2_0(uint32_t capabilities) override;
+
private:
Return<void> gnssLocationCbImpl(const GnssLocation_2_0& location);
};
diff --git a/graphics/composer/2.1/IComposerClient.hal b/graphics/composer/2.1/IComposerClient.hal
index 5ad46f0..e036ce9 100644
--- a/graphics/composer/2.1/IComposerClient.hal
+++ b/graphics/composer/2.1/IComposerClient.hal
@@ -992,10 +992,10 @@
*
* setLayerDataspace(Dataspace dataspace);
*
- * Sets the dataspace that the current buffer on this layer is in.
+ * Sets the dataspace of the layer.
*
- * The dataspace provides more information about how to interpret the
- * buffer contents, such as the encoding standard and color transform.
+ * The dataspace provides more information about how to interpret the buffer
+ * or solid color, such as the encoding standard and color transform.
*
* See the values of Dataspace for more information.
*
diff --git a/radio/1.3/vts/functional/radio_hidl_hal_api.cpp b/radio/1.3/vts/functional/radio_hidl_hal_api.cpp
index 6208c67..1bebae7 100644
--- a/radio/1.3/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.3/vts/functional/radio_hidl_hal_api.cpp
@@ -75,3 +75,36 @@
radioRsp_v1_3->rspInfo.error,
{RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
}
+
+/*
+ * Test IRadio.setSystemSelectionChannels() for the response returned.
+ */
+TEST_F(RadioHidlTest_v1_3, setSystemSelectionChannels) {
+ serial = GetRandomSerialNumber();
+
+ RadioAccessSpecifier specifier = {.radioAccessNetwork = RadioAccessNetworks::GERAN,
+ .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
+ .channels = {1, 2}};
+
+ Return<void> res = radio_v1_3->setSystemSelectionChannels(serial, true, {specifier});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_3->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_v1_3->rspInfo.serial);
+ ALOGI("setSystemSelectionChannels, rspInfo.error = %s\n",
+ toString(radioRsp_v1_3->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_v1_3->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR}));
+
+ if (radioRsp_v1_3->rspInfo.error == RadioError::NONE) {
+ Return<void> res = radio_v1_3->setSystemSelectionChannels(serial, false, {specifier});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_3->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_v1_3->rspInfo.serial);
+ ALOGI("setSystemSelectionChannels, rspInfo.error = %s\n",
+ toString(radioRsp_v1_3->rspInfo.error).c_str());
+ EXPECT_EQ(RadioError::NONE, radioRsp_v1_3->rspInfo.error);
+ }
+}
\ No newline at end of file
diff --git a/radio/1.3/vts/functional/radio_response.cpp b/radio/1.3/vts/functional/radio_response.cpp
index 900794e..84a9890 100644
--- a/radio/1.3/vts/functional/radio_response.cpp
+++ b/radio/1.3/vts/functional/radio_response.cpp
@@ -769,12 +769,14 @@
/* 1.3 Api */
Return<void> RadioResponse_v1_3::setSystemSelectionChannelsResponse(const RadioResponseInfo& info) {
rspInfo = info;
+ parent_v1_3.notify(info.serial);
return Void();
}
Return<void> RadioResponse_v1_3::enableModemResponse(const RadioResponseInfo& info) {
rspInfo = info;
enableModemResponseToggle = !enableModemResponseToggle;
+ parent_v1_3.notify(info.serial);
return Void();
}
@@ -782,5 +784,6 @@
const bool enabled) {
rspInfo = info;
isModemEnabled = enabled;
+ parent_v1_3.notify(info.serial);
return Void();
}
diff --git a/radio/config/1.1/vts/functional/radio_config_hidl_hal_api.cpp b/radio/config/1.1/vts/functional/radio_config_hidl_hal_api.cpp
index a1639d8..122ce58 100644
--- a/radio/config/1.1/vts/functional/radio_config_hidl_hal_api.cpp
+++ b/radio/config/1.1/vts/functional/radio_config_hidl_hal_api.cpp
@@ -69,3 +69,89 @@
ASSERT_TRUE(CheckAnyOfErrors(radioConfigRsp->rspInfo.error,
{RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
}
+
+/*
+ * Test IRadioConfig.getPhoneCapability()
+ */
+TEST_F(RadioConfigHidlTest, getPhoneCapability) {
+ serial = GetRandomSerialNumber();
+ Return<void> res = radioConfig->getPhoneCapability(serial);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioConfigRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioConfigRsp->rspInfo.serial);
+ ALOGI("getPhoneCapability, rspInfo.error = %s\n",
+ toString(radioConfigRsp->rspInfo.error).c_str());
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioConfigRsp->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR}));
+
+ if (radioConfigRsp->rspInfo.error == RadioError ::NONE) {
+ // maxActiveData should be greater than or equal to maxActiveInternetData.
+ EXPECT_GE(radioConfigRsp->phoneCap.maxActiveData,
+ radioConfigRsp->phoneCap.maxActiveInternetData);
+ // maxActiveData and maxActiveInternetData should be 0 or positive numbers.
+ EXPECT_GE(radioConfigRsp->phoneCap.maxActiveInternetData, 0);
+ }
+}
+
+/*
+ * Test IRadioConfig.getPhoneCapability()
+ */
+TEST_F(RadioConfigHidlTest, setPreferredDataModem) {
+ serial = GetRandomSerialNumber();
+ Return<void> res = radioConfig->getPhoneCapability(serial);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioConfigRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioConfigRsp->rspInfo.serial);
+ ALOGI("getPhoneCapability, rspInfo.error = %s\n",
+ toString(radioConfigRsp->rspInfo.error).c_str());
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioConfigRsp->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR}));
+
+ if (radioConfigRsp->rspInfo.error != RadioError ::NONE) {
+ return;
+ }
+
+ if (radioConfigRsp->phoneCap.logicalModemList.size() == 0) {
+ return;
+ }
+
+ // We get phoneCapability. send setPreferredDataModem command
+ serial = GetRandomSerialNumber();
+ uint8_t modemId = radioConfigRsp->phoneCap.logicalModemList[0].modemId;
+ res = radioConfig->setPreferredDataModem(serial, modemId);
+
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioConfigRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioConfigRsp->rspInfo.serial);
+ ALOGI("getModemsConfig, rspInfo.error = %s\n", toString(radioConfigRsp->rspInfo.error).c_str());
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioConfigRsp->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR}));
+}
+
+/*
+ * Test IRadioConfig.getPhoneCapability()
+ */
+TEST_F(RadioConfigHidlTest, setPreferredDataModem_invalidArgument) {
+ serial = GetRandomSerialNumber();
+ uint8_t modemId = -1;
+ Return<void> res = radioConfig->setPreferredDataModem(serial, modemId);
+
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioConfigRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioConfigRsp->rspInfo.serial);
+ ALOGI("getModemsConfig, rspInfo.error = %s\n", toString(radioConfigRsp->rspInfo.error).c_str());
+
+ ASSERT_TRUE(CheckAnyOfErrors(radioConfigRsp->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::INTERNAL_ERR}));
+}
diff --git a/radio/config/1.1/vts/functional/radio_config_hidl_hal_utils.h b/radio/config/1.1/vts/functional/radio_config_hidl_hal_utils.h
index 1747ce8..c980901 100644
--- a/radio/config/1.1/vts/functional/radio_config_hidl_hal_utils.h
+++ b/radio/config/1.1/vts/functional/radio_config_hidl_hal_utils.h
@@ -51,6 +51,7 @@
public:
RadioResponseInfo rspInfo;
+ PhoneCapability phoneCap;
RadioConfigResponse(RadioConfigHidlTest& parent);
virtual ~RadioConfigResponse() = default;
diff --git a/radio/config/1.1/vts/functional/radio_config_response.cpp b/radio/config/1.1/vts/functional/radio_config_response.cpp
index 8c9e4d7..ce3dfdf 100644
--- a/radio/config/1.1/vts/functional/radio_config_response.cpp
+++ b/radio/config/1.1/vts/functional/radio_config_response.cpp
@@ -31,7 +31,10 @@
}
Return<void> RadioConfigResponse::getPhoneCapabilityResponse(
- const RadioResponseInfo& /* info */, const PhoneCapability& /* phoneCapability */) {
+ const RadioResponseInfo& info, const PhoneCapability& phoneCapability) {
+ rspInfo = info;
+ phoneCap = phoneCapability;
+ parent.notify(info.serial);
return Void();
}
@@ -47,4 +50,4 @@
Return<void> RadioConfigResponse::setModemsConfigResponse(const RadioResponseInfo& /* info */) {
return Void();
-}
\ No newline at end of file
+}