Merge "p2p: add new HAL API to pass vendor-specific data"
diff --git a/audio/7.1/Android.bp b/audio/7.1/Android.bp
index d0d96b6..cede72a 100644
--- a/audio/7.1/Android.bp
+++ b/audio/7.1/Android.bp
@@ -13,11 +13,12 @@
name: "android.hardware.audio@7.1",
root: "android.hardware",
srcs: [
+ "types.hal",
"IDevice.hal",
"IDevicesFactory.hal",
"IPrimaryDevice.hal",
- "IStreamIn.hal",
"IStreamOut.hal",
+ "IStreamOutLatencyModeCallback.hal",
],
interfaces: [
"android.hardware.audio@7.0",
diff --git a/audio/7.1/IDevice.hal b/audio/7.1/IDevice.hal
index 373d17f..c158e7e 100644
--- a/audio/7.1/IDevice.hal
+++ b/audio/7.1/IDevice.hal
@@ -20,7 +20,6 @@
import @7.0::AudioInOutFlag;
import @7.0::IDevice;
import @7.0::Result;
-import IStreamIn;
import IStreamOut;
interface IDevice extends @7.0::IDevice {
@@ -56,33 +55,14 @@
AudioConfig suggestedConfig);
/**
- * This method creates and opens the audio hardware input stream.
- * If the stream can not be opened with the proposed audio config,
- * HAL must provide suggested values for the audio config.
+ * Notifies the device module about the connection state of an input/output
+ * device attached to it. The devicePort identifies the device and may also
+ * provide extra information such as raw audio descriptors.
*
- * Note: INVALID_ARGUMENTS is returned both in the case when the
- * HAL can not use the provided config and in the case when
- * the value of any argument is invalid. In the latter case the
- * HAL must provide a default initialized suggested config.
- *
- * @param ioHandle handle assigned by AudioFlinger.
- * @param device device type and (if needed) address.
- * @param config stream configuration.
- * @param flags additional flags.
- * @param sinkMetadata Description of the audio that is suggested by the client.
- * May be used by implementations to configure processing effects.
+ * @param devicePort audio device port.
+ * @param connected whether the device is connected.
* @return retval operation completion status.
- * @return inStream in case of success, created input stream.
- * @return suggestedConfig in the case of rejection of the proposed config,
- * a config suggested by the HAL.
*/
- openInputStream_7_1(
- AudioIoHandle ioHandle,
- DeviceAddress device,
- AudioConfig config,
- vec<AudioInOutFlag> flags,
- SinkMetadata sinkMetadata) generates (
- Result retval,
- IStreamIn inStream,
- AudioConfig suggestedConfig);
+ setConnectedState_7_1(AudioPort devicePort, bool connected)
+ generates (Result retval);
};
diff --git a/audio/7.1/IStreamOut.hal b/audio/7.1/IStreamOut.hal
index 092a9a0..b2013cf 100644
--- a/audio/7.1/IStreamOut.hal
+++ b/audio/7.1/IStreamOut.hal
@@ -16,7 +16,54 @@
package android.hardware.audio@7.1;
+import @7.0::Result;
import @7.0::IStreamOut;
+import IStreamOutLatencyModeCallback;
+
interface IStreamOut extends @7.0::IStreamOut {
+ /**
+ * Indicates the requested latency mode for this output stream.
+ *
+ * The requested mode can be one of the modes returned by
+ * getRecommendedLatencyModes() API.
+ *
+ * Optional method.
+ * Mandated only on specific spatial audio streams indicated by
+ * AUDIO_OUTPUT_FLAG_SPATIALIZER flag if they can be routed to a BT classic sink.
+ *
+ * @return retval operation completion status.
+ */
+ setLatencyMode(LatencyMode mode) generates (Result retval);
+
+ /**
+ * Indicates which latency modes are currently supported on this output stream.
+ * If the transport protocol (e.g Bluetooth A2DP) used by this output stream to reach
+ * the output device supports variable latency modes, the HAL indicates which
+ * modes are currently supported.
+ * The framework can then call setLatencyMode() with one of the supported modes to select
+ * the desired operation mode.
+ *
+ * Optional method.
+ * Mandated only on specific spatial audio streams indicated by
+ * AUDIO_OUTPUT_FLAG_SPATIALIZER flag if they can be routed to a BT classic sink.
+ *
+ * @return retval operation completion status.
+ * @return modes currrently supported latency modes.
+ */
+ getRecommendedLatencyModes() generates (Result retval, vec<LatencyMode> modes);
+
+ /**
+ * Set the callback interface for notifying changes in supported latency modes.
+ *
+ * Calling this method with a null pointer will result in releasing
+ * the callback.
+ *
+ * Optional method.
+ * Mandated only on specific spatial audio streams indicated by
+ * AUDIO_OUTPUT_FLAG_SPATIALIZER flag if they can be routed to a BT classic sink.
+ *
+ * @return retval operation completion status.
+ */
+ setLatencyModeCallback(IStreamOutLatencyModeCallback callback) generates (Result retval);
};
diff --git a/audio/7.1/IStreamIn.hal b/audio/7.1/IStreamOutLatencyModeCallback.hal
similarity index 69%
copy from audio/7.1/IStreamIn.hal
copy to audio/7.1/IStreamOutLatencyModeCallback.hal
index abebe6a..45b453f 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/audio/7.1/IStreamOutLatencyModeCallback.hal
@@ -14,9 +14,15 @@
* limitations under the License.
*/
+
package android.hardware.audio@7.1;
-import @7.0::IStreamIn;
-
-interface IStreamIn extends @7.0::IStreamIn {
+/**
+ * Callback interface for output stream variable latency mode feature.
+ */
+interface IStreamOutLatencyModeCallback {
+ /**
+ * Called with the new list of supported latency modes when a change occurs.
+ */
+ oneway onRecommendedLatencyModeChanged(vec<LatencyMode> modes);
};
diff --git a/audio/7.1/config/api/current.txt b/audio/7.1/config/api/current.txt
index 01c2e4b..3a08b71 100644
--- a/audio/7.1/config/api/current.txt
+++ b/audio/7.1/config/api/current.txt
@@ -62,6 +62,8 @@
enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_7POINT1;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_7POINT1POINT2;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_7POINT1POINT4;
+ enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_9POINT1POINT4;
+ enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_9POINT1POINT6;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_HAPTIC_AB;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_MONO;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_MONO_HAPTIC_A;
@@ -84,6 +86,7 @@
enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_MUSIC;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_SONIFICATION;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_SPEECH;
+ enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_ULTRASOUND;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_UNKNOWN;
}
@@ -125,6 +128,7 @@
enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_AUX_DIGITAL;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_AUX_LINE;
+ enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLE_BROADCAST;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLE_HEADSET;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLE_SPEAKER;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_A2DP;
@@ -270,6 +274,7 @@
enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_MMAP_NOIRQ;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_RAW;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_SYNC;
+ enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_ULTRASOUND;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_VOIP_TX;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_DEEP_BUFFER;
@@ -284,8 +289,10 @@
enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_NON_BLOCKING;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_PRIMARY;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_RAW;
+ enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_SPATIALIZER;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_SYNC;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_TTS;
+ enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_ULTRASOUND;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_VOIP_RX;
}
@@ -310,6 +317,7 @@
enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_HOTWORD;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_MIC;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_REMOTE_SUBMIX;
+ enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_ULTRASOUND;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_UNPROCESSED;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_VOICE_CALL;
enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_VOICE_COMMUNICATION;
@@ -458,6 +466,7 @@
method @Nullable public String getName();
method @Nullable public java.util.List<android.audio.policy.configuration.V7_1.AudioUsage> getPreferredUsage();
method @Nullable public java.util.List<android.audio.policy.configuration.V7_1.Profile> getProfile();
+ method @Nullable public long getRecommendedMuteDurationMs();
method @Nullable public android.audio.policy.configuration.V7_1.Role getRole();
method public void setFlags(@Nullable java.util.List<android.audio.policy.configuration.V7_1.AudioInOutFlag>);
method public void setGains(@Nullable android.audio.policy.configuration.V7_1.Gains);
@@ -465,6 +474,7 @@
method public void setMaxOpenCount(@Nullable long);
method public void setName(@Nullable String);
method public void setPreferredUsage(@Nullable java.util.List<android.audio.policy.configuration.V7_1.AudioUsage>);
+ method public void setRecommendedMuteDurationMs(@Nullable long);
method public void setRole(@Nullable android.audio.policy.configuration.V7_1.Role);
}
diff --git a/audio/7.1/config/audio_policy_configuration.xsd b/audio/7.1/config/audio_policy_configuration.xsd
index 731bb7c..ebc23ed 100644
--- a/audio/7.1/config/audio_policy_configuration.xsd
+++ b/audio/7.1/config/audio_policy_configuration.xsd
@@ -179,6 +179,8 @@
<xs:enumeration value="AUDIO_OUTPUT_FLAG_VOIP_RX" />
<xs:enumeration value="AUDIO_OUTPUT_FLAG_INCALL_MUSIC" />
<xs:enumeration value="AUDIO_OUTPUT_FLAG_GAPLESS_OFFLOAD" />
+ <xs:enumeration value="AUDIO_OUTPUT_FLAG_SPATIALIZER" />
+ <xs:enumeration value="AUDIO_OUTPUT_FLAG_ULTRASOUND" />
<xs:enumeration value="AUDIO_INPUT_FLAG_FAST" />
<xs:enumeration value="AUDIO_INPUT_FLAG_HW_HOTWORD" />
<xs:enumeration value="AUDIO_INPUT_FLAG_RAW" />
@@ -187,6 +189,7 @@
<xs:enumeration value="AUDIO_INPUT_FLAG_VOIP_TX" />
<xs:enumeration value="AUDIO_INPUT_FLAG_HW_AV_SYNC" />
<xs:enumeration value="AUDIO_INPUT_FLAG_DIRECT" />
+ <xs:enumeration value="AUDIO_INPUT_FLAG_ULTRASOUND" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="audioInOutFlags">
@@ -225,6 +228,7 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
+ <xs:attribute name="recommendedMuteDurationMs" type="xs:unsignedInt"/>
</xs:complexType>
<xs:unique name="mixPortProfileUniqueness">
<xs:selector xpath="profile"/>
@@ -276,6 +280,7 @@
<xs:enumeration value="AUDIO_DEVICE_OUT_ECHO_CANCELLER"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_BLE_HEADSET"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_BLE_SPEAKER"/>
+ <xs:enumeration value="AUDIO_DEVICE_OUT_BLE_BROADCAST"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_DEFAULT"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_STUB"/>
@@ -468,6 +473,7 @@
<xs:enumeration value="AUDIO_CONTENT_TYPE_MUSIC"/>
<xs:enumeration value="AUDIO_CONTENT_TYPE_MOVIE"/>
<xs:enumeration value="AUDIO_CONTENT_TYPE_SONIFICATION"/>
+ <xs:enumeration value="AUDIO_CONTENT_TYPE_ULTRASOUND"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="samplingRates">
@@ -510,6 +516,8 @@
<xs:enumeration value="AUDIO_CHANNEL_OUT_7POINT1"/>
<xs:enumeration value="AUDIO_CHANNEL_OUT_7POINT1POINT2"/>
<xs:enumeration value="AUDIO_CHANNEL_OUT_7POINT1POINT4"/>
+ <xs:enumeration value="AUDIO_CHANNEL_OUT_9POINT1POINT4"/>
+ <xs:enumeration value="AUDIO_CHANNEL_OUT_9POINT1POINT6"/>
<xs:enumeration value="AUDIO_CHANNEL_OUT_13POINT_360RA"/>
<xs:enumeration value="AUDIO_CHANNEL_OUT_22POINT2"/>
<xs:enumeration value="AUDIO_CHANNEL_OUT_MONO_HAPTIC_A"/>
@@ -737,6 +745,7 @@
<xs:enumeration value="AUDIO_SOURCE_ECHO_REFERENCE"/>
<xs:enumeration value="AUDIO_SOURCE_FM_TUNER"/>
<xs:enumeration value="AUDIO_SOURCE_HOTWORD"/>
+ <xs:enumeration value="AUDIO_SOURCE_ULTRASOUND"/>
</xs:restriction>
</xs:simpleType>
<!-- Enum values of device_category from Volume.h. -->
diff --git a/audio/7.1/IStreamIn.hal b/audio/7.1/types.hal
similarity index 60%
copy from audio/7.1/IStreamIn.hal
copy to audio/7.1/types.hal
index abebe6a..9d8ee4d 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/audio/7.1/types.hal
@@ -16,7 +16,15 @@
package android.hardware.audio@7.1;
-import @7.0::IStreamIn;
+/**
+ * Latency modes used for the variable latency feature on output streams.
+ * Used by setLatencyMode() and getRecommendedLatencyModes() methods.
+ */
-interface IStreamIn extends @7.0::IStreamIn {
+@export(name="audio_latency_mode_t", value_prefix="AUDIO_LATENCY_MODE_")
+enum LatencyMode : int32_t {
+ /** No specific constraint on the latency */
+ FREE = 0,
+ /** A relatively low latency compatible with head tracking operation (e.g less than 100ms) */
+ LOW = 1,
};
diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp
index c172674..6a0cfa5 100644
--- a/audio/aidl/Android.bp
+++ b/audio/aidl/Android.bp
@@ -47,6 +47,11 @@
vndk: {
enabled: true,
},
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.bluetooth",
+ ],
+ min_sdk_version: "31",
},
},
versions: [
diff --git a/audio/common/7.1/enums/include/android_audio_policy_configuration_V7_1-enums.h b/audio/common/7.1/enums/include/android_audio_policy_configuration_V7_1-enums.h
index 815f869..6f6a0ca 100644
--- a/audio/common/7.1/enums/include/android_audio_policy_configuration_V7_1-enums.h
+++ b/audio/common/7.1/enums/include/android_audio_policy_configuration_V7_1-enums.h
@@ -97,10 +97,12 @@
case AudioChannelMask::AUDIO_CHANNEL_OUT_13POINT_360RA:
case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_13:
return 13;
+ case AudioChannelMask::AUDIO_CHANNEL_OUT_9POINT1POINT4:
case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_14:
return 14;
case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_15:
return 15;
+ case AudioChannelMask::AUDIO_CHANNEL_OUT_9POINT1POINT6:
case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_16:
return 16;
case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_17:
@@ -170,6 +172,7 @@
case AudioDevice::AUDIO_DEVICE_OUT_ECHO_CANCELLER:
case AudioDevice::AUDIO_DEVICE_OUT_BLE_HEADSET:
case AudioDevice::AUDIO_DEVICE_OUT_BLE_SPEAKER:
+ case AudioDevice::AUDIO_DEVICE_OUT_BLE_BROADCAST:
case AudioDevice::AUDIO_DEVICE_OUT_DEFAULT:
case AudioDevice::AUDIO_DEVICE_OUT_STUB:
return true;
diff --git a/audio/core/all-versions/default/Device.cpp b/audio/core/all-versions/default/Device.cpp
index ac5a3ba..b954fcd 100644
--- a/audio/core/all-versions/default/Device.cpp
+++ b/audio/core/all-versions/default/Device.cpp
@@ -348,16 +348,6 @@
_hidl_cb(result, streamOut, suggestedConfig);
return Void();
}
-
-Return<void> Device::openInputStream_7_1(int32_t ioHandle, const DeviceAddress& device,
- const AudioConfig& config, const AudioInputFlags& flags,
- const SinkMetadata& sinkMetadata,
- openInputStream_7_1_cb _hidl_cb) {
- auto [result, streamIn, suggestedConfig] =
- openInputStreamImpl(ioHandle, device, config, flags, sinkMetadata);
- _hidl_cb(result, streamIn, suggestedConfig);
- return Void();
-}
#endif // V7.1
Return<bool> Device::supportsAudioPatches() {
@@ -616,6 +606,21 @@
#endif
+#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
+Return<Result> Device::setConnectedState_7_1(const AudioPort& devicePort, bool connected) {
+ if (version() >= AUDIO_DEVICE_API_VERSION_3_2 &&
+ mDevice->set_device_connected_state_v7 != nullptr) {
+ audio_port_v7 halPort;
+ if (status_t status = HidlUtils::audioPortToHal(devicePort, &halPort); status != NO_ERROR) {
+ return analyzeStatus("audioPortToHal", status);
+ }
+ return analyzeStatus("set_device_connected_state_v7",
+ mDevice->set_device_connected_state_v7(mDevice, &halPort, connected));
+ }
+ return Result::NOT_SUPPORTED;
+}
+#endif
+
} // namespace implementation
} // namespace CPP_VERSION
} // namespace audio
diff --git a/audio/core/all-versions/default/StreamOut.cpp b/audio/core/all-versions/default/StreamOut.cpp
index d4a89d7..09df4ed 100644
--- a/audio/core/all-versions/default/StreamOut.cpp
+++ b/audio/core/all-versions/default/StreamOut.cpp
@@ -761,6 +761,73 @@
ALOGW_IF(!result.isOk(), "Client callback failed: %s", result.description().c_str());
return 0;
}
+
+#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
+Return<Result> StreamOut::setLatencyMode(LatencyMode mode) {
+ return mStream->set_latency_mode != nullptr
+ ? Stream::analyzeStatus(
+ "set_latency_mode",
+ mStream->set_latency_mode(mStream,
+ static_cast<audio_latency_mode_t>(mode)))
+ : Result::NOT_SUPPORTED;
+};
+
+Return<void> StreamOut::getRecommendedLatencyModes(getRecommendedLatencyModes_cb _hidl_cb) {
+ Result retval = Result::NOT_SUPPORTED;
+ hidl_vec<LatencyMode> hidlModes;
+ size_t num_modes = AUDIO_LATENCY_MODE_CNT;
+ audio_latency_mode_t modes[AUDIO_LATENCY_MODE_CNT];
+
+ if (mStream->get_recommended_latency_modes != nullptr &&
+ mStream->get_recommended_latency_modes(mStream, &modes[0], &num_modes) == 0) {
+ if (num_modes == 0 || num_modes > AUDIO_LATENCY_MODE_CNT) {
+ ALOGW("%s invalid number of modes returned: %zu", __func__, num_modes);
+ retval = Result::INVALID_STATE;
+ } else {
+ hidlModes.resize(num_modes);
+ for (size_t i = 0; i < num_modes; ++i) {
+ hidlModes[i] = static_cast<LatencyMode>(modes[i]);
+ }
+ retval = Result::OK;
+ }
+ }
+ _hidl_cb(retval, hidlModes);
+ return Void();
+};
+
+// static
+void StreamOut::latencyModeCallback(audio_latency_mode_t* modes, size_t num_modes, void* cookie) {
+ StreamOut* self = reinterpret_cast<StreamOut*>(cookie);
+ sp<IStreamOutLatencyModeCallback> callback = self->mLatencyModeCallback.load();
+ if (callback.get() == nullptr) return;
+
+ ALOGV("%s", __func__);
+
+ if (num_modes == 0 || num_modes > AUDIO_LATENCY_MODE_CNT) {
+ ALOGW("%s invalid number of modes returned: %zu", __func__, num_modes);
+ return;
+ }
+
+ hidl_vec<LatencyMode> hidlModes(num_modes);
+ for (size_t i = 0; i < num_modes; ++i) {
+ hidlModes[i] = static_cast<LatencyMode>(modes[i]);
+ }
+ Return<void> result = callback->onRecommendedLatencyModeChanged(hidlModes);
+ ALOGW_IF(!result.isOk(), "Client callback failed: %s", result.description().c_str());
+}
+
+Return<Result> StreamOut::setLatencyModeCallback(
+ const sp<IStreamOutLatencyModeCallback>& callback) {
+ if (mStream->set_latency_mode_callback == nullptr) return Result::NOT_SUPPORTED;
+ int result = mStream->set_latency_mode_callback(mStream, StreamOut::latencyModeCallback, this);
+ if (result == 0) {
+ mLatencyModeCallback = callback;
+ }
+ return Stream::analyzeStatus("set_latency_mode_callback", result, {ENOSYS} /*ignore*/);
+};
+
+#endif
+
#endif
} // namespace implementation
diff --git a/audio/core/all-versions/default/include/core/default/Device.h b/audio/core/all-versions/default/include/core/default/Device.h
index 0aeb6b3..0696f97 100644
--- a/audio/core/all-versions/default/include/core/default/Device.h
+++ b/audio/core/all-versions/default/include/core/default/Device.h
@@ -123,10 +123,6 @@
const AudioConfig& config, const AudioOutputFlags& flags,
const SourceMetadata& sourceMetadata,
openOutputStream_7_1_cb _hidl_cb) override;
- Return<void> openInputStream_7_1(int32_t ioHandle, const DeviceAddress& device,
- const AudioConfig& config, const AudioInputFlags& flags,
- const SinkMetadata& sinkMetadata,
- openInputStream_7_1_cb _hidl_cb) override;
#endif
Return<bool> supportsAudioPatches() override;
@@ -163,6 +159,9 @@
const hidl_vec<AudioPortConfig>& sinks,
createAudioPatch_cb _hidl_cb) override;
#endif
+#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
+ Return<Result> setConnectedState_7_1(const AudioPort& devicePort, bool connected) override;
+#endif
Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) override;
// Utility methods for extending interfaces.
diff --git a/audio/core/all-versions/default/include/core/default/StreamIn.h b/audio/core/all-versions/default/include/core/default/StreamIn.h
index a6346e5..4627eec 100644
--- a/audio/core/all-versions/default/include/core/default/StreamIn.h
+++ b/audio/core/all-versions/default/include/core/default/StreamIn.h
@@ -17,7 +17,9 @@
#ifndef ANDROID_HARDWARE_AUDIO_STREAMIN_H
#define ANDROID_HARDWARE_AUDIO_STREAMIN_H
-#include PATH(android/hardware/audio/FILE_VERSION/IStreamIn.h)
+// clang-format off
+#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/IStreamIn.h)
+// clang-format on
#include "Device.h"
#include "Stream.h"
diff --git a/audio/core/all-versions/default/include/core/default/StreamOut.h b/audio/core/all-versions/default/include/core/default/StreamOut.h
index 60ad5d5..ce5253f 100644
--- a/audio/core/all-versions/default/include/core/default/StreamOut.h
+++ b/audio/core/all-versions/default/include/core/default/StreamOut.h
@@ -153,6 +153,12 @@
Result doUpdateSourceMetadata(const SourceMetadata& sourceMetadata);
#if MAJOR_VERSION >= 7
Result doUpdateSourceMetadataV7(const SourceMetadata& sourceMetadata);
+#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
+ Return<Result> setLatencyMode(LatencyMode mode) override;
+ Return<void> getRecommendedLatencyModes(getRecommendedLatencyModes_cb _hidl_cb) override;
+ Return<Result> setLatencyModeCallback(
+ const sp<IStreamOutLatencyModeCallback>& callback) override;
+#endif
#endif
#endif // MAJOR_VERSION >= 4
@@ -163,6 +169,9 @@
mediautils::atomic_sp<IStreamOutCallback> mCallback; // for non-blocking write and drain
#if MAJOR_VERSION >= 6
mediautils::atomic_sp<IStreamOutEventCallback> mEventCallback;
+#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
+ mediautils::atomic_sp<IStreamOutLatencyModeCallback> mLatencyModeCallback;
+#endif
#endif
std::unique_ptr<CommandMQ> mCommandMQ;
std::unique_ptr<DataMQ> mDataMQ;
@@ -177,6 +186,9 @@
#if MAJOR_VERSION >= 6
static int asyncEventCallback(stream_event_callback_type_t event, void* param, void* cookie);
+#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
+ static void latencyModeCallback(audio_latency_mode_t* modes, size_t num_modes, void* cookie);
+#endif
#endif
};
diff --git a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalUtils.h b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalUtils.h
index a567cf9..83ca9eb 100644
--- a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalUtils.h
+++ b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalUtils.h
@@ -15,9 +15,9 @@
*/
// clang-format off
-#include PATH(android/hardware/audio/FILE_VERSION/IStreamIn.h)
-#include PATH(android/hardware/audio/FILE_VERSION/IStreamOut.h)
+#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/IStreamIn.h)
#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h)
+#include PATH(android/hardware/audio/FILE_VERSION/IStreamOut.h)
#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h)
// clang-format on
#include <hidl/HidlSupport.h>
diff --git a/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp
index b750f56..6b9b32d 100644
--- a/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp
+++ b/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp
@@ -16,3 +16,82 @@
// pull in all the <= 7.0 tests
#include "7.0/AudioPrimaryHidlHalTest.cpp"
+
+TEST_P(AudioHidlDeviceTest, SetConnectedState_7_1) {
+ doc::test("Check that the HAL can be notified of device connection and disconnection");
+ using AD = xsd::AudioDevice;
+ for (auto deviceType : {AD::AUDIO_DEVICE_OUT_HDMI, AD::AUDIO_DEVICE_OUT_WIRED_HEADPHONE,
+ AD::AUDIO_DEVICE_IN_USB_HEADSET}) {
+ SCOPED_TRACE("device=" + toString(deviceType));
+ for (bool state : {true, false}) {
+ SCOPED_TRACE("state=" + ::testing::PrintToString(state));
+ DeviceAddress address = {};
+ address.deviceType = toString(deviceType);
+ if (deviceType == AD::AUDIO_DEVICE_IN_USB_HEADSET) {
+ address.address.alsa({0, 0});
+ }
+ AudioPort devicePort;
+ devicePort.ext.device(address);
+ auto ret = getDevice()->setConnectedState_7_1(devicePort, state);
+ ASSERT_TRUE(ret.isOk());
+ if (ret == Result::NOT_SUPPORTED) {
+ doc::partialTest("setConnectedState_7_1 is not supported");
+ break; // other deviceType might be supported
+ }
+ ASSERT_OK(ret);
+ }
+ }
+
+ // Because there is no way of knowing if the devices were connected before
+ // calling setConnectedState, there is no way to restore the HAL to its
+ // initial state. To workaround this, destroy the HAL at the end of this test.
+ ASSERT_TRUE(resetDevice());
+}
+class LatencyModeOutputStreamTest : public OutputStreamTest {
+ protected:
+ void SetUp() override {
+ OutputStreamTest::SetUp();
+
+ Result res;
+ EXPECT_OK(stream->getRecommendedLatencyModes(returnIn(res, mSupportedLatencyModes)));
+ EXPECT_RESULT(okOrNotSupported, res);
+ if (res == Result::NOT_SUPPORTED) {
+ GTEST_SKIP() << "latency mode is not supported"; // returns
+ }
+ }
+ hidl_vec<LatencyMode> mSupportedLatencyModes;
+};
+
+TEST_P(LatencyModeOutputStreamTest, GetRecommendedLatencyModes) {
+ doc::test("Verify that reported latency modes are valid when supported");
+ for (auto mode : mSupportedLatencyModes) {
+ ASSERT_TRUE(mode >= LatencyMode::FREE && mode <= LatencyMode::LOW);
+ }
+}
+
+TEST_P(LatencyModeOutputStreamTest, SetValidLatencyMode) {
+ doc::test("Verify that setting valid latency modes works when supported");
+ for (auto mode : mSupportedLatencyModes) {
+ EXPECT_OK(stream->setLatencyMode(mode));
+ }
+}
+
+TEST_P(LatencyModeOutputStreamTest, SetInValidLatencyMode) {
+ doc::test("Verify that setting invalid latency modes fails");
+ EXPECT_RESULT(invalidArgsOrNotSupported,
+ stream->setLatencyMode(static_cast<LatencyMode>(1977)));
+}
+
+/** Stub implementation of IStreamOutEventCallback **/
+class MockOutLatencyModeCallback : public IStreamOutLatencyModeCallback {
+ Return<void> onRecommendedLatencyModeChanged(
+ const hidl_vec<LatencyMode>& hidlModes __unused) override {
+ return {};
+ }
+};
+
+TEST_P(LatencyModeOutputStreamTest, SetLatencyModeCallback) {
+ doc::test("Verify that setting a latency mode callback works when supported");
+ EXPECT_OK(stream->setLatencyModeCallback(new MockOutLatencyModeCallback));
+ EXPECT_OK(stream->setLatencyModeCallback(nullptr));
+}
diff --git a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h
index 404532a..09446cd 100644
--- a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h
+++ b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h
@@ -91,8 +91,9 @@
using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION;
using namespace ::android::hardware::audio::common::test::utility;
using namespace ::android::hardware::audio::CPP_VERSION;
-using ReadParameters = ::android::hardware::audio::CPP_VERSION::IStreamIn::ReadParameters;
-using ReadStatus = ::android::hardware::audio::CPP_VERSION::IStreamIn::ReadStatus;
+using ReadParameters =
+ ::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn::ReadParameters;
+using ReadStatus = ::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn::ReadStatus;
using WriteCommand = ::android::hardware::audio::CPP_VERSION::IStreamOut::WriteCommand;
using WriteStatus = ::android::hardware::audio::CPP_VERSION::IStreamOut::WriteStatus;
#if MAJOR_VERSION >= 7
@@ -1010,6 +1011,7 @@
class OutputStreamTest
: public OpenStreamTest<::android::hardware::audio::CPP_VERSION::IStreamOut> {
+ protected:
void SetUp() override {
ASSERT_NO_FATAL_FAILURE(OpenStreamTest::SetUp()); // setup base
#if MAJOR_VERSION <= 6
@@ -1035,7 +1037,6 @@
}
#if MAJOR_VERSION >= 4 && MAJOR_VERSION <= 6
- protected:
const SourceMetadata initMetadata = {
{ { AudioUsage::MEDIA,
AudioContentType::MUSIC,
@@ -1089,7 +1090,7 @@
class StreamReader : public StreamWorker<StreamReader> {
public:
- using IStreamIn = ::android::hardware::audio::CPP_VERSION::IStreamIn;
+ using IStreamIn = ::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn;
StreamReader(IStreamIn* stream, size_t bufferSize)
: mStream(stream), mBufferSize(bufferSize), mData(mBufferSize) {}
@@ -1204,7 +1205,8 @@
EventFlag* mEfGroup = nullptr;
};
-class InputStreamTest : public OpenStreamTest<::android::hardware::audio::CPP_VERSION::IStreamIn> {
+class InputStreamTest
+ : public OpenStreamTest<::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn> {
void SetUp() override {
ASSERT_NO_FATAL_FAILURE(OpenStreamTest::SetUp()); // setup base
#if MAJOR_VERSION <= 6
@@ -1226,13 +1228,8 @@
auto flags = getInputFlags();
testOpen(
[&](AudioIoHandle handle, AudioConfig config, auto cb) {
-#if MAJOR_VERSION < 7 || (MAJOR_VERSION == 7 && MINOR_VERSION == 0)
return getDevice()->openInputStream(handle, address, config, flags,
initMetadata, cb);
-#elif MAJOR_VERSION == 7 && MINOR_VERSION == 1
- return getDevice()->openInputStream_7_1(handle, address, config, flags,
- initMetadata, cb);
-#endif
},
config);
}
@@ -1605,8 +1602,9 @@
"InputStream::setGain");
}
-static void testPrepareForReading(::android::hardware::audio::CPP_VERSION::IStreamIn* stream,
- uint32_t frameSize, uint32_t framesCount) {
+static void testPrepareForReading(
+ ::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn* stream, uint32_t frameSize,
+ uint32_t framesCount) {
Result res;
// Ignore output parameters as the call should fail
ASSERT_OK(stream->prepareForReading(frameSize, framesCount,
diff --git a/automotive/evs/1.1/default/Android.bp b/automotive/evs/1.1/default/Android.bp
index ea1851f..4c08ef3 100644
--- a/automotive/evs/1.1/default/Android.bp
+++ b/automotive/evs/1.1/default/Android.bp
@@ -13,48 +13,46 @@
proprietary: true,
relative_install_path: "hw",
srcs: [
- "service.cpp",
- "EvsCamera.cpp",
- "EvsEnumerator.cpp",
- "EvsDisplay.cpp",
- "ConfigManager.cpp",
- "ConfigManagerUtil.cpp",
- "EvsUltrasonicsArray.cpp",
+ "*.cpp",
],
init_rc: ["android.hardware.automotive.evs@1.1-service.rc"],
-
shared_libs: [
+ "android.frameworks.automotive.display@1.0",
"android.hardware.automotive.evs@1.0",
"android.hardware.automotive.evs@1.1",
"android.hardware.camera.device@3.3",
+ "android.hardware.graphics.bufferqueue@1.0",
+ "android.hardware.graphics.bufferqueue@2.0",
"android.hidl.allocator@1.0",
"android.hidl.memory@1.0",
+ "android.hidl.token@1.0-utils",
+ "libEGL",
+ "libGLESv2",
"libbase",
"libbinder",
- "liblog",
+ "libbufferqueueconverter",
+ "libcamera_metadata",
"libhardware",
"libhidlbase",
"libhidlmemory",
"liblog",
+ "libtinyxml2",
"libui",
"libutils",
- "libcamera_metadata",
- "libtinyxml2",
- "android.hidl.token@1.0-utils",
- "android.frameworks.automotive.display@1.0",
- "android.hardware.graphics.bufferqueue@1.0",
- "android.hardware.graphics.bufferqueue@2.0",
],
-
cflags: [
"-O0",
"-g",
+ "-DLOG_TAG=\"MockEvsDriver\"",
+ "-DGL_GLEXT_PROTOTYPES",
+ "-DEGL_EGLEXT_PROTOTYPES",
],
-
+ include_dirs: [
+ "frameworks/native/include/",
+ ],
required: [
"evs_default_configuration.xml",
],
-
vintf_fragments: [
"manifest_android.hardware.automotive.evs@1.1-service.xml",
],
diff --git a/automotive/evs/1.1/default/ConfigManager.cpp b/automotive/evs/1.1/default/ConfigManager.cpp
index 986793e..ca8cfae 100644
--- a/automotive/evs/1.1/default/ConfigManager.cpp
+++ b/automotive/evs/1.1/default/ConfigManager.cpp
@@ -14,38 +14,40 @@
* limitations under the License.
*/
-#include <sstream>
-#include <fstream>
-#include <thread>
-
-#include <hardware/gralloc.h>
-#include <utils/SystemClock.h>
-#include <android/hardware/camera/device/3.2/ICameraDevice.h>
-
#include "ConfigManager.h"
-using ::android::hardware::camera::device::V3_2::StreamRotation;
+#include <android/hardware/camera/device/3.2/ICameraDevice.h>
+#include <hardware/gralloc.h>
+#include <utils/SystemClock.h>
+#include <fstream>
+#include <sstream>
+#include <thread>
+
+namespace android::hardware::automotive::evs::V1_1::implementation {
+
+using namespace std;
+using namespace tinyxml2;
+using hardware::camera::device::V3_2::StreamRotation;
ConfigManager::~ConfigManager() {
/* Nothing to do */
}
-
-void ConfigManager::readCameraInfo(const XMLElement * const aCameraElem) {
+void ConfigManager::readCameraInfo(const XMLElement* const aCameraElem) {
if (aCameraElem == nullptr) {
ALOGW("XML file does not have required camera element");
return;
}
- const XMLElement *curElem = aCameraElem->FirstChildElement();
+ const XMLElement* curElem = aCameraElem->FirstChildElement();
while (curElem != nullptr) {
if (!strcmp(curElem->Name(), "group")) {
/* camera group identifier */
- const char *id = curElem->FindAttribute("id")->Value();
+ const char* id = curElem->FindAttribute("id")->Value();
/* create a camera group to be filled */
- CameraGroupInfo *aCamera = new CameraGroupInfo();
+ CameraGroupInfo* aCamera = new CameraGroupInfo();
/* read camera device information */
if (!readCameraDeviceInfo(aCamera, curElem)) {
@@ -55,28 +57,26 @@
}
/* camera group synchronization */
- const char *sync = curElem->FindAttribute("synchronized")->Value();
+ const char* sync = curElem->FindAttribute("synchronized")->Value();
if (!strcmp(sync, "CALIBRATED")) {
- aCamera->synchronized =
- ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED;
+ aCamera->synchronized = ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED;
} else if (!strcmp(sync, "APPROXIMATE")) {
- aCamera->synchronized =
- ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE;
+ aCamera->synchronized = ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE;
} else {
- aCamera->synchronized = 0; // Not synchronized
+ aCamera->synchronized = 0; // Not synchronized
}
/* add a group to hash map */
mCameraGroupInfos.insert_or_assign(id, unique_ptr<CameraGroupInfo>(aCamera));
} else if (!strcmp(curElem->Name(), "device")) {
/* camera unique identifier */
- const char *id = curElem->FindAttribute("id")->Value();
+ const char* id = curElem->FindAttribute("id")->Value();
/* camera mount location */
- const char *pos = curElem->FindAttribute("position")->Value();
+ const char* pos = curElem->FindAttribute("position")->Value();
/* create a camera device to be filled */
- CameraInfo *aCamera = new CameraInfo();
+ CameraInfo* aCamera = new CameraInfo();
/* read camera device information */
if (!readCameraDeviceInfo(aCamera, curElem)) {
@@ -99,10 +99,7 @@
}
}
-
-bool
-ConfigManager::readCameraDeviceInfo(CameraInfo *aCamera,
- const XMLElement *aDeviceElem) {
+bool ConfigManager::readCameraDeviceInfo(CameraInfo* aCamera, const XMLElement* aDeviceElem) {
if (aCamera == nullptr || aDeviceElem == nullptr) {
return false;
}
@@ -113,16 +110,11 @@
/* read device capabilities */
totalEntries +=
- readCameraCapabilities(aDeviceElem->FirstChildElement("caps"),
- aCamera,
- totalDataSize);
-
+ readCameraCapabilities(aDeviceElem->FirstChildElement("caps"), aCamera, totalDataSize);
/* read camera metadata */
- totalEntries +=
- readCameraMetadata(aDeviceElem->FirstChildElement("characteristics"),
- aCamera,
- totalDataSize);
+ totalEntries += readCameraMetadata(aDeviceElem->FirstChildElement("characteristics"), aCamera,
+ totalDataSize);
/* construct camera_metadata_t */
if (!constructCameraMetadata(aCamera, totalEntries, totalDataSize)) {
@@ -133,40 +125,34 @@
return true;
}
-
-size_t
-ConfigManager::readCameraCapabilities(const XMLElement * const aCapElem,
- CameraInfo *aCamera,
- size_t &dataSize) {
+size_t ConfigManager::readCameraCapabilities(const XMLElement* const aCapElem, CameraInfo* aCamera,
+ size_t& dataSize) {
if (aCapElem == nullptr || aCamera == nullptr) {
return 0;
}
string token;
- const XMLElement *curElem = nullptr;
+ const XMLElement* curElem = nullptr;
/* a list of supported camera parameters/controls */
curElem = aCapElem->FirstChildElement("supported_controls");
if (curElem != nullptr) {
- const XMLElement *ctrlElem = curElem->FirstChildElement("control");
+ const XMLElement* ctrlElem = curElem->FirstChildElement("control");
while (ctrlElem != nullptr) {
- const char *nameAttr = ctrlElem->FindAttribute("name")->Value();;
+ const char* nameAttr = ctrlElem->FindAttribute("name")->Value();
+ ;
const int32_t minVal = stoi(ctrlElem->FindAttribute("min")->Value());
const int32_t maxVal = stoi(ctrlElem->FindAttribute("max")->Value());
int32_t stepVal = 1;
- const XMLAttribute *stepAttr = ctrlElem->FindAttribute("step");
+ const XMLAttribute* stepAttr = ctrlElem->FindAttribute("step");
if (stepAttr != nullptr) {
stepVal = stoi(stepAttr->Value());
}
CameraParam aParam;
- if (ConfigManagerUtil::convertToEvsCameraParam(nameAttr,
- aParam)) {
- aCamera->controls.emplace(
- aParam,
- make_tuple(minVal, maxVal, stepVal)
- );
+ if (ConfigManagerUtil::convertToEvsCameraParam(nameAttr, aParam)) {
+ aCamera->controls.emplace(aParam, make_tuple(minVal, maxVal, stepVal));
}
ctrlElem = ctrlElem->NextSiblingElement("control");
@@ -177,11 +163,11 @@
curElem = aCapElem->FirstChildElement("stream");
while (curElem != nullptr) {
/* read 5 attributes */
- const XMLAttribute *idAttr = curElem->FindAttribute("id");
- const XMLAttribute *widthAttr = curElem->FindAttribute("width");
- const XMLAttribute *heightAttr = curElem->FindAttribute("height");
- const XMLAttribute *fmtAttr = curElem->FindAttribute("format");
- const XMLAttribute *fpsAttr = curElem->FindAttribute("framerate");
+ const XMLAttribute* idAttr = curElem->FindAttribute("id");
+ const XMLAttribute* widthAttr = curElem->FindAttribute("width");
+ const XMLAttribute* heightAttr = curElem->FindAttribute("height");
+ const XMLAttribute* fmtAttr = curElem->FindAttribute("format");
+ const XMLAttribute* fpsAttr = curElem->FindAttribute("framerate");
const int32_t id = stoi(idAttr->Value());
int32_t framerate = 0;
@@ -190,16 +176,13 @@
}
int32_t pixFormat;
- if (ConfigManagerUtil::convertToPixelFormat(fmtAttr->Value(),
- pixFormat)) {
- RawStreamConfiguration cfg = {
- id,
- stoi(widthAttr->Value()),
- stoi(heightAttr->Value()),
- pixFormat,
- ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT,
- framerate
- };
+ if (ConfigManagerUtil::convertToPixelFormat(fmtAttr->Value(), pixFormat)) {
+ RawStreamConfiguration cfg = {id,
+ stoi(widthAttr->Value()),
+ stoi(heightAttr->Value()),
+ pixFormat,
+ ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT,
+ framerate};
aCamera->streamConfigurations.insert_or_assign(id, cfg);
}
@@ -207,70 +190,58 @@
}
dataSize = calculate_camera_metadata_entry_data_size(
- get_camera_metadata_tag_type(
- ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS
- ),
- aCamera->streamConfigurations.size() * kStreamCfgSz
- );
+ get_camera_metadata_tag_type(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS),
+ aCamera->streamConfigurations.size() * kStreamCfgSz);
/* a single camera metadata entry contains multiple stream configurations */
return dataSize > 0 ? 1 : 0;
}
-
-size_t
-ConfigManager::readCameraMetadata(const XMLElement * const aParamElem,
- CameraInfo *aCamera,
- size_t &dataSize) {
+size_t ConfigManager::readCameraMetadata(const XMLElement* const aParamElem, CameraInfo* aCamera,
+ size_t& dataSize) {
if (aParamElem == nullptr || aCamera == nullptr) {
return 0;
}
- const XMLElement *curElem = aParamElem->FirstChildElement("parameter");
+ const XMLElement* curElem = aParamElem->FirstChildElement("parameter");
size_t numEntries = 0;
camera_metadata_tag_t tag;
while (curElem != nullptr) {
if (!ConfigManagerUtil::convertToMetadataTag(curElem->FindAttribute("name")->Value(),
tag)) {
- switch(tag) {
+ switch (tag) {
case ANDROID_LENS_DISTORTION:
case ANDROID_LENS_POSE_ROTATION:
case ANDROID_LENS_POSE_TRANSLATION:
case ANDROID_LENS_INTRINSIC_CALIBRATION: {
/* float[] */
size_t count = 0;
- void *data = ConfigManagerUtil::convertFloatArray(
- curElem->FindAttribute("size")->Value(),
- curElem->FindAttribute("value")->Value(),
- count
- );
+ void* data = ConfigManagerUtil::convertFloatArray(
+ curElem->FindAttribute("size")->Value(),
+ curElem->FindAttribute("value")->Value(), count);
aCamera->cameraMetadata.insert_or_assign(
- tag, make_pair(make_unique<void *>(data), count)
- );
+ tag, make_pair(make_unique<void*>(data), count));
++numEntries;
dataSize += calculate_camera_metadata_entry_data_size(
- get_camera_metadata_tag_type(tag), count
- );
+ get_camera_metadata_tag_type(tag), count);
break;
}
case ANDROID_REQUEST_AVAILABLE_CAPABILITIES: {
- camera_metadata_enum_android_request_available_capabilities_t *data =
- new camera_metadata_enum_android_request_available_capabilities_t[1];
+ camera_metadata_enum_android_request_available_capabilities_t* data =
+ new camera_metadata_enum_android_request_available_capabilities_t[1];
if (ConfigManagerUtil::convertToCameraCapability(
- curElem->FindAttribute("value")->Value(), *data)) {
- curElem->FindAttribute("value")->Value(),
- aCamera->cameraMetadata.insert_or_assign(
- tag, make_pair(make_unique<void *>(data), 1)
- );
+ curElem->FindAttribute("value")->Value(), *data)) {
+ curElem->FindAttribute("value")->Value(),
+ aCamera->cameraMetadata.insert_or_assign(
+ tag, make_pair(make_unique<void*>(data), 1));
++numEntries;
dataSize += calculate_camera_metadata_entry_data_size(
- get_camera_metadata_tag_type(tag), 1
- );
+ get_camera_metadata_tag_type(tag), 1);
}
break;
}
@@ -278,13 +249,11 @@
case ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS: {
/* a comma-separated list of physical camera devices */
size_t len = strlen(curElem->FindAttribute("value")->Value());
- char *data = new char[len + 1];
- memcpy(data,
- curElem->FindAttribute("value")->Value(),
- len * sizeof(char));
+ char* data = new char[len + 1];
+ memcpy(data, curElem->FindAttribute("value")->Value(), len * sizeof(char));
/* replace commas with null char */
- char *p = data;
+ char* p = data;
while (*p != '\0') {
if (*p == ',') {
*p = '\0';
@@ -293,19 +262,16 @@
}
aCamera->cameraMetadata.insert_or_assign(
- tag, make_pair(make_unique<void *>(data), len)
- );
+ tag, make_pair(make_unique<void*>(data), len));
++numEntries;
dataSize += calculate_camera_metadata_entry_data_size(
- get_camera_metadata_tag_type(tag), len
- );
+ get_camera_metadata_tag_type(tag), len);
break;
}
default:
- ALOGW("Parameter %s is not supported",
- curElem->FindAttribute("name")->Value());
+ ALOGW("Parameter %s is not supported", curElem->FindAttribute("name")->Value());
break;
}
}
@@ -316,11 +282,8 @@
return numEntries;
}
-
-bool
-ConfigManager::constructCameraMetadata(CameraInfo *aCamera,
- const size_t totalEntries,
- const size_t totalDataSize) {
+bool ConfigManager::constructCameraMetadata(CameraInfo* aCamera, const size_t totalEntries,
+ const size_t totalDataSize) {
if (aCamera == nullptr || !aCamera->allocate(totalEntries, totalDataSize)) {
ALOGE("Failed to allocate memory for camera metadata");
return false;
@@ -328,16 +291,15 @@
const size_t numStreamConfigs = aCamera->streamConfigurations.size();
unique_ptr<int32_t[]> data(new int32_t[kStreamCfgSz * numStreamConfigs]);
- int32_t *ptr = data.get();
- for (auto &cfg : aCamera->streamConfigurations) {
+ int32_t* ptr = data.get();
+ for (auto& cfg : aCamera->streamConfigurations) {
for (auto i = 0; i < kStreamCfgSz; ++i) {
- *ptr++ = cfg.second[i];
+ *ptr++ = cfg.second[i];
}
}
int32_t err = add_camera_metadata_entry(aCamera->characteristics,
ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS,
- data.get(),
- numStreamConfigs * kStreamCfgSz);
+ data.get(), numStreamConfigs * kStreamCfgSz);
if (err) {
ALOGE("Failed to add stream configurations to metadata, ignored");
@@ -345,11 +307,9 @@
}
bool success = true;
- for (auto &[tag, entry] : aCamera->cameraMetadata) {
+ for (auto& [tag, entry] : aCamera->cameraMetadata) {
/* try to add new camera metadata entry */
- int32_t err = add_camera_metadata_entry(aCamera->characteristics,
- tag,
- entry.first.get(),
+ int32_t err = add_camera_metadata_entry(aCamera->characteristics, tag, entry.first.get(),
entry.second);
if (err) {
ALOGE("Failed to add an entry with a tag 0x%X", tag);
@@ -376,8 +336,7 @@
return success;
}
-
-void ConfigManager::readSystemInfo(const XMLElement * const aSysElem) {
+void ConfigManager::readSystemInfo(const XMLElement* const aSysElem) {
if (aSysElem == nullptr) {
return;
}
@@ -389,24 +348,22 @@
*/
/* read number of cameras available in the system */
- const XMLElement *xmlElem = aSysElem->FirstChildElement("num_cameras");
+ const XMLElement* xmlElem = aSysElem->FirstChildElement("num_cameras");
if (xmlElem != nullptr) {
- mSystemInfo.numCameras =
- stoi(xmlElem->FindAttribute("value")->Value());
+ mSystemInfo.numCameras = stoi(xmlElem->FindAttribute("value")->Value());
}
}
-
-void ConfigManager::readDisplayInfo(const XMLElement * const aDisplayElem) {
+void ConfigManager::readDisplayInfo(const XMLElement* const aDisplayElem) {
if (aDisplayElem == nullptr) {
ALOGW("XML file does not have required camera element");
return;
}
- const XMLElement *curDev = aDisplayElem->FirstChildElement("device");
+ const XMLElement* curDev = aDisplayElem->FirstChildElement("device");
while (curDev != nullptr) {
- const char *id = curDev->FindAttribute("id")->Value();
- //const char *pos = curDev->FirstAttribute("position")->Value();
+ const char* id = curDev->FindAttribute("id")->Value();
+ // const char *pos = curDev->FirstAttribute("position")->Value();
unique_ptr<DisplayInfo> dpy(new DisplayInfo());
if (dpy == nullptr) {
@@ -414,27 +371,26 @@
return;
}
- const XMLElement *cap = curDev->FirstChildElement("caps");
+ const XMLElement* cap = curDev->FirstChildElement("caps");
if (cap != nullptr) {
- const XMLElement *curStream = cap->FirstChildElement("stream");
+ const XMLElement* curStream = cap->FirstChildElement("stream");
while (curStream != nullptr) {
/* read 4 attributes */
- const XMLAttribute *idAttr = curStream->FindAttribute("id");
- const XMLAttribute *widthAttr = curStream->FindAttribute("width");
- const XMLAttribute *heightAttr = curStream->FindAttribute("height");
- const XMLAttribute *fmtAttr = curStream->FindAttribute("format");
+ const XMLAttribute* idAttr = curStream->FindAttribute("id");
+ const XMLAttribute* widthAttr = curStream->FindAttribute("width");
+ const XMLAttribute* heightAttr = curStream->FindAttribute("height");
+ const XMLAttribute* fmtAttr = curStream->FindAttribute("format");
const int32_t id = stoi(idAttr->Value());
int32_t pixFormat;
- if (ConfigManagerUtil::convertToPixelFormat(fmtAttr->Value(),
- pixFormat)) {
+ if (ConfigManagerUtil::convertToPixelFormat(fmtAttr->Value(), pixFormat)) {
RawStreamConfiguration cfg = {
- id,
- stoi(widthAttr->Value()),
- stoi(heightAttr->Value()),
- pixFormat,
- ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT,
- 0 // unused
+ id,
+ stoi(widthAttr->Value()),
+ stoi(heightAttr->Value()),
+ pixFormat,
+ ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT,
+ 0 // unused
};
dpy->streamConfigurations.insert_or_assign(id, cfg);
}
@@ -450,7 +406,6 @@
return;
}
-
bool ConfigManager::readConfigDataFromXML() noexcept {
XMLDocument xmlDoc;
@@ -464,7 +419,7 @@
}
/* retrieve the root element */
- const XMLElement *rootElem = xmlDoc.RootElement();
+ const XMLElement* rootElem = xmlDoc.RootElement();
if (strcmp(rootElem->Name(), "configuration")) {
ALOGE("A configuration file is not in the required format. "
"See /etc/automotive/evs/evs_configuration.dtd");
@@ -487,12 +442,10 @@
ALOGI("Parsing configuration file takes %lf (ms)",
(double)(parsingEnd - parsingStart) / 1000000.0);
-
return true;
}
-
-std::unique_ptr<ConfigManager> ConfigManager::Create(const char *path) {
+std::unique_ptr<ConfigManager> ConfigManager::Create(const char* path) {
unique_ptr<ConfigManager> cfgMgr(new ConfigManager(path));
/*
@@ -510,3 +463,4 @@
}
}
+} // namespace android::hardware::automotive::evs::V1_1::implementation
diff --git a/automotive/evs/1.1/default/ConfigManager.h b/automotive/evs/1.1/default/ConfigManager.h
index b0b2670..0a15360 100644
--- a/automotive/evs/1.1/default/ConfigManager.h
+++ b/automotive/evs/1.1/default/ConfigManager.h
@@ -13,28 +13,26 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef CONFIG_MANAGER_H
-#define CONFIG_MANAGER_H
-
-#include <vector>
-#include <string>
-#include <unordered_map>
-#include <unordered_set>
-
-#include <tinyxml2.h>
-
-#include <system/camera_metadata.h>
-#include <log/log.h>
-#include <android/hardware/automotive/evs/1.1/types.h>
+#ifndef ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_CONFIGMANAGER_H
+#define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_CONFIGMANAGER_H
#include "ConfigManagerUtil.h"
-using namespace std;
-using namespace tinyxml2;
+#include <android/hardware/automotive/evs/1.1/types.h>
+#include <log/log.h>
+#include <system/camera_metadata.h>
+#include <tinyxml2.h>
-using ::android::hardware::hidl_vec;
-using ::android::hardware::camera::device::V3_2::Stream;
-using ::android::hardware::automotive::evs::V1_1::CameraParam;
+#include <string>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+
+namespace android::hardware::automotive::evs::V1_1::implementation {
+
+using hardware::hidl_vec;
+using hardware::automotive::evs::V1_1::CameraParam;
+using hardware::camera::device::V3_2::Stream;
/*
* Plese note that this is different from what is defined in
@@ -45,8 +43,8 @@
typedef std::array<int32_t, kStreamCfgSz> RawStreamConfiguration;
class ConfigManager {
-public:
- static std::unique_ptr<ConfigManager> Create(const char *path = "");
+ public:
+ static std::unique_ptr<ConfigManager> Create(const char* path = "");
ConfigManager(const ConfigManager&) = delete;
ConfigManager& operator=(const ConfigManager&) = delete;
@@ -54,15 +52,11 @@
/* Camera device's capabilities and metadata */
class CameraInfo {
- public:
- CameraInfo() :
- characteristics(nullptr) {
- /* Nothing to do */
+ public:
+ CameraInfo() : characteristics(nullptr) { /* Nothing to do */
}
- virtual ~CameraInfo() {
- free_camera_metadata(characteristics);
- }
+ virtual ~CameraInfo() { free_camera_metadata(characteristics); }
/* Allocate memory for camera_metadata_t */
bool allocate(size_t entry_cap, size_t data_cap) {
@@ -79,50 +73,49 @@
* List of supported controls that the primary client can program.
* Paraemters are stored with its valid range
*/
- unordered_map<CameraParam,
- tuple<int32_t, int32_t, int32_t>> controls;
+ std::unordered_map<CameraParam, std::tuple<int32_t, int32_t, int32_t>> controls;
/*
* List of supported output stream configurations; each array stores
* format, width, height, and direction values in the order.
*/
- unordered_map<int32_t, RawStreamConfiguration> streamConfigurations;
+ std::unordered_map<int32_t, RawStreamConfiguration> streamConfigurations;
/*
* Internal storage for camera metadata. Each entry holds a pointer to
* data and number of elements
*/
- unordered_map<camera_metadata_tag_t,
- pair<unique_ptr<void *>, size_t>> cameraMetadata;
+ std::unordered_map<camera_metadata_tag_t, std::pair<std::unique_ptr<void*>, size_t>>
+ cameraMetadata;
/* Camera module characteristics */
- camera_metadata_t *characteristics;
+ camera_metadata_t* characteristics;
};
class CameraGroupInfo : public CameraInfo {
- public:
+ public:
CameraGroupInfo() {}
/* ID of member camera devices */
- unordered_set<string> devices;
+ std::unordered_set<std::string> devices;
/* The capture operation of member camera devices are synchronized */
bool synchronized = false;
};
class SystemInfo {
- public:
+ public:
/* number of available cameras */
int32_t numCameras = 0;
};
class DisplayInfo {
- public:
+ public:
/*
* List of supported input stream configurations; each array stores
* format, width, height, and direction values in the order.
*/
- unordered_map<int32_t, RawStreamConfiguration> streamConfigurations;
+ std::unordered_map<int32_t, RawStreamConfiguration> streamConfigurations;
};
/*
@@ -131,80 +124,74 @@
* @return SystemInfo
* Constant reference of SystemInfo.
*/
- const SystemInfo &getSystemInfo() {
- return mSystemInfo;
- }
+ const SystemInfo& getSystemInfo() { return mSystemInfo; }
/*
* Return a list of cameras
*
* This function assumes that it is not being called frequently.
*
- * @return vector<string>
+ * @return std::vector<std::string>
* A vector that contains unique camera device identifiers.
*/
- vector<string> getCameraList() {
- vector<string> aList;
- for (auto &v : mCameraInfo) {
- aList.emplace_back(v.first);
+ std::vector<std::string> getCameraList() {
+ std::vector<std::string> aList;
+ for (auto& v : mCameraInfo) {
+ aList.push_back(v.first);
}
return aList;
}
-
/*
* Return a list of cameras
*
* @return CameraGroupInfo
* A pointer to a camera group identified by a given id.
*/
- unique_ptr<CameraGroupInfo>& getCameraGroupInfo(const string& gid) {
+ std::unique_ptr<CameraGroupInfo>& getCameraGroupInfo(const std::string& gid) {
return mCameraGroupInfos[gid];
}
-
/*
* Return a camera metadata
*
* @param cameraId
- * Unique camera node identifier in string
+ * Unique camera node identifier in std::string
*
- * @return unique_ptr<CameraInfo>
+ * @return std::unique_ptr<CameraInfo>
* A pointer to CameraInfo that is associated with a given camera
* ID. This returns a null pointer if this does not recognize a
* given camera identifier.
*/
- unique_ptr<CameraInfo>& getCameraInfo(const string cameraId) noexcept {
+ std::unique_ptr<CameraInfo>& getCameraInfo(const std::string cameraId) noexcept {
return mCameraInfo[cameraId];
}
-private:
+ private:
/* Constructors */
- ConfigManager(const char *xmlPath) :
- mConfigFilePath(xmlPath) {
- }
+ ConfigManager(const char* xmlPath) : mConfigFilePath(xmlPath) {}
/* System configuration */
SystemInfo mSystemInfo;
/* Internal data structure for camera device information */
- unordered_map<string, unique_ptr<CameraInfo>> mCameraInfo;
+ std::unordered_map<std::string, std::unique_ptr<CameraInfo>> mCameraInfo;
/* Internal data structure for camera device information */
- unordered_map<string, unique_ptr<DisplayInfo>> mDisplayInfo;
+ std::unordered_map<std::string, std::unique_ptr<DisplayInfo>> mDisplayInfo;
/* Camera groups are stored in <groud id, CameraGroupInfo> hash map */
- unordered_map<string, unique_ptr<CameraGroupInfo>> mCameraGroupInfos;
+ std::unordered_map<std::string, std::unique_ptr<CameraGroupInfo>> mCameraGroupInfos;
/*
* Camera positions are stored in <position, camera id set> hash map.
* The position must be one of front, rear, left, and right.
*/
- unordered_map<string, unordered_set<string>> mCameraPosition;
+ std::unordered_map<std::string, std::unordered_set<std::string>> mCameraPosition;
/* A path to XML configuration file */
- const char *mConfigFilePath;
+ const char* mConfigFilePath;
/*
* Parse a given EVS configuration file and store the information
@@ -221,7 +208,7 @@
* @param aSysElem
* A pointer to "system" XML element.
*/
- void readSystemInfo(const XMLElement * const aSysElem);
+ void readSystemInfo(const tinyxml2::XMLElement* const aSysElem);
/*
* read the information of camera devices
@@ -230,7 +217,7 @@
* A pointer to "camera" XML element that may contain multiple
* "device" elements.
*/
- void readCameraInfo(const XMLElement * const aCameraElem);
+ void readCameraInfo(const tinyxml2::XMLElement* const aCameraElem);
/*
* read display device information
@@ -239,7 +226,7 @@
* A pointer to "display" XML element that may contain multiple
* "device" elements.
*/
- void readDisplayInfo(const XMLElement * const aDisplayElem);
+ void readDisplayInfo(const tinyxml2::XMLElement* const aDisplayElem);
/*
* read camera device information
@@ -255,8 +242,7 @@
* Return false upon any failure in reading and processing camera
* device information.
*/
- bool readCameraDeviceInfo(CameraInfo *aCamera,
- const XMLElement *aDeviceElem);
+ bool readCameraDeviceInfo(CameraInfo* aCamera, const tinyxml2::XMLElement* aDeviceElem);
/*
* read camera metadata
@@ -273,9 +259,8 @@
* @return size_t
* Number of camera metadata entries
*/
- size_t readCameraCapabilities(const XMLElement * const aCapElem,
- CameraInfo *aCamera,
- size_t &dataSize);
+ size_t readCameraCapabilities(const tinyxml2::XMLElement* const aCapElem, CameraInfo* aCamera,
+ size_t& dataSize);
/*
* read camera metadata
@@ -291,9 +276,8 @@
* @return size_t
* Number of camera metadata entries
*/
- size_t readCameraMetadata(const XMLElement * const aParamElem,
- CameraInfo *aCamera,
- size_t &dataSize);
+ size_t readCameraMetadata(const tinyxml2::XMLElement* const aParamElem, CameraInfo* aCamera,
+ size_t& dataSize);
/*
* construct camera_metadata_t from camera capabilities and metadata
@@ -310,9 +294,9 @@
* or its size is not large enough to add all found camera metadata
* entries.
*/
- bool constructCameraMetadata(CameraInfo *aCamera,
- const size_t totalEntries,
+ bool constructCameraMetadata(CameraInfo* aCamera, const size_t totalEntries,
const size_t totalDataSize);
};
-#endif // CONFIG_MANAGER_H
+} // namespace android::hardware::automotive::evs::V1_1::implementation
+#endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_CONFIGMANAGER_H
diff --git a/automotive/evs/1.1/default/ConfigManagerUtil.cpp b/automotive/evs/1.1/default/ConfigManagerUtil.cpp
index d10f236..5edd405 100644
--- a/automotive/evs/1.1/default/ConfigManagerUtil.cpp
+++ b/automotive/evs/1.1/default/ConfigManagerUtil.cpp
@@ -16,43 +16,45 @@
#include "ConfigManagerUtil.h"
-#include <string>
-#include <sstream>
-#include <linux/videodev2.h>
-
#include <log/log.h>
#include <system/graphics-base-v1.0.h>
+#include <linux/videodev2.h>
+#include <sstream>
+#include <string>
-bool ConfigManagerUtil::convertToEvsCameraParam(const string &id,
- CameraParam &camParam) {
+namespace android::hardware::automotive::evs::V1_1::implementation {
+
+using namespace std;
+
+bool ConfigManagerUtil::convertToEvsCameraParam(const string& id, CameraParam& camParam) {
string trimmed = ConfigManagerUtil::trimString(id);
bool success = true;
if (!trimmed.compare("BRIGHTNESS")) {
- camParam = CameraParam::BRIGHTNESS;
+ camParam = CameraParam::BRIGHTNESS;
} else if (!trimmed.compare("CONTRAST")) {
- camParam = CameraParam::CONTRAST;
+ camParam = CameraParam::CONTRAST;
} else if (!trimmed.compare("AUTOGAIN")) {
- camParam = CameraParam::AUTOGAIN;
+ camParam = CameraParam::AUTOGAIN;
} else if (!trimmed.compare("GAIN")) {
- camParam = CameraParam::GAIN;
+ camParam = CameraParam::GAIN;
} else if (!trimmed.compare("AUTO_WHITE_BALANCE")) {
- camParam = CameraParam::AUTO_WHITE_BALANCE;
+ camParam = CameraParam::AUTO_WHITE_BALANCE;
} else if (!trimmed.compare("WHITE_BALANCE_TEMPERATURE")) {
- camParam = CameraParam::WHITE_BALANCE_TEMPERATURE;
+ camParam = CameraParam::WHITE_BALANCE_TEMPERATURE;
} else if (!trimmed.compare("SHARPNESS")) {
- camParam = CameraParam::SHARPNESS;
+ camParam = CameraParam::SHARPNESS;
} else if (!trimmed.compare("AUTO_EXPOSURE")) {
- camParam = CameraParam::AUTO_EXPOSURE;
+ camParam = CameraParam::AUTO_EXPOSURE;
} else if (!trimmed.compare("ABSOLUTE_EXPOSURE")) {
- camParam = CameraParam::ABSOLUTE_EXPOSURE;
+ camParam = CameraParam::ABSOLUTE_EXPOSURE;
} else if (!trimmed.compare("ABSOLUTE_FOCUS")) {
- camParam = CameraParam::ABSOLUTE_FOCUS;
+ camParam = CameraParam::ABSOLUTE_FOCUS;
} else if (!trimmed.compare("AUTO_FOCUS")) {
- camParam = CameraParam::AUTO_FOCUS;
+ camParam = CameraParam::AUTO_FOCUS;
} else if (!trimmed.compare("ABSOLUTE_ZOOM")) {
- camParam = CameraParam::ABSOLUTE_ZOOM;
+ camParam = CameraParam::ABSOLUTE_ZOOM;
} else {
success = false;
}
@@ -60,18 +62,16 @@
return success;
}
-
-bool ConfigManagerUtil::convertToPixelFormat(const string &format,
- int32_t &pixFormat) {
+bool ConfigManagerUtil::convertToPixelFormat(const string& format, int32_t& pixFormat) {
string trimmed = ConfigManagerUtil::trimString(format);
bool success = true;
if (!trimmed.compare("RGBA_8888")) {
- pixFormat = HAL_PIXEL_FORMAT_RGBA_8888;
+ pixFormat = HAL_PIXEL_FORMAT_RGBA_8888;
} else if (!trimmed.compare("YCRCB_420_SP")) {
- pixFormat = HAL_PIXEL_FORMAT_YCRCB_420_SP;
+ pixFormat = HAL_PIXEL_FORMAT_YCRCB_420_SP;
} else if (!trimmed.compare("YCBCR_422_I")) {
- pixFormat = HAL_PIXEL_FORMAT_YCBCR_422_I;
+ pixFormat = HAL_PIXEL_FORMAT_YCBCR_422_I;
} else {
success = false;
}
@@ -79,21 +79,19 @@
return success;
}
-
-bool ConfigManagerUtil::convertToMetadataTag(const char *name,
- camera_metadata_tag &aTag) {
+bool ConfigManagerUtil::convertToMetadataTag(const char* name, camera_metadata_tag& aTag) {
if (!strcmp(name, "LENS_DISTORTION")) {
- aTag = ANDROID_LENS_DISTORTION;
+ aTag = ANDROID_LENS_DISTORTION;
} else if (!strcmp(name, "LENS_INTRINSIC_CALIBRATION")) {
- aTag = ANDROID_LENS_INTRINSIC_CALIBRATION;
+ aTag = ANDROID_LENS_INTRINSIC_CALIBRATION;
} else if (!strcmp(name, "LENS_POSE_ROTATION")) {
- aTag = ANDROID_LENS_POSE_ROTATION;
+ aTag = ANDROID_LENS_POSE_ROTATION;
} else if (!strcmp(name, "LENS_POSE_TRANSLATION")) {
- aTag = ANDROID_LENS_POSE_TRANSLATION;
+ aTag = ANDROID_LENS_POSE_TRANSLATION;
} else if (!strcmp(name, "REQUEST_AVAILABLE_CAPABILITIES")) {
- aTag = ANDROID_REQUEST_AVAILABLE_CAPABILITIES;
+ aTag = ANDROID_REQUEST_AVAILABLE_CAPABILITIES;
} else if (!strcmp(name, "LOGICAL_MULTI_CAMERA_PHYSICAL_IDS")) {
- aTag = ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS;
+ aTag = ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS;
} else {
return false;
}
@@ -101,11 +99,8 @@
return true;
}
-
bool ConfigManagerUtil::convertToCameraCapability(
- const char *name,
- camera_metadata_enum_android_request_available_capabilities_t &cap) {
-
+ const char* name, camera_metadata_enum_android_request_available_capabilities_t& cap) {
if (!strcmp(name, "DEPTH_OUTPUT")) {
cap = ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT;
} else if (!strcmp(name, "LOGICAL_MULTI_CAMERA")) {
@@ -121,14 +116,13 @@
return true;
}
-
-float *ConfigManagerUtil::convertFloatArray(const char *sz, const char *vals,
- size_t &count, const char delimiter) {
+float* ConfigManagerUtil::convertFloatArray(const char* sz, const char* vals, size_t& count,
+ const char delimiter) {
string size_string(sz);
string value_string(vals);
count = stoi(size_string);
- float *result = new float[count];
+ float* result = new float[count];
stringstream values(value_string);
int32_t idx = 0;
@@ -140,8 +134,7 @@
return result;
}
-
-string ConfigManagerUtil::trimString(const string &src, const string &ws) {
+string ConfigManagerUtil::trimString(const string& src, const string& ws) {
const auto s = src.find_first_not_of(ws);
if (s == string::npos) {
return "";
@@ -153,3 +146,4 @@
return src.substr(s, r);
}
+} // namespace android::hardware::automotive::evs::V1_1::implementation
diff --git a/automotive/evs/1.1/default/ConfigManagerUtil.h b/automotive/evs/1.1/default/ConfigManagerUtil.h
index 1710cac..9d42ec1 100644
--- a/automotive/evs/1.1/default/ConfigManagerUtil.h
+++ b/automotive/evs/1.1/default/ConfigManagerUtil.h
@@ -13,57 +13,48 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef CONFIG_MANAGER_UTIL_H
-#define CONFIG_MANAGER_UTIL_H
+#ifndef ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_CONFIGMANAGERUTIL_H
+#define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_CONFIGMANAGERUTIL_H
-#include <utility>
-#include <string>
-#include <system/camera_metadata.h>
#include <android/hardware/automotive/evs/1.1/types.h>
+#include <system/camera_metadata.h>
+#include <string>
+#include <utility>
-using namespace std;
-using ::android::hardware::automotive::evs::V1_1::CameraParam;
-
+namespace android::hardware::automotive::evs::V1_1::implementation {
class ConfigManagerUtil {
-public:
+ public:
/**
* Convert a given string into V4L2_CID_*
*/
- static bool convertToEvsCameraParam(const string &id,
- CameraParam &camParam);
+ static bool convertToEvsCameraParam(const std::string& id, CameraParam& camParam);
/**
* Convert a given string into android.hardware.graphics.common.PixelFormat
*/
- static bool convertToPixelFormat(const string &format,
- int32_t &pixelFormat);
+ static bool convertToPixelFormat(const std::string& format, int32_t& pixelFormat);
/**
* Convert a given string into corresponding camera metadata data tag defined in
* system/media/camera/include/system/camera_metadta_tags.h
*/
- static bool convertToMetadataTag(const char *name,
- camera_metadata_tag &aTag);
+ static bool convertToMetadataTag(const char* name, camera_metadata_tag& aTag);
/**
* Convert a given string into a floating value array
*/
- static float *convertFloatArray(const char *sz,
- const char *vals,
- size_t &count,
+ static float* convertFloatArray(const char* sz, const char* vals, size_t& count,
const char delimiter = ',');
/**
* Trim a string
*/
- static string trimString(const string &src,
- const string &ws = " \n\r\t\f\v");
+ static std::string trimString(const std::string& src, const std::string& ws = " \n\r\t\f\v");
/**
* Convert a given string to corresponding camera capabilities
*/
static bool convertToCameraCapability(
- const char *name,
- camera_metadata_enum_android_request_available_capabilities_t &cap);
-
+ const char* name, camera_metadata_enum_android_request_available_capabilities_t& cap);
};
-#endif // CONFIG_MANAGER_UTIL_H
+} // namespace android::hardware::automotive::evs::V1_1::implementation
+#endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_CONFIGMANAGERUTIL_H
diff --git a/automotive/evs/1.1/default/EvsCamera.cpp b/automotive/evs/1.1/default/EvsCamera.cpp
index 0e69ed4..520670a 100644
--- a/automotive/evs/1.1/default/EvsCamera.cpp
+++ b/automotive/evs/1.1/default/EvsCamera.cpp
@@ -14,69 +14,69 @@
* limitations under the License.
*/
-#define LOG_TAG "android.hardware.automotive.evs@1.1-service"
-
#include "EvsCamera.h"
+#include "ConfigManager.h"
#include "EvsEnumerator.h"
#include <ui/GraphicBufferAllocator.h>
#include <ui/GraphicBufferMapper.h>
#include <utils/SystemClock.h>
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace evs {
-namespace V1_1 {
-namespace implementation {
-
-
-// Special camera names for which we'll initialize alternate test data
-const char EvsCamera::kCameraName_Backup[] = "backup";
-
+namespace {
// Arbitrary limit on number of graphics buffers allowed to be allocated
// Safeguards against unreasonable resource consumption and provides a testable limit
-const unsigned MAX_BUFFERS_IN_FLIGHT = 100;
+constexpr unsigned kMaxBuffersInFlight = 100;
+// Minimum number of buffers to run a video stream
+constexpr int kMinimumBuffersInFlight = 1;
-EvsCamera::EvsCamera(const char *id,
- unique_ptr<ConfigManager::CameraInfo> &camInfo) :
- mFramesAllowed(0),
- mFramesInUse(0),
- mStreamState(STOPPED),
- mCameraInfo(camInfo) {
+// Colors for the colorbar test pattern in ABGR format
+constexpr uint32_t kColors[] = {
+ 0xFFFFFFFF, // white
+ 0xFF00FFFF, // yellow
+ 0xFFFFFF00, // cyan
+ 0xFF00FF00, // green
+ 0xFFFF00FF, // fuchsia
+ 0xFF0000FF, // red
+ 0xFFFF0000, // blue
+ 0xFF000000, // black
+};
+constexpr uint32_t kNumColors = sizeof(kColors) / sizeof(kColors[0]);
- ALOGD("EvsCamera instantiated");
+} // namespace
+
+namespace android::hardware::automotive::evs::V1_1::implementation {
+
+using V1_0::EvsResult;
+
+EvsCamera::EvsCamera(const char* id, std::unique_ptr<ConfigManager::CameraInfo>& camInfo)
+ : mFramesAllowed(0), mFramesInUse(0), mStreamState(STOPPED), mCameraInfo(camInfo) {
+ ALOGD("%s", __FUNCTION__);
/* set a camera id */
mDescription.v1.cameraId = id;
/* set camera metadata */
- mDescription.metadata.setToExternal((uint8_t *)camInfo->characteristics,
+ mDescription.metadata.setToExternal((uint8_t*)camInfo->characteristics,
get_camera_metadata_size(camInfo->characteristics));
}
-
EvsCamera::~EvsCamera() {
- ALOGD("EvsCamera being destroyed");
+ ALOGD("%s", __FUNCTION__);
forceShutdown();
}
-
-//
// This gets called if another caller "steals" ownership of the camera
-//
-void EvsCamera::forceShutdown()
-{
- ALOGD("EvsCamera forceShutdown");
+void EvsCamera::forceShutdown() {
+ ALOGD("%s", __FUNCTION__);
// Make sure our output stream is cleaned up
// (It really should be already)
stopVideoStream();
// Claim the lock while we work on internal state
- std::lock_guard <std::mutex> lock(mAccessLock);
+ std::lock_guard<std::mutex> lock(mAccessLock);
// Drop all the graphics buffers we've been using
if (mBuffers.size() > 0) {
@@ -96,19 +96,18 @@
mStreamState = DEAD;
}
-
// Methods from ::android::hardware::automotive::evs::V1_0::IEvsCamera follow.
Return<void> EvsCamera::getCameraInfo(getCameraInfo_cb _hidl_cb) {
- ALOGD("getCameraInfo");
+ ALOGD("%s", __FUNCTION__);
// Send back our self description
_hidl_cb(mDescription.v1);
- return Void();
+ return {};
}
-
Return<EvsResult> EvsCamera::setMaxFramesInFlight(uint32_t bufferCount) {
- ALOGD("setMaxFramesInFlight");
+ ALOGD("%s, bufferCount = %u", __FUNCTION__, bufferCount);
+
std::lock_guard<std::mutex> lock(mAccessLock);
// If we've been displaced by another owner of the camera, then we can't do anything else
@@ -131,9 +130,9 @@
}
}
+Return<EvsResult> EvsCamera::startVideoStream(const ::android::sp<V1_0::IEvsCameraStream>& stream) {
+ ALOGD("%s", __FUNCTION__);
-Return<EvsResult> EvsCamera::startVideoStream(const ::android::sp<IEvsCameraStream_1_0>& stream) {
- ALOGD("startVideoStream");
std::lock_guard<std::mutex> lock(mAccessLock);
// If we've been displaced by another owner of the camera, then we can't do anything else
@@ -141,82 +140,86 @@
ALOGE("ignoring startVideoStream call when camera has been lost.");
return EvsResult::OWNERSHIP_LOST;
}
+
if (mStreamState != STOPPED) {
ALOGE("ignoring startVideoStream call when a stream is already running.");
return EvsResult::STREAM_ALREADY_RUNNING;
}
// If the client never indicated otherwise, configure ourselves for a single streaming buffer
- if (mFramesAllowed < 1) {
- if (!setAvailableFrames_Locked(1)) {
+ if (mFramesAllowed < kMinimumBuffersInFlight) {
+ if (!setAvailableFrames_Locked(kMinimumBuffersInFlight)) {
ALOGE("Failed to start stream because we couldn't get a graphics buffer");
return EvsResult::BUFFER_NOT_AVAILABLE;
}
}
// Record the user's callback for use when we have a frame ready
- mStream = IEvsCameraStream_1_1::castFrom(stream).withDefault(nullptr);
- if (mStream == nullptr) {
+ mStream = IEvsCameraStream::castFrom(stream).withDefault(nullptr);
+ if (!mStream) {
ALOGE("Default implementation does not support v1.0 IEvsCameraStream");
return EvsResult::INVALID_ARG;
}
// Start the frame generation thread
mStreamState = RUNNING;
- mCaptureThread = std::thread([this](){ generateFrames(); });
+ mCaptureThread = std::thread([this]() { generateFrames(); });
return EvsResult::OK;
}
-
-Return<void> EvsCamera::doneWithFrame(const BufferDesc_1_0& buffer) {
- std::lock_guard <std::mutex> lock(mAccessLock);
- returnBuffer(buffer.bufferId, buffer.memHandle);
-
- return Void();
-}
-
-
-Return<void> EvsCamera::stopVideoStream() {
- ALOGD("stopVideoStream");
- std::unique_lock <std::mutex> lock(mAccessLock);
-
- if (mStreamState == RUNNING) {
- // Tell the GenerateFrames loop we want it to stop
- mStreamState = STOPPING;
-
- // Block outside the mutex until the "stop" flag has been acknowledged
- // We won't send any more frames, but the client might still get some already in flight
- ALOGD("Waiting for stream thread to end...");
- lock.unlock();
- mCaptureThread.join();
- lock.lock();
-
- mStreamState = STOPPED;
- mStream = nullptr;
- ALOGD("Stream marked STOPPED.");
- }
-
- return Void();
-}
-
-
-Return<int32_t> EvsCamera::getExtendedInfo(uint32_t opaqueIdentifier) {
- ALOGD("getExtendedInfo");
+Return<void> EvsCamera::doneWithFrame(const V1_0::BufferDesc& buffer) {
std::lock_guard<std::mutex> lock(mAccessLock);
+ returnBufferLocked(buffer.bufferId, buffer.memHandle);
- // For any single digit value, return the index itself as a test value
- if (opaqueIdentifier <= 9) {
- return opaqueIdentifier;
- }
-
- // Return zero by default as required by the spec
- return 0;
+ return {};
}
+Return<void> EvsCamera::stopVideoStream() {
+ ALOGD("%s", __FUNCTION__);
-Return<EvsResult> EvsCamera::setExtendedInfo(uint32_t /*opaqueIdentifier*/, int32_t /*opaqueValue*/) {
- ALOGD("setExtendedInfo");
+ std::unique_lock<std::mutex> lock(mAccessLock);
+
+ if (mStreamState != RUNNING) {
+ return {};
+ }
+
+ // Tell the GenerateFrames loop we want it to stop
+ mStreamState = STOPPING;
+
+ // Block outside the mutex until the "stop" flag has been acknowledged
+ // We won't send any more frames, but the client might still get some already in flight
+ ALOGD("Waiting for stream thread to end...");
+ lock.unlock();
+ if (mCaptureThread.joinable()) {
+ mCaptureThread.join();
+ }
+ lock.lock();
+
+ mStreamState = STOPPED;
+ mStream = nullptr;
+ ALOGD("Stream marked STOPPED.");
+
+ return {};
+}
+
+Return<int32_t> EvsCamera::getExtendedInfo(uint32_t opaqueIdentifier) {
+ ALOGD("%s", __FUNCTION__);
+
+ std::lock_guard<std::mutex> lock(mAccessLock);
+ const auto it = mExtInfo.find(opaqueIdentifier);
+ if (it == mExtInfo.end()) {
+ // Return zero by default as required by the spec
+ return 0;
+ } else {
+ return it->second[0];
+ }
+}
+
+Return<EvsResult> EvsCamera::setExtendedInfo([[maybe_unused]] uint32_t opaqueIdentifier,
+ [[maybe_unused]] int32_t opaqueValue) {
+ ALOGD("%s", __FUNCTION__);
+
std::lock_guard<std::mutex> lock(mAccessLock);
// If we've been displaced by another owner of the camera, then we can't do anything else
@@ -225,76 +228,73 @@
return EvsResult::OWNERSHIP_LOST;
}
- // We don't store any device specific information in this implementation
- return EvsResult::INVALID_ARG;
+ mExtInfo.insert_or_assign(opaqueIdentifier, opaqueValue);
+ return EvsResult::OK;
}
-
// Methods from ::android::hardware::automotive::evs::V1_1::IEvsCamera follow.
Return<void> EvsCamera::getCameraInfo_1_1(getCameraInfo_1_1_cb _hidl_cb) {
- ALOGD("getCameraInfo_1_1");
+ ALOGD("%s", __FUNCTION__);
// Send back our self description
_hidl_cb(mDescription);
- return Void();
+ return {};
}
-
-Return<void> EvsCamera::getPhysicalCameraInfo(const hidl_string& id,
+Return<void> EvsCamera::getPhysicalCameraInfo([[maybe_unused]] const hidl_string& id,
getCameraInfo_1_1_cb _hidl_cb) {
ALOGD("%s", __FUNCTION__);
// This works exactly same as getCameraInfo_1_1() in default implementation.
- (void)id;
_hidl_cb(mDescription);
- return Void();
+ return {};
}
+Return<EvsResult> EvsCamera::doneWithFrame_1_1(const hidl_vec<BufferDesc>& buffers) {
+ ALOGD("%s", __FUNCTION__);
-Return<EvsResult> EvsCamera::doneWithFrame_1_1(const hidl_vec<BufferDesc_1_1>& buffers) {
- std::lock_guard <std::mutex> lock(mAccessLock);
-
+ std::lock_guard<std::mutex> lock(mAccessLock);
for (auto&& buffer : buffers) {
- returnBuffer(buffer.bufferId, buffer.buffer.nativeHandle);
+ returnBufferLocked(buffer.bufferId, buffer.buffer.nativeHandle);
}
-
return EvsResult::OK;
}
-
Return<EvsResult> EvsCamera::pauseVideoStream() {
+ ALOGD("%s", __FUNCTION__);
// Default implementation does not support this.
return EvsResult::UNDERLYING_SERVICE_ERROR;
}
-
Return<EvsResult> EvsCamera::resumeVideoStream() {
+ ALOGD("%s", __FUNCTION__);
// Default implementation does not support this.
return EvsResult::UNDERLYING_SERVICE_ERROR;
}
-
Return<EvsResult> EvsCamera::setMaster() {
+ ALOGD("%s", __FUNCTION__);
// Default implementation does not expect multiple subscribers and therefore
// return a success code always.
return EvsResult::OK;
}
-Return<EvsResult> EvsCamera::forceMaster(const sp<IEvsDisplay_1_0>& ) {
+Return<EvsResult> EvsCamera::forceMaster(const sp<V1_0::IEvsDisplay>&) {
+ ALOGD("%s", __FUNCTION__);
// Default implementation does not expect multiple subscribers and therefore
// return a success code always.
return EvsResult::OK;
}
-
Return<EvsResult> EvsCamera::unsetMaster() {
+ ALOGD("%s", __FUNCTION__);
// Default implementation does not expect multiple subscribers and therefore
// return a success code always.
return EvsResult::OK;
}
-
Return<void> EvsCamera::getParameterList(getParameterList_cb _hidl_cb) {
+ ALOGD("%s", __FUNCTION__);
hidl_vec<CameraParam> hidlCtrls;
hidlCtrls.resize(mCameraInfo->controls.size());
unsigned idx = 0;
@@ -303,72 +303,132 @@
}
_hidl_cb(hidlCtrls);
- return Void();
-}
-
-
-Return<void> EvsCamera::getIntParameterRange(CameraParam id,
- getIntParameterRange_cb _hidl_cb) {
- auto range = mCameraInfo->controls[id];
- _hidl_cb(get<0>(range), get<1>(range), get<2>(range));
- return Void();
-}
-
-
-Return<void> EvsCamera::setIntParameter(CameraParam id, int32_t value,
- setIntParameter_cb _hidl_cb) {
- // Default implementation does not support this.
- (void)id;
- (void)value;
- _hidl_cb(EvsResult::INVALID_ARG, 0);
- return Void();
-}
-
-
-Return<void> EvsCamera::getIntParameter(CameraParam id,
- getIntParameter_cb _hidl_cb) {
- // Default implementation does not support this.
- (void)id;
- _hidl_cb(EvsResult::INVALID_ARG, 0);
- return Void();
-}
-
-
-Return<EvsResult> EvsCamera::setExtendedInfo_1_1(uint32_t opaqueIdentifier,
- const hidl_vec<uint8_t>& opaqueValue) {
- // Default implementation does not use an extended info.
- (void)opaqueIdentifier;
- (void)opaqueValue;
- return EvsResult::INVALID_ARG;
-}
-
-
-Return<void> EvsCamera::getExtendedInfo_1_1(uint32_t opaqueIdentifier,
- getExtendedInfo_1_1_cb _hidl_cb) {
- // Default implementation does not use an extended info.
- (void)opaqueIdentifier;
-
- hidl_vec<uint8_t> value;
- _hidl_cb(EvsResult::INVALID_ARG, value);
- return Void();
-}
-
-
-Return<void>
-EvsCamera::importExternalBuffers(const hidl_vec<BufferDesc_1_1>& /* buffers */,
- importExternalBuffers_cb _hidl_cb) {
- ALOGW("%s is not implemented yet.", __FUNCTION__);
- _hidl_cb(EvsResult::UNDERLYING_SERVICE_ERROR, 0);
return {};
}
+Return<void> EvsCamera::getIntParameterRange(CameraParam id, getIntParameterRange_cb _hidl_cb) {
+ ALOGD("%s", __FUNCTION__);
+ auto it = mCameraInfo->controls.find(id);
+ if (it == mCameraInfo->controls.end()) {
+ _hidl_cb(0, 0, 0);
+ } else {
+ _hidl_cb(std::get<0>(it->second), std::get<1>(it->second), std::get<2>(it->second));
+ }
+ return {};
+}
+
+Return<void> EvsCamera::setIntParameter(CameraParam id, int32_t value,
+ setIntParameter_cb _hidl_cb) {
+ ALOGD("%s", __FUNCTION__);
+ mParams.insert_or_assign(id, value);
+ _hidl_cb(EvsResult::OK, {value});
+ return {};
+}
+
+Return<void> EvsCamera::getIntParameter([[maybe_unused]] CameraParam id,
+ getIntParameter_cb _hidl_cb) {
+ ALOGD("%s", __FUNCTION__);
+ auto it = mParams.find(id);
+ std::vector<int32_t> values;
+ if (it == mParams.end()) {
+ _hidl_cb(EvsResult::INVALID_ARG, values);
+ } else {
+ values.push_back(it->second);
+ _hidl_cb(EvsResult::OK, values);
+ }
+ return {};
+}
+
+Return<EvsResult> EvsCamera::setExtendedInfo_1_1(uint32_t opaqueIdentifier,
+ const hidl_vec<uint8_t>& opaqueValue) {
+ ALOGD("%s", __FUNCTION__);
+ mExtInfo.insert_or_assign(opaqueIdentifier, opaqueValue);
+ return EvsResult::OK;
+}
+
+Return<void> EvsCamera::getExtendedInfo_1_1(uint32_t opaqueIdentifier,
+ getExtendedInfo_1_1_cb _hidl_cb) {
+ ALOGD("%s", __FUNCTION__);
+ auto status = EvsResult::OK;
+ hidl_vec<uint8_t> value;
+ const auto it = mExtInfo.find(opaqueIdentifier);
+ if (it == mExtInfo.end()) {
+ status = EvsResult::INVALID_ARG;
+ } else {
+ value = it->second;
+ }
+ _hidl_cb(status, value);
+ return {};
+}
+
+Return<void> EvsCamera::importExternalBuffers([[maybe_unused]] const hidl_vec<BufferDesc>& buffers,
+ importExternalBuffers_cb _hidl_cb) {
+ auto numBuffersToAdd = buffers.size();
+ if (numBuffersToAdd < 1) {
+ ALOGD("No buffers to add");
+ _hidl_cb(EvsResult::OK, mFramesAllowed);
+ return {};
+ }
+
+ {
+ std::scoped_lock<std::mutex> lock(mAccessLock);
+
+ if (numBuffersToAdd > (kMaxBuffersInFlight - mFramesAllowed)) {
+ numBuffersToAdd -= (kMaxBuffersInFlight - mFramesAllowed);
+ ALOGW("Exceed the limit on number of buffers. %" PRIu64 " buffers will be added only.",
+ static_cast<uint64_t>(numBuffersToAdd));
+ }
+
+ GraphicBufferMapper& mapper = GraphicBufferMapper::get();
+ const auto before = mFramesAllowed;
+ for (auto i = 0; i < numBuffersToAdd; ++i) {
+ // TODO: reject if external buffer is configured differently.
+ auto& b = buffers[i];
+ const AHardwareBuffer_Desc* pDesc =
+ reinterpret_cast<const AHardwareBuffer_Desc*>(&b.buffer.description);
+
+ // Import a buffer to add
+ buffer_handle_t memHandle = nullptr;
+ status_t result =
+ mapper.importBuffer(b.buffer.nativeHandle, pDesc->width, pDesc->height, 1,
+ pDesc->format, pDesc->usage, pDesc->stride, &memHandle);
+ if (result != android::NO_ERROR || !memHandle) {
+ ALOGW("Failed to import a buffer %d", b.bufferId);
+ continue;
+ }
+
+ auto stored = false;
+ for (auto&& rec : mBuffers) {
+ if (rec.handle == nullptr) {
+ // Use this existing entry
+ rec.handle = memHandle;
+ rec.inUse = false;
+
+ stored = true;
+ break;
+ }
+ }
+
+ if (!stored) {
+ // Add a BufferRecord wrapping this handle to our set of available buffers
+ mBuffers.emplace_back(memHandle);
+ }
+
+ ++mFramesAllowed;
+ }
+
+ _hidl_cb(EvsResult::OK, mFramesAllowed - before);
+ return {};
+ }
+}
bool EvsCamera::setAvailableFrames_Locked(unsigned bufferCount) {
- if (bufferCount < 1) {
- ALOGE("Ignoring request to set buffer count to zero");
+ if (bufferCount < kMinimumBuffersInFlight) {
+ ALOGE("Ignoring request to set buffer count below the minimum number of buffers to run a "
+ "video stream");
return false;
}
- if (bufferCount > MAX_BUFFERS_IN_FLIGHT) {
+ if (bufferCount > kMaxBuffersInFlight) {
ALOGE("Rejecting buffer request in excess of internal limit");
return false;
}
@@ -403,17 +463,16 @@
return true;
}
-
unsigned EvsCamera::increaseAvailableFrames_Locked(unsigned numToAdd) {
// Acquire the graphics buffer allocator
- GraphicBufferAllocator &alloc(GraphicBufferAllocator::get());
+ GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
unsigned added = 0;
while (added < numToAdd) {
buffer_handle_t memHandle = nullptr;
- status_t result = alloc.allocate(mWidth, mHeight, mFormat, 1, mUsage,
- &memHandle, &mStride, 0, "EvsCamera");
+ status_t result = alloc.allocate(mWidth, mHeight, mFormat, 1, mUsage, &memHandle, &mStride,
+ 0, "EvsCamera");
if (result != NO_ERROR) {
ALOGE("Error %d allocating %d x %d graphics buffer", result, mWidth, mHeight);
break;
@@ -436,7 +495,7 @@
}
if (!stored) {
// Add a BufferRecord wrapping this handle to our set of available buffers
- mBuffers.emplace_back(memHandle);
+ mBuffers.push_back(std::move(BufferRecord(memHandle)));
}
mFramesAllowed++;
@@ -446,10 +505,9 @@
return added;
}
-
unsigned EvsCamera::decreaseAvailableFrames_Locked(unsigned numToRemove) {
// Acquire the graphics buffer allocator
- GraphicBufferAllocator &alloc(GraphicBufferAllocator::get());
+ GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
unsigned removed = 0;
@@ -472,14 +530,12 @@
return removed;
}
-
// This is the asynchronous frame generation thread that runs in parallel with the
// main serving thread. There is one for each active camera instance.
void EvsCamera::generateFrames() {
ALOGD("Frame generation loop started");
unsigned idx;
-
while (true) {
bool timeForFrame = false;
nsecs_t startTime = systemTime(SYSTEM_TIME_MONOTONIC);
@@ -521,9 +577,9 @@
if (timeForFrame) {
// Assemble the buffer description we'll transmit below
- BufferDesc_1_1 newBuffer = {};
+ BufferDesc newBuffer = {};
AHardwareBuffer_Desc* pDesc =
- reinterpret_cast<AHardwareBuffer_Desc *>(&newBuffer.buffer.description);
+ reinterpret_cast<AHardwareBuffer_Desc*>(&newBuffer.buffer.description);
pDesc->width = mWidth;
pDesc->height = mHeight;
pDesc->layers = 1;
@@ -534,19 +590,16 @@
newBuffer.pixelSize = sizeof(uint32_t);
newBuffer.bufferId = idx;
newBuffer.deviceId = mDescription.v1.cameraId;
- newBuffer.timestamp = elapsedRealtimeNano();
+ newBuffer.timestamp = elapsedRealtimeNano() * 1e+3; // timestamps is in microseconds
// Write test data into the image buffer
fillTestFrame(newBuffer);
// Issue the (asynchronous) callback to the client -- can't be holding the lock
- hidl_vec<BufferDesc_1_1> frames;
- frames.resize(1);
- frames[0] = newBuffer;
- auto result = mStream->deliverFrame_1_1(frames);
+ auto result = mStream->deliverFrame_1_1({newBuffer});
if (result.isOk()) {
- ALOGD("Delivered %p as id %d",
- newBuffer.buffer.nativeHandle.getNativeHandle(), newBuffer.bufferId);
+ ALOGD("Delivered %p as id %d", newBuffer.buffer.nativeHandle.getNativeHandle(),
+ newBuffer.bufferId);
} else {
// This can happen if the client dies and is likely unrecoverable.
// To avoid consuming resources generating failing calls, we stop sending
@@ -563,63 +616,50 @@
}
}
- // We arbitrarily choose to generate frames at 12 fps to ensure we pass the 10fps test requirement
- static const int kTargetFrameRate = 12;
- static const nsecs_t kTargetFrameTimeUs = 1000*1000 / kTargetFrameRate;
+ // We arbitrarily choose to generate frames at 15 fps to ensure we pass the 10fps test
+ // requirement
+ static const int kTargetFrameRate = 15;
+ static const nsecs_t kTargetFrameIntervalUs = 1000 * 1000 / kTargetFrameRate;
const nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
- const nsecs_t workTimeUs = (now - startTime) / 1000;
- const nsecs_t sleepDurationUs = kTargetFrameTimeUs - workTimeUs;
+ const nsecs_t elapsedTimeUs = (now - startTime) / 1000;
+ const nsecs_t sleepDurationUs = kTargetFrameIntervalUs - elapsedTimeUs;
if (sleepDurationUs > 0) {
usleep(sleepDurationUs);
}
}
// If we've been asked to stop, send an event to signal the actual end of stream
- EvsEventDesc event;
- event.aType = EvsEventType::STREAM_STOPPED;
- auto result = mStream->notify(event);
- if (!result.isOk()) {
+ EvsEventDesc event = {
+ .aType = EvsEventType::STREAM_STOPPED,
+ };
+ if (!mStream->notify(event).isOk()) {
ALOGE("Error delivering end of stream marker");
}
return;
}
-
-void EvsCamera::fillTestFrame(const BufferDesc_1_1& buff) {
+void EvsCamera::fillTestFrame(const BufferDesc& buff) {
// Lock our output buffer for writing
- uint32_t *pixels = nullptr;
+ uint32_t* pixels = nullptr;
const AHardwareBuffer_Desc* pDesc =
- reinterpret_cast<const AHardwareBuffer_Desc *>(&buff.buffer.description);
- GraphicBufferMapper &mapper = GraphicBufferMapper::get();
+ reinterpret_cast<const AHardwareBuffer_Desc*>(&buff.buffer.description);
+ GraphicBufferMapper& mapper = GraphicBufferMapper::get();
mapper.lock(buff.buffer.nativeHandle,
GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_NEVER,
- android::Rect(pDesc->width, pDesc->height),
- (void **) &pixels);
+ android::Rect(pDesc->width, pDesc->height), (void**)&pixels);
// If we failed to lock the pixel buffer, we're about to crash, but log it first
if (!pixels) {
ALOGE("Camera failed to gain access to image buffer for writing");
+ return;
}
- // Fill in the test pixels
+ // Fill in the test pixels; the colorbar in ABGR format
for (unsigned row = 0; row < pDesc->height; row++) {
for (unsigned col = 0; col < pDesc->width; col++) {
- // Index into the row to check the pixel at this column.
- // We expect 0xFF in the LSB channel, a vertical gradient in the
- // second channel, a horitzontal gradient in the third channel, and
- // 0xFF in the MSB.
- // The exception is the very first 32 bits which is used for the
- // time varying frame signature to avoid getting fooled by a static image.
- uint32_t expectedPixel = 0xFF0000FF | // MSB and LSB
- ((row & 0xFF) << 8) | // vertical gradient
- ((col & 0xFF) << 16); // horizontal gradient
- if ((row | col) == 0) {
- static uint32_t sFrameTicker = 0;
- expectedPixel = (sFrameTicker) & 0xFF;
- sFrameTicker++;
- }
- pixels[col] = expectedPixel;
+ const uint32_t index = col * kNumColors / pDesc->width;
+ pixels[col] = kColors[index];
}
// Point to the next row
// NOTE: stride retrieved from gralloc is in units of pixels
@@ -630,39 +670,35 @@
mapper.unlock(buff.buffer.nativeHandle);
}
-
-void EvsCamera::fillTestFrame(const BufferDesc_1_0& buff) {
- BufferDesc_1_1 newBufDesc = {};
- AHardwareBuffer_Desc desc = {
- buff.width, // width
- buff.height, // height
- 1, // layers, always 1 for EVS
- buff.format, // One of AHardwareBuffer_Format
- buff.usage, // Combination of AHardwareBuffer_UsageFlags
- buff.stride, // Row stride in pixels
- 0, // Reserved
- 0 // Reserved
+void EvsCamera::fillTestFrame(const V1_0::BufferDesc& buff) {
+ BufferDesc newBuffer = {
+ .buffer.nativeHandle = buff.memHandle,
+ .pixelSize = buff.pixelSize,
+ .bufferId = buff.bufferId,
};
- memcpy(&desc, &newBufDesc.buffer.description, sizeof(desc));
- newBufDesc.buffer.nativeHandle = buff.memHandle;
- newBufDesc.pixelSize = buff.pixelSize;
- newBufDesc.bufferId = buff.bufferId;
-
- return fillTestFrame(newBufDesc);
+ AHardwareBuffer_Desc* pDesc =
+ reinterpret_cast<AHardwareBuffer_Desc*>(&newBuffer.buffer.description);
+ *pDesc = {
+ buff.width, // width
+ buff.height, // height
+ 1, // layers, always 1 for EVS
+ buff.format, // One of AHardwareBuffer_Format
+ buff.usage, // Combination of AHardwareBuffer_UsageFlags
+ buff.stride, // Row stride in pixels
+ 0, // Reserved
+ 0 // Reserved
+ };
+ return fillTestFrame(newBuffer);
}
-
-void EvsCamera::returnBuffer(const uint32_t bufferId, const buffer_handle_t memHandle) {
- std::lock_guard <std::mutex> lock(mAccessLock);
-
+void EvsCamera::returnBufferLocked(const uint32_t bufferId, const buffer_handle_t memHandle) {
if (memHandle == nullptr) {
ALOGE("ignoring doneWithFrame called with null handle");
} else if (bufferId >= mBuffers.size()) {
- ALOGE("ignoring doneWithFrame called with invalid bufferId %d (max is %zu)",
- bufferId, mBuffers.size()-1);
+ ALOGE("ignoring doneWithFrame called with invalid bufferId %d (max is %zu)", bufferId,
+ mBuffers.size() - 1);
} else if (!mBuffers[bufferId].inUse) {
- ALOGE("ignoring doneWithFrame called on frame %d which is already free",
- bufferId);
+ ALOGE("ignoring doneWithFrame called on frame %d which is already free", bufferId);
} else {
// Mark the frame as available
mBuffers[bufferId].inUse = false;
@@ -683,42 +719,33 @@
}
}
-
-sp<EvsCamera> EvsCamera::Create(const char *deviceName) {
- unique_ptr<ConfigManager::CameraInfo> nullCamInfo = nullptr;
+sp<EvsCamera> EvsCamera::Create(const char* deviceName) {
+ std::unique_ptr<ConfigManager::CameraInfo> nullCamInfo = nullptr;
return Create(deviceName, nullCamInfo);
}
-
-sp<EvsCamera> EvsCamera::Create(const char *deviceName,
- unique_ptr<ConfigManager::CameraInfo> &camInfo,
- const Stream *streamCfg) {
+sp<EvsCamera> EvsCamera::Create(const char* deviceName,
+ std::unique_ptr<ConfigManager::CameraInfo>& camInfo,
+ [[maybe_unused]] const Stream* streamCfg) {
sp<EvsCamera> evsCamera = new EvsCamera(deviceName, camInfo);
if (evsCamera == nullptr) {
return nullptr;
}
- /* default implementation does not use a given configuration */
- (void)streamCfg;
-
- /* Use the first resolution from the list for the testing */
+ // Use the first resolution from the list for the testing
+ // TODO(b/214835237): Uses a given Stream configuration to choose the best
+ // stream configuration.
auto it = camInfo->streamConfigurations.begin();
evsCamera->mWidth = it->second[1];
evsCamera->mHeight = it->second[2];
- evsCamera->mDescription.v1.vendorFlags = 0xFFFFFFFF; // Arbitrary test value
+ evsCamera->mDescription.v1.vendorFlags = 0xFFFFFFFF; // Arbitrary test value
evsCamera->mFormat = HAL_PIXEL_FORMAT_RGBA_8888;
- evsCamera->mUsage = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_CAMERA_WRITE |
- GRALLOC_USAGE_SW_READ_RARELY | GRALLOC_USAGE_SW_WRITE_RARELY;
+ evsCamera->mUsage = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_CAMERA_WRITE |
+ GRALLOC_USAGE_SW_READ_RARELY | GRALLOC_USAGE_SW_WRITE_RARELY;
return evsCamera;
}
-
-} // namespace implementation
-} // namespace V1_0
-} // namespace evs
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::evs::V1_1::implementation
diff --git a/automotive/evs/1.1/default/EvsCamera.h b/automotive/evs/1.1/default/EvsCamera.h
index 6163a34..1ea1186 100644
--- a/automotive/evs/1.1/default/EvsCamera.h
+++ b/automotive/evs/1.1/default/EvsCamera.h
@@ -17,91 +17,70 @@
#ifndef ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSCAMERA_H
#define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSCAMERA_H
-#include <android/hardware/automotive/evs/1.1/types.h>
+#include "ConfigManager.h"
+
#include <android/hardware/automotive/evs/1.1/IEvsCamera.h>
#include <android/hardware/automotive/evs/1.1/IEvsCameraStream.h>
#include <android/hardware/automotive/evs/1.1/IEvsDisplay.h>
+#include <android/hardware/automotive/evs/1.1/types.h>
#include <ui/GraphicBuffer.h>
#include <thread>
-#include "ConfigManager.h"
-
-using BufferDesc_1_0 = ::android::hardware::automotive::evs::V1_0::BufferDesc;
-using BufferDesc_1_1 = ::android::hardware::automotive::evs::V1_1::BufferDesc;
-using IEvsCameraStream_1_0 = ::android::hardware::automotive::evs::V1_0::IEvsCameraStream;
-using IEvsCameraStream_1_1 = ::android::hardware::automotive::evs::V1_1::IEvsCameraStream;
-using ::android::hardware::automotive::evs::V1_0::EvsResult;
-using ::android::hardware::automotive::evs::V1_0::CameraDesc;
-using IEvsDisplay_1_0 = ::android::hardware::automotive::evs::V1_0::IEvsDisplay;
-using IEvsDisplay_1_1 = ::android::hardware::automotive::evs::V1_1::IEvsDisplay;
-
-
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace evs {
-namespace V1_1 {
-namespace implementation {
-
+namespace android::hardware::automotive::evs::V1_1::implementation {
// From EvsEnumerator.h
class EvsEnumerator;
-
class EvsCamera : public IEvsCamera {
-public:
+ public:
// Methods from ::android::hardware::automotive::evs::V1_0::IEvsCamera follow.
- Return<void> getCameraInfo(getCameraInfo_cb _hidl_cb) override;
- Return<EvsResult> setMaxFramesInFlight(uint32_t bufferCount) override;
- Return<EvsResult> startVideoStream(const ::android::sp<IEvsCameraStream_1_0>& stream) override;
- Return<void> stopVideoStream() override;
- Return<void> doneWithFrame(const BufferDesc_1_0& buffer) override;
+ Return<void> getCameraInfo(getCameraInfo_cb _hidl_cb) override;
+ Return<V1_0::EvsResult> setMaxFramesInFlight(uint32_t bufferCount) override;
+ Return<V1_0::EvsResult> startVideoStream(const sp<V1_0::IEvsCameraStream>& stream) override;
+ Return<void> stopVideoStream() override;
+ Return<void> doneWithFrame(const V1_0::BufferDesc& buffer) override;
- Return<int32_t> getExtendedInfo(uint32_t opaqueIdentifier) override;
- Return<EvsResult> setExtendedInfo(uint32_t opaqueIdentifier, int32_t opaqueValue) override;
+ Return<int32_t> getExtendedInfo(uint32_t opaqueIdentifier) override;
+ Return<V1_0::EvsResult> setExtendedInfo(uint32_t opaqueIdentifier,
+ int32_t opaqueValue) override;
// Methods from ::android::hardware::automotive::evs::V1_1::IEvsCamera follow.
- Return<void> getCameraInfo_1_1(getCameraInfo_1_1_cb _hidl_cb) override;
- Return<void> getPhysicalCameraInfo(const hidl_string& id,
- getPhysicalCameraInfo_cb _hidl_cb) override;
- Return<EvsResult> pauseVideoStream() override;
- Return<EvsResult> resumeVideoStream() override;
- Return<EvsResult> doneWithFrame_1_1(const hidl_vec<BufferDesc_1_1>& buffer) override;
- Return<EvsResult> setMaster() override;
- Return<EvsResult> forceMaster(const sp<IEvsDisplay_1_0>& display) override;
- Return<EvsResult> unsetMaster() override;
- Return<void> getParameterList(getParameterList_cb _hidl_cb) override;
- Return<void> getIntParameterRange(CameraParam id,
- getIntParameterRange_cb _hidl_cb) override;
- Return<void> setIntParameter(CameraParam id, int32_t value,
- setIntParameter_cb _hidl_cb) override;
- Return<void> getIntParameter(CameraParam id,
- getIntParameter_cb _hidl_cb) override;
- Return<EvsResult> setExtendedInfo_1_1(uint32_t opaqueIdentifier,
- const hidl_vec<uint8_t>& opaqueValue) override;
- Return<void> getExtendedInfo_1_1(uint32_t opaqueIdentifier,
- getExtendedInfo_1_1_cb _hidl_cb) override;
- Return<void> importExternalBuffers(const hidl_vec<BufferDesc_1_1>& buffers,
- importExternalBuffers_cb _hidl_cb) override;
+ Return<void> getCameraInfo_1_1(getCameraInfo_1_1_cb _hidl_cb) override;
+ Return<void> getPhysicalCameraInfo(const hidl_string& id,
+ getPhysicalCameraInfo_cb _hidl_cb) override;
+ Return<V1_0::EvsResult> pauseVideoStream() override;
+ Return<V1_0::EvsResult> resumeVideoStream() override;
+ Return<V1_0::EvsResult> doneWithFrame_1_1(const hidl_vec<BufferDesc>& buffer) override;
+ Return<V1_0::EvsResult> setMaster() override;
+ Return<V1_0::EvsResult> forceMaster(const sp<V1_0::IEvsDisplay>& display) override;
+ Return<V1_0::EvsResult> unsetMaster() override;
+ Return<void> getParameterList(getParameterList_cb _hidl_cb) override;
+ Return<void> getIntParameterRange(CameraParam id, getIntParameterRange_cb _hidl_cb) override;
+ Return<void> setIntParameter(CameraParam id, int32_t value,
+ setIntParameter_cb _hidl_cb) override;
+ Return<void> getIntParameter(CameraParam id, getIntParameter_cb _hidl_cb) override;
+ Return<V1_0::EvsResult> setExtendedInfo_1_1(uint32_t opaqueIdentifier,
+ const hidl_vec<uint8_t>& opaqueValue) override;
+ Return<void> getExtendedInfo_1_1(uint32_t opaqueIdentifier,
+ getExtendedInfo_1_1_cb _hidl_cb) override;
+ Return<void> importExternalBuffers(const hidl_vec<BufferDesc>& buffers,
+ importExternalBuffers_cb _hidl_cb) override;
- static sp<EvsCamera> Create(const char *deviceName);
- static sp<EvsCamera> Create(const char *deviceName,
- unique_ptr<ConfigManager::CameraInfo> &camInfo,
- const Stream *streamCfg = nullptr);
+ static sp<EvsCamera> Create(const char* deviceName);
+ static sp<EvsCamera> Create(const char* deviceName,
+ std::unique_ptr<ConfigManager::CameraInfo>& camInfo,
+ const Stream* streamCfg = nullptr);
EvsCamera(const EvsCamera&) = delete;
EvsCamera& operator=(const EvsCamera&) = delete;
virtual ~EvsCamera() override;
- void forceShutdown(); // This gets called if another caller "steals" ownership of the camera
+ void forceShutdown(); // This gets called if another caller "steals" ownership of the camera
const CameraDesc& getDesc() { return mDescription; };
- static const char kCameraName_Backup[];
-
-private:
- EvsCamera(const char *id,
- unique_ptr<ConfigManager::CameraInfo> &camInfo);
+ private:
+ EvsCamera(const char* id, std::unique_ptr<ConfigManager::CameraInfo>& camInfo);
// These three functions are expected to be called while mAccessLock is held
//
bool setAvailableFrames_Locked(unsigned bufferCount);
@@ -109,34 +88,34 @@
unsigned decreaseAvailableFrames_Locked(unsigned numToRemove);
void generateFrames();
- void fillTestFrame(const BufferDesc_1_0& buff);
- void fillTestFrame(const BufferDesc_1_1& buff);
- void returnBuffer(const uint32_t bufferId, const buffer_handle_t memHandle);
+ void fillTestFrame(const V1_0::BufferDesc& buff);
+ void fillTestFrame(const BufferDesc& buff);
+ void returnBufferLocked(const uint32_t bufferId, const buffer_handle_t memHandle);
sp<EvsEnumerator> mEnumerator; // The enumerator object that created this camera
- CameraDesc mDescription = {}; // The properties of this camera
+ CameraDesc mDescription = {}; // The properties of this camera
- std::thread mCaptureThread; // The thread we'll use to synthesize frames
+ std::thread mCaptureThread; // The thread we'll use to synthesize frames
- uint32_t mWidth = 0; // Horizontal pixel count in the buffers
- uint32_t mHeight = 0; // Vertical pixel count in the buffers
- uint32_t mFormat = 0; // Values from android_pixel_format_t
- uint64_t mUsage = 0; // Values from from Gralloc.h
- uint32_t mStride = 0; // Bytes per line in the buffers
+ uint32_t mWidth = 0; // Horizontal pixel count in the buffers
+ uint32_t mHeight = 0; // Vertical pixel count in the buffers
+ uint32_t mFormat = 0; // Values from android_pixel_format_t
+ uint64_t mUsage = 0; // Values from from Gralloc.h
+ uint32_t mStride = 0; // Bytes per line in the buffers
- sp<IEvsCameraStream_1_1> mStream = nullptr; // The callback used to deliver each frame
+ sp<IEvsCameraStream> mStream = nullptr; // The callback used to deliver each frame
struct BufferRecord {
buffer_handle_t handle;
bool inUse;
- explicit BufferRecord(buffer_handle_t h) : handle(h), inUse(false) {};
+ explicit BufferRecord(buffer_handle_t h) : handle(h), inUse(false){};
};
- std::vector <BufferRecord> mBuffers; // Graphics buffers to transfer images
- unsigned mFramesAllowed; // How many buffers are we currently using
- unsigned mFramesInUse; // How many buffers are currently outstanding
+ std::vector<BufferRecord> mBuffers; // Graphics buffers to transfer images
+ unsigned mFramesAllowed; // How many buffers are we currently using
+ unsigned mFramesInUse; // How many buffers are currently outstanding
enum StreamStateValues {
STOPPED,
@@ -150,14 +129,13 @@
std::mutex mAccessLock;
// Static camera module information
- unique_ptr<ConfigManager::CameraInfo> &mCameraInfo;
+ std::unique_ptr<ConfigManager::CameraInfo>& mCameraInfo;
+
+ // For the extended info
+ std::unordered_map<uint32_t, hidl_vec<uint8_t>> mExtInfo;
+ std::unordered_map<CameraParam, int32_t> mParams;
};
-} // namespace implementation
-} // namespace V1_1
-} // namespace evs
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::evs::V1_1::implementation
#endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSCAMERA_H
diff --git a/automotive/evs/1.1/default/EvsDisplay.cpp b/automotive/evs/1.1/default/EvsDisplay.cpp
index 2b5a4a9..f7169e5 100644
--- a/automotive/evs/1.1/default/EvsDisplay.cpp
+++ b/automotive/evs/1.1/default/EvsDisplay.cpp
@@ -14,8 +14,6 @@
* limitations under the License.
*/
-#define LOG_TAG "android.hardware.automotive.evs@1.1-service"
-
#include "EvsDisplay.h"
#include <ui/GraphicBufferAllocator.h>
@@ -23,51 +21,53 @@
using ::android::frameworks::automotive::display::V1_0::HwDisplayConfig;
using ::android::frameworks::automotive::display::V1_0::HwDisplayState;
+using ::android::frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService;
+using ::android::hardware::automotive::evs::V1_0::DisplayDesc;
+using ::android::hardware::automotive::evs::V1_0::DisplayState;
+using ::android::hardware::automotive::evs::V1_0::EvsResult;
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace evs {
-namespace V1_1 {
-namespace implementation {
+namespace {
+ // Arbitrary magic number for self-recognition
+ constexpr uint32_t kDefaultDisplayBufferId = 0x3870;
+
+} // namespace
+
+namespace android::hardware::automotive::evs::V1_1::implementation {
EvsDisplay::EvsDisplay() {
EvsDisplay(nullptr, 0);
}
-
EvsDisplay::EvsDisplay(sp<IAutomotiveDisplayProxyService> pDisplayProxy, uint64_t displayId)
: mDisplayProxy(pDisplayProxy),
- mDisplayId(displayId) {
+ mDisplayId(displayId),
+ mGlWrapper(std::make_unique<GlWrapper>()) {
ALOGD("EvsDisplay instantiated");
// Set up our self description
// NOTE: These are arbitrary values chosen for testing
- mInfo.displayId = "Mock Display";
- mInfo.vendorFlags = 3870;
+ mInfo.displayId = "Mock Display";
+ mInfo.vendorFlags = 3870;
// Assemble the buffer description we'll use for our render target
- mBuffer.width = 320;
- mBuffer.height = 240;
- mBuffer.format = HAL_PIXEL_FORMAT_RGBA_8888;
- mBuffer.usage = GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER;
- mBuffer.bufferId = 0x3870; // Arbitrary magic number for self recognition
- mBuffer.pixelSize = 4;
+ mBuffer.width = 640;
+ mBuffer.height = 360;
+ mBuffer.format = HAL_PIXEL_FORMAT_RGBA_8888;
+ mBuffer.usage = GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER;
+ mBuffer.bufferId = kDefaultDisplayBufferId;
+ mBuffer.pixelSize = 4;
}
-
EvsDisplay::~EvsDisplay() {
ALOGD("EvsDisplay being destroyed");
forceShutdown();
}
-
/**
* This gets called if another caller "steals" ownership of the display
*/
-void EvsDisplay::forceShutdown()
-{
+void EvsDisplay::forceShutdown() {
ALOGD("EvsDisplay forceShutdown");
std::lock_guard<std::mutex> lock(mAccessLock);
@@ -84,6 +84,11 @@
GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
alloc.free(mBuffer.memHandle);
mBuffer.memHandle = nullptr;
+
+ if (mGlWrapper) {
+ mGlWrapper->hideWindow(mDisplayProxy, mDisplayId);
+ mGlWrapper->shutdown();
+ }
}
// Put this object into an unrecoverable error state since somebody else
@@ -91,20 +96,18 @@
mRequestedState = DisplayState::DEAD;
}
-
/**
* Returns basic information about the EVS display provided by the system.
* See the description of the DisplayDesc structure for details.
*/
-Return<void> EvsDisplay::getDisplayInfo(getDisplayInfo_cb _hidl_cb) {
+Return<void> EvsDisplay::getDisplayInfo(getDisplayInfo_cb _hidl_cb) {
ALOGD("getDisplayInfo");
// Send back our self description
_hidl_cb(mInfo);
- return Void();
+ return {};
}
-
/**
* Clients may set the display state to express their desired state.
* The HAL implementation must gracefully accept a request for any state
@@ -124,18 +127,28 @@
}
// Ensure we recognize the requested state so we don't go off the rails
- if (state < DisplayState::NUM_STATES) {
- // Record the requested state
- mRequestedState = state;
- return EvsResult::OK;
- }
- else {
- // Turn off the display if asked for an unrecognized state
- mRequestedState = DisplayState::NOT_VISIBLE;
+ if (state >= DisplayState::NUM_STATES) {
return EvsResult::INVALID_ARG;
}
-}
+ if (!mGlWrapper) {
+ switch (state) {
+ case DisplayState::NOT_VISIBLE:
+ mGlWrapper->hideWindow(mDisplayProxy, mDisplayId);
+ break;
+ case DisplayState::VISIBLE:
+ mGlWrapper->showWindow(mDisplayProxy, mDisplayId);
+ break;
+ default:
+ break;
+ }
+ }
+
+ // Record the requested state
+ mRequestedState = state;
+
+ return EvsResult::OK;
+}
/**
* The HAL implementation should report the actual current state, which might
@@ -144,14 +157,13 @@
* the device layer, making it undesirable for the HAL implementation to
* spontaneously change display states.
*/
-Return<DisplayState> EvsDisplay::getDisplayState() {
+Return<DisplayState> EvsDisplay::getDisplayState() {
ALOGD("getDisplayState");
std::lock_guard<std::mutex> lock(mAccessLock);
return mRequestedState;
}
-
/**
* This call returns a handle to a frame buffer associated with the display.
* This buffer may be locked and written to by software and/or GL. This buffer
@@ -159,43 +171,55 @@
* display is no longer visible.
*/
// TODO: We need to know if/when our client dies so we can get the buffer back! (blocked b/31632518)
-Return<void> EvsDisplay::getTargetBuffer(getTargetBuffer_cb _hidl_cb) {
+Return<void> EvsDisplay::getTargetBuffer(getTargetBuffer_cb _hidl_cb) {
ALOGD("getTargetBuffer");
std::lock_guard<std::mutex> lock(mAccessLock);
if (mRequestedState == DisplayState::DEAD) {
ALOGE("Rejecting buffer request from object that lost ownership of the display.");
- BufferDesc_1_0 nullBuff = {};
- _hidl_cb(nullBuff);
- return Void();
+ _hidl_cb({});
+ return {};
}
// If we don't already have a buffer, allocate one now
if (!mBuffer.memHandle) {
+ // Initialize our display window
+ // NOTE: This will cause the display to become "VISIBLE" before a frame is actually
+ // returned, which is contrary to the spec and will likely result in a black frame being
+ // (briefly) shown.
+ if (mGlWrapper->initialize(mDisplayProxy, mDisplayId)) {
+ // Assemble the buffer description we'll use for our render target
+ mBuffer.width = mGlWrapper->getWidth();
+ mBuffer.height = mGlWrapper->getHeight();
+ mBuffer.format = HAL_PIXEL_FORMAT_RGBA_8888;
+ mBuffer.usage = GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER;
+ mBuffer.bufferId = kDefaultDisplayBufferId;
+ mBuffer.pixelSize = 4;
+ } else {
+ // If we failed to initialize a EGL, then we're not going to display
+ // any.
+ mGlWrapper = nullptr;
+ }
+
// Allocate the buffer that will hold our displayable image
buffer_handle_t handle = nullptr;
GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
- status_t result = alloc.allocate(
- mBuffer.width, mBuffer.height, mBuffer.format, 1, mBuffer.usage,
- &handle, &mBuffer.stride, 0, "EvsDisplay");
- if (result != NO_ERROR) {
- ALOGE("Error %d allocating %d x %d graphics buffer",
- result, mBuffer.width, mBuffer.height);
- BufferDesc_1_0 nullBuff = {};
- _hidl_cb(nullBuff);
- return Void();
- }
- if (!handle) {
- ALOGE("We didn't get a buffer handle back from the allocator");
- BufferDesc_1_0 nullBuff = {};
- _hidl_cb(nullBuff);
- return Void();
+ status_t result = alloc.allocate(mBuffer.width, mBuffer.height, mBuffer.format, 1,
+ mBuffer.usage, &handle, &mBuffer.stride, 0, "EvsDisplay");
+ if (result != NO_ERROR || !handle) {
+ ALOGE("Error %d allocating %d x %d graphics buffer", result, mBuffer.width,
+ mBuffer.height);
+ if (mGlWrapper) {
+ mGlWrapper->shutdown();
+ }
+ _hidl_cb({});
+ return {};
}
mBuffer.memHandle = handle;
mFrameBusy = false;
- ALOGD("Allocated new buffer %p with stride %u",
- mBuffer.memHandle.getNativeHandle(), mBuffer.stride);
+ ALOGD("Allocated new buffer %p with stride %u", mBuffer.memHandle.getNativeHandle(),
+ mBuffer.stride);
}
// Do we have a frame available?
@@ -205,41 +229,40 @@
// a previously issued buffer yet (they're behaving badly).
// NOTE: We have to make the callback even if we have nothing to provide
ALOGE("getTargetBuffer called while no buffers available.");
- BufferDesc_1_0 nullBuff = {};
- _hidl_cb(nullBuff);
- return Void();
+ _hidl_cb({});
+ return {};
} else {
// Mark our buffer as busy
mFrameBusy = true;
// Send the buffer to the client
- ALOGD("Providing display buffer handle %p as id %d",
- mBuffer.memHandle.getNativeHandle(), mBuffer.bufferId);
+ ALOGD("Providing display buffer handle %p as id %d", mBuffer.memHandle.getNativeHandle(),
+ mBuffer.bufferId);
_hidl_cb(mBuffer);
- return Void();
+ return {};
}
}
-
/**
* This call tells the display that the buffer is ready for display.
* The buffer is no longer valid for use by the client after this call.
*/
-Return<EvsResult> EvsDisplay::returnTargetBufferForDisplayImpl(const uint32_t bufferId, const buffer_handle_t memHandle) {
+Return<EvsResult> EvsDisplay::returnTargetBufferForDisplayImpl(const uint32_t bufferId,
+ const buffer_handle_t memHandle) {
ALOGD("returnTargetBufferForDisplay %p", memHandle);
std::lock_guard<std::mutex> lock(mAccessLock);
// Nobody should call us with a null handle
if (!memHandle) {
- ALOGE ("returnTargetBufferForDisplay called without a valid buffer handle.\n");
+ ALOGE("returnTargetBufferForDisplay called without a valid buffer handle.\n");
return EvsResult::INVALID_ARG;
}
if (bufferId != mBuffer.bufferId) {
- ALOGE ("Got an unrecognized frame returned.\n");
+ ALOGE("Got an unrecognized frame returned.\n");
return EvsResult::INVALID_ARG;
}
if (!mFrameBusy) {
- ALOGE ("A frame was returned with no outstanding frames.\n");
+ ALOGE("A frame was returned with no outstanding frames.\n");
return EvsResult::BUFFER_NOT_AVAILABLE;
}
@@ -253,23 +276,32 @@
// If we were waiting for a new frame, this is it!
if (mRequestedState == DisplayState::VISIBLE_ON_NEXT_FRAME) {
mRequestedState = DisplayState::VISIBLE;
+ if (mGlWrapper) {
+ mGlWrapper->showWindow(mDisplayProxy, mDisplayId);
+ }
}
// Validate we're in an expected state
if (mRequestedState != DisplayState::VISIBLE) {
// We shouldn't get frames back when we're not visible.
- ALOGE ("Got an unexpected frame returned while not visible - ignoring.\n");
- } else {
+ ALOGE("Got an unexpected frame returned while not visible - ignoring.\n");
+ } else if (mGlWrapper) {
// This is where the buffer would be made visible.
- // For now we simply validate it has the data we expect in it by reading it back
+ if (!mGlWrapper->updateImageTexture(mBuffer)) {
+ return EvsResult::UNDERLYING_SERVICE_ERROR;
+ }
+ // Put the image on the screen
+ mGlWrapper->renderImageToScreen();
+ } else {
+ // TODO: Move below validation logic to somewhere else
+#if 0
+ // For now we simply validate it has the data we expect in it by reading it back
// Lock our display buffer for reading
uint32_t* pixels = nullptr;
- GraphicBufferMapper &mapper = GraphicBufferMapper::get();
- mapper.lock(mBuffer.memHandle,
- GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_NEVER,
- android::Rect(mBuffer.width, mBuffer.height),
- (void **)&pixels);
+ GraphicBufferMapper& mapper = GraphicBufferMapper::get();
+ mapper.lock(mBuffer.memHandle, GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_NEVER,
+ android::Rect(mBuffer.width, mBuffer.height), (void**)&pixels);
// If we failed to lock the pixel buffer, we're about to crash, but log it first
if (!pixels) {
@@ -286,8 +318,8 @@
// 0xFF in the MSB.
// The exception is the very first 32 bits which is used for the
// time varying frame signature to avoid getting fooled by a static image.
- uint32_t expectedPixel = 0xFF0000FF | // MSB and LSB
- ((row & 0xFF) << 8) | // vertical gradient
+ uint32_t expectedPixel = 0xFF0000FF | // MSB and LSB
+ ((row & 0xFF) << 8) | // vertical gradient
((col & 0xFF) << 16); // horizontal gradient
if ((row | col) == 0) {
// we'll check the "uniqueness" of the frame signature below
@@ -318,39 +350,31 @@
ALOGE("Duplicate, likely stale frame buffer detected");
}
-
// Release our output buffer
mapper.unlock(mBuffer.memHandle);
if (!frameLooksGood) {
return EvsResult::UNDERLYING_SERVICE_ERROR;
}
+#endif
}
return EvsResult::OK;
}
-
-Return<EvsResult> EvsDisplay::returnTargetBufferForDisplay(const BufferDesc_1_0& buffer) {
+Return<EvsResult> EvsDisplay::returnTargetBufferForDisplay(const V1_0::BufferDesc& buffer) {
return returnTargetBufferForDisplayImpl(buffer.bufferId, buffer.memHandle);
}
-
Return<void> EvsDisplay::getDisplayInfo_1_1(getDisplayInfo_1_1_cb _info_cb) {
if (mDisplayProxy != nullptr) {
return mDisplayProxy->getDisplayInfo(mDisplayId, _info_cb);
} else {
HwDisplayConfig nullConfig;
- HwDisplayState nullState;
+ HwDisplayState nullState;
_info_cb(nullConfig, nullState);
- return Void();
+ return {};
}
}
-
-} // namespace implementation
-} // namespace V1_1
-} // namespace evs
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::evs::V1_1::implementation
diff --git a/automotive/evs/1.1/default/EvsDisplay.h b/automotive/evs/1.1/default/EvsDisplay.h
index 9b2ed90..b2ec3e8 100644
--- a/automotive/evs/1.1/default/EvsDisplay.h
+++ b/automotive/evs/1.1/default/EvsDisplay.h
@@ -17,64 +17,48 @@
#ifndef ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSDISPLAY_H
#define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSDISPLAY_H
-#include <android/hardware/automotive/evs/1.1/IEvsDisplay.h>
+#include "GlWrapper.h"
+
#include <android/frameworks/automotive/display/1.0/IAutomotiveDisplayProxyService.h>
+#include <android/hardware/automotive/evs/1.1/IEvsDisplay.h>
#include <ui/GraphicBuffer.h>
-using ::android::hardware::automotive::evs::V1_1::IEvsDisplay;
-using ::android::hardware::automotive::evs::V1_0::DisplayDesc;
-using ::android::hardware::automotive::evs::V1_0::DisplayState;
-using ::android::hardware::automotive::evs::V1_0::EvsResult;
-using BufferDesc_1_0 = ::android::hardware::automotive::evs::V1_0::BufferDesc;
-using android::frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService;
-
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace evs {
-namespace V1_1 {
-namespace implementation {
-
+namespace android::hardware::automotive::evs::V1_1::implementation {
class EvsDisplay : public IEvsDisplay {
-public:
+ public:
// Methods from ::android::hardware::automotive::evs::V1_0::IEvsDisplay follow.
- Return<void> getDisplayInfo(getDisplayInfo_cb _hidl_cb) override;
- Return<EvsResult> setDisplayState(DisplayState state) override;
- Return<DisplayState> getDisplayState() override;
- Return<void> getTargetBuffer(getTargetBuffer_cb _hidl_cb) override;
- Return<EvsResult> returnTargetBufferForDisplay(const BufferDesc_1_0& buffer) override;
+ Return<void> getDisplayInfo(getDisplayInfo_cb _hidl_cb) override;
+ Return<V1_0::EvsResult> setDisplayState(V1_0::DisplayState state) override;
+ Return<V1_0::DisplayState> getDisplayState() override;
+ Return<void> getTargetBuffer(getTargetBuffer_cb _hidl_cb) override;
+ Return<V1_0::EvsResult> returnTargetBufferForDisplay(const V1_0::BufferDesc& buffer) override;
// Methods from ::android::hardware::automotive::evs::V1_1::IEvsDisplay follow.
- Return<void> getDisplayInfo_1_1(getDisplayInfo_1_1_cb _info_cb) override;
+ Return<void> getDisplayInfo_1_1(getDisplayInfo_1_1_cb _info_cb) override;
// Implementation details
EvsDisplay();
- EvsDisplay(sp<IAutomotiveDisplayProxyService> pDisplayProxy, uint64_t displayId);
+ EvsDisplay(
+ sp<frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService> pDisplayProxy,
+ uint64_t displayId);
virtual ~EvsDisplay() override;
- void forceShutdown(); // This gets called if another caller "steals" ownership of the display
- Return<EvsResult> returnTargetBufferForDisplayImpl(const uint32_t bufferId,
- const buffer_handle_t memHandle);
+ void forceShutdown(); // This gets called if another caller "steals" ownership of the display
+ Return<V1_0::EvsResult> returnTargetBufferForDisplayImpl(const uint32_t bufferId,
+ const buffer_handle_t memHandle);
-private:
- DisplayDesc mInfo = {};
- BufferDesc_1_0 mBuffer = {}; // A graphics buffer into which we'll store images
-
- bool mFrameBusy = false; // A flag telling us our buffer is in use
- DisplayState mRequestedState = DisplayState::NOT_VISIBLE;
-
- std::mutex mAccessLock;
-
- sp<IAutomotiveDisplayProxyService> mDisplayProxy;
- uint64_t mDisplayId;
+ private:
+ V1_0::DisplayDesc mInfo = {};
+ V1_0::BufferDesc mBuffer = {}; // A graphics buffer into which we'll store images
+ V1_0::DisplayState mRequestedState = V1_0::DisplayState::NOT_VISIBLE;
+ bool mFrameBusy = false; // A flag telling us our buffer is in use
+ std::mutex mAccessLock;
+ sp<frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService> mDisplayProxy;
+ uint64_t mDisplayId;
+ std::unique_ptr<GlWrapper> mGlWrapper;
};
-} // namespace implementation
-} // namespace V1_1
-} // namespace evs
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::evs::V1_1::implementation
#endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSDISPLAY_H
diff --git a/automotive/evs/1.1/default/EvsEnumerator.cpp b/automotive/evs/1.1/default/EvsEnumerator.cpp
index d066471..b84268a 100644
--- a/automotive/evs/1.1/default/EvsEnumerator.cpp
+++ b/automotive/evs/1.1/default/EvsEnumerator.cpp
@@ -14,184 +14,171 @@
* limitations under the License.
*/
-#define LOG_TAG "android.hardware.automotive.evs@1.1-service"
-
#include "EvsEnumerator.h"
#include "EvsCamera.h"
#include "EvsDisplay.h"
#include "EvsUltrasonicsArray.h"
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace evs {
-namespace V1_1 {
-namespace implementation {
+using android::frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService;
+using android::hardware::automotive::evs::V1_0::EvsResult;
+namespace android::hardware::automotive::evs::V1_1::implementation {
+
+namespace evs_v1_0 = ::android::hardware::automotive::evs::V1_0;
// NOTE: All members values are static so that all clients operate on the same state
// That is to say, this is effectively a singleton despite the fact that HIDL
// constructs a new instance for each client.
-std::list<EvsEnumerator::CameraRecord> EvsEnumerator::sCameraList;
-wp<EvsDisplay> EvsEnumerator::sActiveDisplay;
-unique_ptr<ConfigManager> EvsEnumerator::sConfigManager;
-sp<IAutomotiveDisplayProxyService> EvsEnumerator::sDisplayProxyService;
-std::unordered_map<uint8_t, uint64_t> EvsEnumerator::sDisplayPortList;
-std::list<EvsEnumerator::UltrasonicsArrayRecord> EvsEnumerator::sUltrasonicsArrayRecordList;
+std::list<EvsEnumerator::CameraRecord> EvsEnumerator::sCameraList;
+wp<EvsDisplay> EvsEnumerator::sActiveDisplay;
+std::unique_ptr<ConfigManager> EvsEnumerator::sConfigManager;
+sp<IAutomotiveDisplayProxyService> EvsEnumerator::sDisplayProxyService;
+std::unordered_map<uint8_t, uint64_t> EvsEnumerator::sDisplayPortList;
+std::list<EvsEnumerator::UltrasonicsArrayRecord> EvsEnumerator::sUltrasonicsArrayRecordList;
+uint64_t EvsEnumerator::sInternalDisplayId;
-EvsEnumerator::EvsEnumerator(sp<IAutomotiveDisplayProxyService> windowService) {
- ALOGD("EvsEnumerator created");
+EvsEnumerator::EvsEnumerator(sp<IAutomotiveDisplayProxyService>& windowService) {
+ ALOGD("%s", __FUNCTION__);
// Add sample camera data to our list of cameras
// In a real driver, this would be expected to can the available hardware
sConfigManager =
- ConfigManager::Create("/vendor/etc/automotive/evs/evs_default_configuration.xml");
+ ConfigManager::Create("/vendor/etc/automotive/evs/evs_default_configuration.xml");
// Add available cameras
for (auto v : sConfigManager->getCameraList()) {
- sCameraList.emplace_back(v.c_str());
+ CameraRecord rec(v.data());
+ std::unique_ptr<ConfigManager::CameraInfo>& pInfo = sConfigManager->getCameraInfo(v);
+ if (pInfo) {
+ rec.desc.metadata.setToExternal(reinterpret_cast<uint8_t*>(pInfo->characteristics),
+ get_camera_metadata_size(pInfo->characteristics));
+ }
+ sCameraList.push_back(std::move(rec));
}
- if (sDisplayProxyService == nullptr) {
+ if (!sDisplayProxyService) {
/* sets a car-window service handle */
sDisplayProxyService = windowService;
}
// Add available displays
- if (sDisplayProxyService != nullptr) {
+ if (sDisplayProxyService) {
// Get a display ID list.
- sDisplayProxyService->getDisplayIdList([](const auto& displayIds) {
- for (const auto& id : displayIds) {
- const auto port = id & 0xF;
- sDisplayPortList.insert_or_assign(port, id);
+ auto status = sDisplayProxyService->getDisplayIdList([](const auto& displayIds) {
+ if (displayIds.size() > 0) {
+ sInternalDisplayId = displayIds[0];
+ for (const auto& id : displayIds) {
+ const auto port = id & 0xF;
+ sDisplayPortList.insert_or_assign(port, id);
+ }
}
});
+
+ if (!status.isOk()) {
+ ALOGE("Failed to read a display list");
+ }
}
// Add ultrasonics array desc.
- sUltrasonicsArrayRecordList.emplace_back(
- EvsUltrasonicsArray::GetMockArrayDesc("front_array"));
+ sUltrasonicsArrayRecordList.emplace_back(EvsUltrasonicsArray::GetMockArrayDesc("front_array"));
}
-
// Methods from ::android::hardware::automotive::evs::V1_0::IEvsEnumerator follow.
-Return<void> EvsEnumerator::getCameraList(getCameraList_cb _hidl_cb) {
- ALOGD("getCameraList");
+Return<void> EvsEnumerator::getCameraList(getCameraList_cb _hidl_cb) {
+ ALOGD("%s", __FUNCTION__);
- const unsigned numCameras = sCameraList.size();
+ const auto numCameras = sCameraList.size();
// Build up a packed array of CameraDesc for return
// NOTE: Only has to live until the callback returns
- std::vector<CameraDesc_1_0> descriptions;
+ std::vector<evs_v1_0::CameraDesc> descriptions;
descriptions.reserve(numCameras);
for (const auto& cam : sCameraList) {
- descriptions.push_back( cam.desc.v1 );
+ descriptions.push_back(cam.desc.v1);
}
// Encapsulate our camera descriptions in the HIDL vec type
- hidl_vec<CameraDesc_1_0> hidlCameras(descriptions);
+ hidl_vec<evs_v1_0::CameraDesc> hidlCameras(descriptions);
// Send back the results
ALOGD("reporting %zu cameras available", hidlCameras.size());
_hidl_cb(hidlCameras);
-
- // HIDL convention says we return Void if we sent our result back via callback
- return Void();
+ return {};
}
-
-Return<sp<IEvsCamera_1_0>> EvsEnumerator::openCamera(const hidl_string& cameraId) {
- ALOGD("openCamera");
+Return<sp<evs_v1_0::IEvsCamera>> EvsEnumerator::openCamera(const hidl_string& cameraId) {
+ ALOGD("%s", __FUNCTION__);
// Find the named camera
- CameraRecord *pRecord = nullptr;
- for (auto &&cam : sCameraList) {
- if (cam.desc.v1.cameraId == cameraId) {
- // Found a match!
- pRecord = &cam;
- break;
- }
- }
-
- // Is this a recognized camera id?
- if (!pRecord) {
+ auto it = std::find_if(sCameraList.begin(), sCameraList.end(), [&cameraId](const auto& cam) {
+ return cameraId == cam.desc.v1.cameraId;
+ });
+ if (it == sCameraList.end()) {
ALOGE("Requested camera %s not found", cameraId.c_str());
return nullptr;
}
// Has this camera already been instantiated by another caller?
- sp<EvsCamera> pActiveCamera = pRecord->activeInstance.promote();
+ sp<EvsCamera> pActiveCamera = it->activeInstance.promote();
if (pActiveCamera != nullptr) {
ALOGW("Killing previous camera because of new caller");
closeCamera(pActiveCamera);
}
// Construct a camera instance for the caller
- if (sConfigManager == nullptr) {
+ if (!sConfigManager) {
pActiveCamera = EvsCamera::Create(cameraId.c_str());
} else {
- pActiveCamera = EvsCamera::Create(cameraId.c_str(),
- sConfigManager->getCameraInfo(cameraId));
+ pActiveCamera =
+ EvsCamera::Create(cameraId.c_str(), sConfigManager->getCameraInfo(cameraId));
}
- pRecord->activeInstance = pActiveCamera;
- if (pActiveCamera == nullptr) {
+ it->activeInstance = pActiveCamera;
+ if (!pActiveCamera) {
ALOGE("Failed to allocate new EvsCamera object for %s\n", cameraId.c_str());
}
return pActiveCamera;
}
+Return<void> EvsEnumerator::closeCamera(const ::android::sp<evs_v1_0::IEvsCamera>& pCamera) {
+ ALOGD("%s", __FUNCTION__);
-Return<void> EvsEnumerator::closeCamera(const ::android::sp<IEvsCamera_1_0>& pCamera) {
- ALOGD("closeCamera");
-
- auto pCamera_1_1 = IEvsCamera_1_1::castFrom(pCamera).withDefault(nullptr);
- if (pCamera_1_1 == nullptr) {
+ auto pCamera_1_1 = IEvsCamera::castFrom(pCamera).withDefault(nullptr);
+ if (!pCamera_1_1) {
ALOGE("Ignoring call to closeCamera with null camera ptr");
- return Void();
+ return {};
}
// Get the camera id so we can find it in our list
std::string cameraId;
- pCamera_1_1->getCameraInfo_1_1([&cameraId](CameraDesc desc) {
- cameraId = desc.v1.cameraId;
- }
- );
+ pCamera_1_1->getCameraInfo_1_1([&cameraId](CameraDesc desc) { cameraId = desc.v1.cameraId; });
// Find the named camera
- CameraRecord *pRecord = nullptr;
- for (auto &&cam : sCameraList) {
- if (cam.desc.v1.cameraId == cameraId) {
- // Found a match!
- pRecord = &cam;
- break;
- }
+ auto it = std::find_if(sCameraList.begin(), sCameraList.end(), [&cameraId](const auto& cam) {
+ return cameraId == cam.desc.v1.cameraId;
+ });
+ if (it == sCameraList.end()) {
+ ALOGE("Ignores a request to close unknown camera, %s", cameraId.data());
+ return {};
}
- // Is the display being destroyed actually the one we think is active?
- if (!pRecord) {
- ALOGE("Asked to close a camera who's name isn't recognized");
+ sp<EvsCamera> pActiveCamera = it->activeInstance.promote();
+ if (!pActiveCamera) {
+ ALOGE("Somehow a camera is being destroyed when the enumerator didn't know one existed");
+ } else if (pActiveCamera != pCamera_1_1) {
+ // This can happen if the camera was aggressively reopened, orphaning this previous instance
+ ALOGW("Ignoring close of previously orphaned camera - why did a client steal?");
} else {
- sp<EvsCamera> pActiveCamera = pRecord->activeInstance.promote();
-
- if (pActiveCamera == nullptr) {
- ALOGE("Somehow a camera is being destroyed when the enumerator didn't know one existed");
- } else if (pActiveCamera != pCamera_1_1) {
- // This can happen if the camera was aggressively reopened, orphaning this previous instance
- ALOGW("Ignoring close of previously orphaned camera - why did a client steal?");
- } else {
- // Drop the active camera
- pActiveCamera->forceShutdown();
- pRecord->activeInstance = nullptr;
- }
+ // Drop the active camera
+ pActiveCamera->forceShutdown();
+ it->activeInstance = nullptr;
}
- return Void();
+ return {};
}
-
-Return<sp<IEvsDisplay_1_0>> EvsEnumerator::openDisplay() {
- ALOGD("openDisplay");
+Return<sp<V1_0::IEvsDisplay>> EvsEnumerator::openDisplay() {
+ ALOGD("%s", __FUNCTION__);
// If we already have a display active, then we need to shut it down so we can
// give exclusive access to the new caller.
@@ -202,28 +189,25 @@
}
// Create a new display interface and return it
- pActiveDisplay = new EvsDisplay();
+ pActiveDisplay = new EvsDisplay(sDisplayProxyService, sInternalDisplayId);
sActiveDisplay = pActiveDisplay;
ALOGD("Returning new EvsDisplay object %p", pActiveDisplay.get());
return pActiveDisplay;
}
-
Return<void> EvsEnumerator::getDisplayIdList(getDisplayIdList_cb _list_cb) {
hidl_vec<uint8_t> ids;
-
ids.resize(sDisplayPortList.size());
+
unsigned i = 0;
- for (const auto& [port, id] : sDisplayPortList) {
- ids[i++] = port;
- }
+ std::for_each(sDisplayPortList.begin(), sDisplayPortList.end(),
+ [&](const auto& element) { ids[i++] = element.first; });
_list_cb(ids);
- return Void();
+ return {};
}
-
Return<sp<IEvsDisplay>> EvsEnumerator::openDisplay_1_1(uint8_t port) {
ALOGD("%s", __FUNCTION__);
@@ -243,10 +227,8 @@
return pActiveDisplay;
}
-
-
-Return<void> EvsEnumerator::closeDisplay(const ::android::sp<IEvsDisplay_1_0>& pDisplay) {
- ALOGD("closeDisplay");
+Return<void> EvsEnumerator::closeDisplay(const ::android::sp<V1_0::IEvsDisplay>& pDisplay) {
+ ALOGD("%s", __FUNCTION__);
// Do we still have a display object we think should be active?
sp<EvsDisplay> pActiveDisplay = sActiveDisplay.promote();
@@ -260,123 +242,111 @@
sActiveDisplay = nullptr;
}
- return Void();
+ return {};
}
-
-Return<DisplayState> EvsEnumerator::getDisplayState() {
- ALOGD("getDisplayState");
+Return<V1_0::DisplayState> EvsEnumerator::getDisplayState() {
+ ALOGD("%s", __FUNCTION__);
// Do we still have a display object we think should be active?
sp<IEvsDisplay> pActiveDisplay = sActiveDisplay.promote();
if (pActiveDisplay != nullptr) {
return pActiveDisplay->getDisplayState();
} else {
- return DisplayState::NOT_OPEN;
+ return V1_0::DisplayState::NOT_OPEN;
}
}
-
// Methods from ::android::hardware::automotive::evs::V1_1::IEvsEnumerator follow.
-Return<void> EvsEnumerator::getCameraList_1_1(getCameraList_1_1_cb _hidl_cb) {
- ALOGD("getCameraList");
+Return<void> EvsEnumerator::getCameraList_1_1(getCameraList_1_1_cb _hidl_cb) {
+ ALOGD("%s", __FUNCTION__);
- const unsigned numCameras = sCameraList.size();
+ const auto numCameras = sCameraList.size();
// Build up a packed array of CameraDesc for return
// NOTE: Only has to live until the callback returns
- std::vector<CameraDesc_1_1> descriptions;
+ std::vector<CameraDesc> descriptions;
descriptions.reserve(numCameras);
- for (const auto& cam : sCameraList) {
- descriptions.push_back( cam.desc );
- }
+ std::for_each(sCameraList.begin(), sCameraList.end(),
+ [&](const auto& cam) { descriptions.push_back(cam.desc); });
// Encapsulate our camera descriptions in the HIDL vec type
- hidl_vec<CameraDesc_1_1> hidlCameras(descriptions);
+ hidl_vec<CameraDesc> hidlCameras(descriptions);
// Send back the results
ALOGD("reporting %zu cameras available", hidlCameras.size());
_hidl_cb(hidlCameras);
-
- // HIDL convention says we return Void if we sent our result back via callback
- return Void();
+ return {};
}
-Return<sp<IEvsCamera_1_1>>
-EvsEnumerator::openCamera_1_1(const hidl_string& cameraId,
- const Stream& streamCfg) {
- // Find the named camera
- CameraRecord *pRecord = nullptr;
- for (auto &&cam : sCameraList) {
- if (cam.desc.v1.cameraId == cameraId) {
- // Found a match!
- pRecord = &cam;
- break;
- }
- }
+Return<sp<IEvsCamera>> EvsEnumerator::openCamera_1_1(const hidl_string& cameraId,
+ const Stream& streamCfg) {
+ ALOGD("%s", __FUNCTION__);
- // Is this a recognized camera id?
- if (!pRecord) {
+ // Find the named camera
+ auto it = std::find_if(sCameraList.begin(), sCameraList.end(), [&cameraId](const auto& cam) {
+ return cameraId == cam.desc.v1.cameraId;
+ });
+ if (it == sCameraList.end()) {
ALOGE("Requested camera %s not found", cameraId.c_str());
return nullptr;
}
// Has this camera already been instantiated by another caller?
- sp<EvsCamera> pActiveCamera = pRecord->activeInstance.promote();
+ sp<EvsCamera> pActiveCamera = it->activeInstance.promote();
if (pActiveCamera != nullptr) {
ALOGW("Killing previous camera because of new caller");
closeCamera(pActiveCamera);
}
// Construct a camera instance for the caller
- if (sConfigManager == nullptr) {
+ if (!sConfigManager) {
pActiveCamera = EvsCamera::Create(cameraId.c_str());
} else {
- pActiveCamera = EvsCamera::Create(cameraId.c_str(),
- sConfigManager->getCameraInfo(cameraId),
+ pActiveCamera = EvsCamera::Create(cameraId.c_str(), sConfigManager->getCameraInfo(cameraId),
&streamCfg);
}
- pRecord->activeInstance = pActiveCamera;
- if (pActiveCamera == nullptr) {
+ it->activeInstance = pActiveCamera;
+ if (!pActiveCamera) {
ALOGE("Failed to allocate new EvsCamera object for %s\n", cameraId.c_str());
}
return pActiveCamera;
}
-
EvsEnumerator::CameraRecord* EvsEnumerator::findCameraById(const std::string& cameraId) {
- // Find the named camera
- CameraRecord *pRecord = nullptr;
- for (auto &&cam : sCameraList) {
- if (cam.desc.v1.cameraId == cameraId) {
- // Found a match!
- pRecord = &cam;
- break;
- }
- }
+ ALOGD("%s", __FUNCTION__);
- return pRecord;
+ // Find the named camera
+ auto it = std::find_if(sCameraList.begin(), sCameraList.end(), [&cameraId](const auto& cam) {
+ return cameraId == cam.desc.v1.cameraId;
+ });
+ return (it != sCameraList.end()) ? &*it : nullptr;
}
EvsEnumerator::UltrasonicsArrayRecord* EvsEnumerator::findUltrasonicsArrayById(
const std::string& ultrasonicsArrayId) {
- auto recordIt = std::find_if(
- sUltrasonicsArrayRecordList.begin(), sUltrasonicsArrayRecordList.end(),
- [&ultrasonicsArrayId](const UltrasonicsArrayRecord& record) {
- return ultrasonicsArrayId == record.desc.ultrasonicsArrayId;});
+ ALOGD("%s", __FUNCTION__);
+
+ auto recordIt =
+ std::find_if(sUltrasonicsArrayRecordList.begin(), sUltrasonicsArrayRecordList.end(),
+ [&ultrasonicsArrayId](const UltrasonicsArrayRecord& record) {
+ return ultrasonicsArrayId == record.desc.ultrasonicsArrayId;
+ });
return (recordIt != sUltrasonicsArrayRecordList.end()) ? &*recordIt : nullptr;
}
Return<void> EvsEnumerator::getUltrasonicsArrayList(getUltrasonicsArrayList_cb _hidl_cb) {
+ ALOGD("%s", __FUNCTION__);
+
hidl_vec<UltrasonicsArrayDesc> desc;
desc.resize(sUltrasonicsArrayRecordList.size());
// Copy over desc from sUltrasonicsArrayRecordList.
for (auto p = std::make_pair(sUltrasonicsArrayRecordList.begin(), desc.begin());
- p.first != sUltrasonicsArrayRecordList.end(); p.first++, p.second++) {
+ p.first != sUltrasonicsArrayRecordList.end(); p.first++, p.second++) {
*p.second = p.first->desc;
}
@@ -385,11 +355,13 @@
_hidl_cb(desc);
// HIDL convention says we return Void if we sent our result back via callback
- return Void();
+ return {};
}
Return<sp<IEvsUltrasonicsArray>> EvsEnumerator::openUltrasonicsArray(
const hidl_string& ultrasonicsArrayId) {
+ ALOGD("%s", __FUNCTION__);
+
// Find the named ultrasonic array.
UltrasonicsArrayRecord* pRecord = findUltrasonicsArrayById(ultrasonicsArrayId);
@@ -419,10 +391,11 @@
Return<void> EvsEnumerator::closeUltrasonicsArray(
const sp<IEvsUltrasonicsArray>& pEvsUltrasonicsArray) {
+ ALOGD("%s", __FUNCTION__);
if (pEvsUltrasonicsArray.get() == nullptr) {
ALOGE("Ignoring call to closeUltrasonicsArray with null ultrasonics array");
- return Void();
+ return {};
}
// Get the ultrasonics array id so we can find it in our list.
@@ -435,7 +408,7 @@
UltrasonicsArrayRecord* pRecord = findUltrasonicsArrayById(ultrasonicsArrayId);
if (!pRecord) {
ALOGE("Asked to close a ultrasonics array whose name isnt not found");
- return Void();
+ return {};
}
sp<EvsUltrasonicsArray> pActiveUltrasonicsArray = pRecord->activeInstance.promote();
@@ -453,12 +426,7 @@
pRecord->activeInstance = nullptr;
}
- return Void();
+ return {};
}
-} // namespace implementation
-} // namespace V1_1
-} // namespace evs
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::evs::V1_1::implementation
diff --git a/automotive/evs/1.1/default/EvsEnumerator.h b/automotive/evs/1.1/default/EvsEnumerator.h
index d80124b..513fc8d 100644
--- a/automotive/evs/1.1/default/EvsEnumerator.h
+++ b/automotive/evs/1.1/default/EvsEnumerator.h
@@ -17,56 +17,41 @@
#ifndef ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSCAMERAENUMERATOR_H
#define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSCAMERAENUMERATOR_H
-#include <android/hardware/automotive/evs/1.1/IEvsEnumerator.h>
+#include "ConfigManager.h"
+
+#include <android/frameworks/automotive/display/1.0/IAutomotiveDisplayProxyService.h>
#include <android/hardware/automotive/evs/1.1/IEvsCamera.h>
#include <android/hardware/automotive/evs/1.1/IEvsDisplay.h>
-#include <android/frameworks/automotive/display/1.0/IAutomotiveDisplayProxyService.h>
+#include <android/hardware/automotive/evs/1.1/IEvsEnumerator.h>
#include <android/hardware/automotive/evs/1.1/IEvsUltrasonicsArray.h>
#include <list>
-#include "ConfigManager.h"
+namespace android::hardware::automotive::evs::V1_1::implementation {
-using ::android::hardware::automotive::evs::V1_0::EvsResult;
-using ::android::hardware::automotive::evs::V1_0::DisplayState;
-using IEvsCamera_1_0 = ::android::hardware::automotive::evs::V1_0::IEvsCamera;
-using IEvsCamera_1_1 = ::android::hardware::automotive::evs::V1_1::IEvsCamera;
-using CameraDesc_1_0 = ::android::hardware::automotive::evs::V1_0::CameraDesc;
-using CameraDesc_1_1 = ::android::hardware::automotive::evs::V1_1::CameraDesc;
-using IEvsDisplay_1_0 = ::android::hardware::automotive::evs::V1_0::IEvsDisplay;
-using IEvsDisplay_1_1 = ::android::hardware::automotive::evs::V1_1::IEvsDisplay;
-using android::frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService;
+namespace evs_v1_0 = ::android::hardware::automotive::evs::V1_0;
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace evs {
-namespace V1_1 {
-namespace implementation {
-
-
-class EvsCamera; // from EvsCamera.h
-class EvsDisplay; // from EvsDisplay.h
+class EvsCamera; // from EvsCamera.h
+class EvsDisplay; // from EvsDisplay.h
class EvsUltrasonicsArray; // from EvsUltrasonicsArray.h
-
class EvsEnumerator : public IEvsEnumerator {
-public:
+ public:
// Methods from ::android::hardware::automotive::evs::V1_0::IEvsEnumerator follow.
- Return<void> getCameraList(getCameraList_cb _hidl_cb) override;
- Return<sp<IEvsCamera_1_0>> openCamera(const hidl_string& cameraId) override;
- Return<void> closeCamera(const ::android::sp<IEvsCamera_1_0>& carCamera) override;
- Return<sp<IEvsDisplay_1_0>> openDisplay() override;
- Return<void> closeDisplay(const ::android::sp<IEvsDisplay_1_0>& display) override;
- Return<DisplayState> getDisplayState() override;
+ Return<void> getCameraList(getCameraList_cb _hidl_cb) override;
+ Return<sp<evs_v1_0::IEvsCamera>> openCamera(const hidl_string& cameraId) override;
+ Return<void> closeCamera(const ::android::sp<evs_v1_0::IEvsCamera>& carCamera) override;
+ Return<sp<evs_v1_0::IEvsDisplay>> openDisplay() override;
+ Return<void> closeDisplay(const ::android::sp<evs_v1_0::IEvsDisplay>& display) override;
+ Return<V1_0::DisplayState> getDisplayState() override;
// Methods from ::android::hardware::automotive::evs::V1_1::IEvsEnumerator follow.
- Return<void> getCameraList_1_1(getCameraList_1_1_cb _hidl_cb) override;
- Return<sp<IEvsCamera_1_1>> openCamera_1_1(const hidl_string& cameraId,
- const Stream& streamCfg) override;
+ Return<void> getCameraList_1_1(getCameraList_1_1_cb _hidl_cb) override;
+ Return<sp<IEvsCamera>> openCamera_1_1(const hidl_string& cameraId,
+ const Stream& streamCfg) override;
Return<bool> isHardware() override { return true; }
- Return<void> getDisplayIdList(getDisplayIdList_cb _list_cb) override;
- Return<sp<IEvsDisplay_1_1>> openDisplay_1_1(uint8_t port) override;
+ Return<void> getDisplayIdList(getDisplayIdList_cb _list_cb) override;
+ Return<sp<IEvsDisplay>> openDisplay_1_1(uint8_t port) override;
Return<void> getUltrasonicsArrayList(getUltrasonicsArrayList_cb _hidl_cb) override;
Return<sp<IEvsUltrasonicsArray>> openUltrasonicsArray(
const hidl_string& ultrasonicsArrayId) override;
@@ -74,49 +59,40 @@
const ::android::sp<IEvsUltrasonicsArray>& evsUltrasonicsArray) override;
// Implementation details
- EvsEnumerator(sp<IAutomotiveDisplayProxyService> windowService = nullptr);
+ EvsEnumerator(sp<frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService>&
+ windowService);
-private:
+ private:
// NOTE: All members values are static so that all clients operate on the same state
// That is to say, this is effectively a singleton despite the fact that HIDL
// constructs a new instance for each client.
struct CameraRecord {
- CameraDesc_1_1 desc;
- wp<EvsCamera> activeInstance;
+ CameraDesc desc;
+ wp<EvsCamera> activeInstance;
- CameraRecord(const char *cameraId) : desc() { desc.v1.cameraId = cameraId; }
+ CameraRecord(const char* cameraId) : desc() { desc.v1.cameraId = cameraId; }
};
struct UltrasonicsArrayRecord {
UltrasonicsArrayDesc desc;
wp<EvsUltrasonicsArray> activeInstance;
- UltrasonicsArrayRecord(const UltrasonicsArrayDesc& arrayDesc) : desc(arrayDesc) {};
+ UltrasonicsArrayRecord(const UltrasonicsArrayDesc& arrayDesc) : desc(arrayDesc){};
};
static CameraRecord* findCameraById(const std::string& cameraId);
-
- static std::list<CameraRecord> sCameraList;
-
+ static std::list<CameraRecord> sCameraList;
static UltrasonicsArrayRecord* findUltrasonicsArrayById(const std::string& ultrasonicsArrayId);
-
static std::list<UltrasonicsArrayRecord> sUltrasonicsArrayRecordList;
- // Weak pointer. Object destructs if client dies.
- static wp<EvsDisplay> sActiveDisplay;
-
- static unique_ptr<ConfigManager> sConfigManager;
-
- static sp<IAutomotiveDisplayProxyService> sDisplayProxyService;
- static std::unordered_map<uint8_t,
- uint64_t> sDisplayPortList;
+ static wp<EvsDisplay> sActiveDisplay; // Weak pointer. Object destructs if client dies.
+ static uint64_t sInternalDisplayId;
+ static sp<frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService>
+ sDisplayProxyService;
+ static std::unordered_map<uint8_t, uint64_t> sDisplayPortList;
+ static std::unique_ptr<ConfigManager> sConfigManager;
};
-} // namespace implementation
-} // namespace V1_1
-} // namespace evs
-} // namespace automotive
-} // namespace hardware
-} // namespace android
+} // namespace android::hardware::automotive::evs::V1_1::implementation
#endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSCAMERAENUMERATOR_H
diff --git a/automotive/evs/1.1/default/EvsUltrasonicsArray.cpp b/automotive/evs/1.1/default/EvsUltrasonicsArray.cpp
index ebd47c6..951937a 100644
--- a/automotive/evs/1.1/default/EvsUltrasonicsArray.cpp
+++ b/automotive/evs/1.1/default/EvsUltrasonicsArray.cpp
@@ -113,10 +113,9 @@
dataFrameDesc.receiversReadingsCountList = receiversReadingsCountList;
const std::vector<WaveformData> waveformDataList = {
- {recvIdList[0], { {1000, 0.1f}, {2000, 0.8f} }},
- {recvIdList[1], { {1000, 0.1f}, {2000, 1.0f} }},
- {recvIdList[2], { {1000, 0.1f}, {2000, 0.2f}, {4000, 0.2f}, {5000, 0.1f} }}
- };
+ {recvIdList[0], {{1000, 0.1f}, {2000, 0.8f}}},
+ {recvIdList[1], {{1000, 0.1f}, {2000, 1.0f}}},
+ {recvIdList[2], {{1000, 0.1f}, {2000, 0.2f}, {4000, 0.2f}, {5000, 0.1f}}}};
if (pIMemory.get() == nullptr) {
return false;
diff --git a/automotive/evs/1.1/default/EvsUltrasonicsArray.h b/automotive/evs/1.1/default/EvsUltrasonicsArray.h
index 88aa600..681f68f 100644
--- a/automotive/evs/1.1/default/EvsUltrasonicsArray.h
+++ b/automotive/evs/1.1/default/EvsUltrasonicsArray.h
@@ -119,7 +119,7 @@
std::mutex mAccessLock;
std::vector<DataFrameRecord> mDataFrames GUARDED_BY(mAccessLock); // Shared memory buffers.
unsigned mFramesAllowed GUARDED_BY(mAccessLock); // How many buffers are we currently using.
- unsigned mFramesInUse GUARDED_BY(mAccessLock); // How many buffers are currently outstanding.
+ unsigned mFramesInUse GUARDED_BY(mAccessLock); // How many buffers are currently outstanding.
StreamStateValues mStreamState GUARDED_BY(mAccessLock);
};
diff --git a/automotive/evs/1.1/default/GlWrapper.cpp b/automotive/evs/1.1/default/GlWrapper.cpp
new file mode 100644
index 0000000..357b67c
--- /dev/null
+++ b/automotive/evs/1.1/default/GlWrapper.cpp
@@ -0,0 +1,450 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "GlWrapper.h"
+
+#include <ui/DisplayMode.h>
+#include <ui/DisplayState.h>
+#include <ui/GraphicBuffer.h>
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include <utility>
+
+using android::GraphicBuffer;
+using android::sp;
+
+namespace {
+
+// Defines a default color to clear the screen in RGBA format
+constexpr float kDefaultColorInRgba[] = {0.1f, 0.5f, 0.1f, 1.0f};
+
+// Defines the size of the preview area relative to the entire display
+constexpr float kDisplayAreaRatio = 0.8f;
+
+constexpr const char vertexShaderSource[] =
+ ""
+ "#version 300 es \n"
+ "layout(location = 0) in vec4 pos; \n"
+ "layout(location = 1) in vec2 tex; \n"
+ "out vec2 uv; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_Position = pos; \n"
+ " uv = tex; \n"
+ "} \n";
+
+constexpr const char pixelShaderSource[] =
+ "#version 300 es \n"
+ "precision mediump float; \n"
+ "uniform sampler2D tex; \n"
+ "in vec2 uv; \n"
+ "out vec4 color; \n"
+ "void main() \n"
+ "{ \n"
+ " vec4 texel = texture(tex, uv); \n"
+ " color = texel; \n"
+ "} \n";
+
+const char* getEGLError(void) {
+ switch (eglGetError()) {
+ case EGL_SUCCESS:
+ return "EGL_SUCCESS";
+ case EGL_NOT_INITIALIZED:
+ return "EGL_NOT_INITIALIZED";
+ case EGL_BAD_ACCESS:
+ return "EGL_BAD_ACCESS";
+ case EGL_BAD_ALLOC:
+ return "EGL_BAD_ALLOC";
+ case EGL_BAD_ATTRIBUTE:
+ return "EGL_BAD_ATTRIBUTE";
+ case EGL_BAD_CONTEXT:
+ return "EGL_BAD_CONTEXT";
+ case EGL_BAD_CONFIG:
+ return "EGL_BAD_CONFIG";
+ case EGL_BAD_CURRENT_SURFACE:
+ return "EGL_BAD_CURRENT_SURFACE";
+ case EGL_BAD_DISPLAY:
+ return "EGL_BAD_DISPLAY";
+ case EGL_BAD_SURFACE:
+ return "EGL_BAD_SURFACE";
+ case EGL_BAD_MATCH:
+ return "EGL_BAD_MATCH";
+ case EGL_BAD_PARAMETER:
+ return "EGL_BAD_PARAMETER";
+ case EGL_BAD_NATIVE_PIXMAP:
+ return "EGL_BAD_NATIVE_PIXMAP";
+ case EGL_BAD_NATIVE_WINDOW:
+ return "EGL_BAD_NATIVE_WINDOW";
+ case EGL_CONTEXT_LOST:
+ return "EGL_CONTEXT_LOST";
+ default:
+ return "Unknown error";
+ }
+}
+
+// Given shader source, load and compile it
+GLuint loadShader(GLenum type, const char* shaderSrc) {
+ // Create the shader object
+ GLuint shader = glCreateShader(type);
+ if (shader == 0) {
+ LOG(ERROR) << "glCreateSharder() failed with error = " << glGetError();
+ return 0;
+ }
+
+ // Load and compile the shader
+ glShaderSource(shader, 1, &shaderSrc, nullptr);
+ glCompileShader(shader);
+
+ // Verify the compilation worked as expected
+ GLint compiled = 0;
+ glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
+ if (!compiled) {
+ LOG(ERROR) << "Error compiling shader";
+
+ GLint size = 0;
+ glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &size);
+ if (size > 0) {
+ // Get and report the error message
+ char infoLog[size];
+ glGetShaderInfoLog(shader, size, nullptr, infoLog);
+ LOG(ERROR) << " msg:" << std::endl << infoLog;
+ }
+
+ glDeleteShader(shader);
+ return 0;
+ }
+
+ return shader;
+}
+
+// Create a program object given vertex and pixels shader source
+GLuint buildShaderProgram(const char* vtxSrc, const char* pxlSrc) {
+ GLuint program = glCreateProgram();
+ if (program == 0) {
+ LOG(ERROR) << "Failed to allocate program object";
+ return 0;
+ }
+
+ // Compile the shaders and bind them to this program
+ GLuint vertexShader = loadShader(GL_VERTEX_SHADER, vtxSrc);
+ if (vertexShader == 0) {
+ LOG(ERROR) << "Failed to load vertex shader";
+ glDeleteProgram(program);
+ return 0;
+ }
+ GLuint pixelShader = loadShader(GL_FRAGMENT_SHADER, pxlSrc);
+ if (pixelShader == 0) {
+ LOG(ERROR) << "Failed to load pixel shader";
+ glDeleteProgram(program);
+ glDeleteShader(vertexShader);
+ return 0;
+ }
+ glAttachShader(program, vertexShader);
+ glAttachShader(program, pixelShader);
+
+ // Link the program
+ glLinkProgram(program);
+ GLint linked = 0;
+ glGetProgramiv(program, GL_LINK_STATUS, &linked);
+ if (!linked) {
+ LOG(ERROR) << "Error linking program";
+ GLint size = 0;
+ glGetProgramiv(program, GL_INFO_LOG_LENGTH, &size);
+ if (size > 0) {
+ // Get and report the error message
+ char* infoLog = (char*)malloc(size);
+ glGetProgramInfoLog(program, size, nullptr, infoLog);
+ LOG(ERROR) << " msg: " << infoLog;
+ free(infoLog);
+ }
+
+ glDeleteProgram(program);
+ glDeleteShader(vertexShader);
+ glDeleteShader(pixelShader);
+ return 0;
+ }
+
+ return program;
+}
+
+} // namespace
+
+namespace android::hardware::automotive::evs::V1_1::implementation {
+
+// Main entry point
+bool GlWrapper::initialize(const sp<IAutomotiveDisplayProxyService>& service, uint64_t displayId) {
+ LOG(DEBUG) << __FUNCTION__;
+
+ if (!service) {
+ LOG(WARNING) << "IAutomotiveDisplayProxyService is invalid.";
+ return false;
+ }
+
+ // We will use the first display in the list as the primary.
+ service->getDisplayInfo(displayId, [this](auto dpyConfig, auto dpyState) {
+ ui::DisplayMode* pConfig = reinterpret_cast<ui::DisplayMode*>(dpyConfig.data());
+ mWidth = pConfig->resolution.getWidth();
+ mHeight = pConfig->resolution.getHeight();
+
+ ui::DisplayState* pState = reinterpret_cast<ui::DisplayState*>(dpyState.data());
+ if (pState->orientation != ui::ROTATION_0 && pState->orientation != ui::ROTATION_180) {
+ // rotate
+ std::swap(mWidth, mHeight);
+ }
+
+ LOG(DEBUG) << "Display resolution is " << mWidth << " x " << mHeight;
+ });
+
+ mGfxBufferProducer = service->getIGraphicBufferProducer(displayId);
+ if (mGfxBufferProducer == nullptr) {
+ LOG(ERROR) << "Failed to get IGraphicBufferProducer from IAutomotiveDisplayProxyService.";
+ return false;
+ }
+
+ mSurfaceHolder = getSurfaceFromHGBP(mGfxBufferProducer);
+ if (mSurfaceHolder == nullptr) {
+ LOG(ERROR) << "Failed to get a Surface from HGBP.";
+ return false;
+ }
+
+ mWindow = getNativeWindow(mSurfaceHolder.get());
+ if (mWindow == nullptr) {
+ LOG(ERROR) << "Failed to get a native window from Surface.";
+ return false;
+ }
+
+ // Set up our OpenGL ES context associated with the default display
+ mDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+ if (mDisplay == EGL_NO_DISPLAY) {
+ LOG(ERROR) << "Failed to get egl display";
+ return false;
+ }
+
+ EGLint major = 3;
+ EGLint minor = 0;
+ if (!eglInitialize(mDisplay, &major, &minor)) {
+ LOG(ERROR) << "Failed to initialize EGL: " << getEGLError();
+ return false;
+ }
+
+ const EGLint config_attribs[] = {
+ // Tag Value
+ EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_DEPTH_SIZE, 0, EGL_NONE};
+
+ // Pick the default configuration without constraints (is this good enough?)
+ EGLConfig egl_config = {0};
+ EGLint numConfigs = -1;
+ eglChooseConfig(mDisplay, config_attribs, &egl_config, 1, &numConfigs);
+ if (numConfigs != 1) {
+ LOG(ERROR) << "Didn't find a suitable format for our display window";
+ return false;
+ }
+
+ // Create the EGL render target surface
+ mSurface = eglCreateWindowSurface(mDisplay, egl_config, mWindow, nullptr);
+ if (mSurface == EGL_NO_SURFACE) {
+ LOG(ERROR) << "eglCreateWindowSurface failed: " << getEGLError();
+ ;
+ return false;
+ }
+
+ // Create the EGL context
+ // NOTE: Our shader is (currently at least) written to require version 3, so this
+ // is required.
+ const EGLint context_attribs[] = {EGL_CONTEXT_CLIENT_VERSION, 3, EGL_NONE};
+ mContext = eglCreateContext(mDisplay, egl_config, EGL_NO_CONTEXT, context_attribs);
+ if (mContext == EGL_NO_CONTEXT) {
+ LOG(ERROR) << "Failed to create OpenGL ES Context: " << getEGLError();
+ return false;
+ }
+
+ // Activate our render target for drawing
+ if (!eglMakeCurrent(mDisplay, mSurface, mSurface, mContext)) {
+ LOG(ERROR) << "Failed to make the OpenGL ES Context current: " << getEGLError();
+ return false;
+ }
+
+ // Create the shader program for our simple pipeline
+ mShaderProgram = buildShaderProgram(vertexShaderSource, pixelShaderSource);
+ if (!mShaderProgram) {
+ LOG(ERROR) << "Failed to build shader program: " << getEGLError();
+ return false;
+ }
+
+ // Create a GL texture that will eventually wrap our externally created texture surface(s)
+ glGenTextures(1, &mTextureMap);
+ if (mTextureMap <= 0) {
+ LOG(ERROR) << "Didn't get a texture handle allocated: " << getEGLError();
+ return false;
+ }
+
+ // Turn off mip-mapping for the created texture surface
+ // (the inbound camera imagery doesn't have MIPs)
+ glBindTexture(GL_TEXTURE_2D, mTextureMap);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glBindTexture(GL_TEXTURE_2D, 0);
+
+ return true;
+}
+
+void GlWrapper::shutdown() {
+ // Drop our device textures
+ if (mKHRimage != EGL_NO_IMAGE_KHR) {
+ eglDestroyImageKHR(mDisplay, mKHRimage);
+ mKHRimage = EGL_NO_IMAGE_KHR;
+ }
+
+ // Release all GL resources
+ eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+ eglDestroySurface(mDisplay, mSurface);
+ eglDestroyContext(mDisplay, mContext);
+ eglTerminate(mDisplay);
+ mSurface = EGL_NO_SURFACE;
+ mContext = EGL_NO_CONTEXT;
+ mDisplay = EGL_NO_DISPLAY;
+
+ // Release the window
+ mSurfaceHolder = nullptr;
+}
+
+void GlWrapper::showWindow(sp<IAutomotiveDisplayProxyService>& service, uint64_t id) {
+ if (service != nullptr) {
+ service->showWindow(id);
+ } else {
+ LOG(ERROR) << "IAutomotiveDisplayProxyService is not available.";
+ }
+}
+
+void GlWrapper::hideWindow(sp<IAutomotiveDisplayProxyService>& service, uint64_t id) {
+ if (service != nullptr) {
+ service->hideWindow(id);
+ } else {
+ LOG(ERROR) << "IAutomotiveDisplayProxyService is not available.";
+ }
+}
+
+bool GlWrapper::updateImageTexture(const V1_0::BufferDesc& buffer) {
+ BufferDesc newBuffer = {
+ .buffer =
+ {
+ .nativeHandle = buffer.memHandle,
+ },
+ .pixelSize = buffer.pixelSize,
+ .bufferId = buffer.bufferId,
+ };
+ AHardwareBuffer_Desc* pDesc =
+ reinterpret_cast<AHardwareBuffer_Desc*>(&newBuffer.buffer.description);
+ *pDesc = {
+ .width = buffer.width,
+ .height = buffer.height,
+ .layers = 1,
+ .format = buffer.format,
+ .usage = buffer.usage,
+ };
+ return updateImageTexture(newBuffer);
+}
+
+bool GlWrapper::updateImageTexture(const BufferDesc& aFrame) {
+ // If we haven't done it yet, create an "image" object to wrap the gralloc buffer
+ if (mKHRimage == EGL_NO_IMAGE_KHR) {
+ // create a temporary GraphicBuffer to wrap the provided handle
+ const AHardwareBuffer_Desc* pDesc =
+ reinterpret_cast<const AHardwareBuffer_Desc*>(&aFrame.buffer.description);
+ sp<GraphicBuffer> pGfxBuffer = new GraphicBuffer(
+ pDesc->width, pDesc->height, pDesc->format, pDesc->layers, pDesc->usage,
+ pDesc->stride,
+ const_cast<native_handle_t*>(aFrame.buffer.nativeHandle.getNativeHandle()),
+ false /* keep ownership */
+ );
+ if (pGfxBuffer.get() == nullptr) {
+ LOG(ERROR) << "Failed to allocate GraphicBuffer to wrap our native handle";
+ return false;
+ }
+
+ // Get a GL compatible reference to the graphics buffer we've been given
+ EGLint eglImageAttributes[] = {EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE};
+ EGLClientBuffer cbuf = static_cast<EGLClientBuffer>(pGfxBuffer->getNativeBuffer());
+ mKHRimage = eglCreateImageKHR(mDisplay, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID, cbuf,
+ eglImageAttributes);
+ if (mKHRimage == EGL_NO_IMAGE_KHR) {
+ LOG(ERROR) << "Error creating EGLImage: " << getEGLError();
+ return false;
+ }
+
+ // Update the texture handle we already created to refer to this gralloc buffer
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, mTextureMap);
+ glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, static_cast<GLeglImageOES>(mKHRimage));
+ }
+
+ return true;
+}
+
+void GlWrapper::renderImageToScreen() {
+ // Set the viewport
+ glViewport(0, 0, mWidth, mHeight);
+
+ // Clear the color buffer
+ glClearColor(kDefaultColorInRgba[0], kDefaultColorInRgba[1],
+ kDefaultColorInRgba[2], kDefaultColorInRgba[3]);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ // Select our screen space simple texture shader
+ glUseProgram(mShaderProgram);
+
+ // Bind the texture and assign it to the shader's sampler
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, mTextureMap);
+ GLint sampler = glGetUniformLocation(mShaderProgram, "tex");
+ glUniform1i(sampler, 0);
+
+ // We want our image to show up opaque regardless of alpha values
+ glDisable(GL_BLEND);
+
+ // Draw a rectangle on the screen
+ GLfloat vertsCarPos[] = {
+ -kDisplayAreaRatio, kDisplayAreaRatio, 0.0f, // left top in window space
+ kDisplayAreaRatio, kDisplayAreaRatio, 0.0f, // right top
+ -kDisplayAreaRatio, -kDisplayAreaRatio, 0.0f, // left bottom
+ kDisplayAreaRatio, -kDisplayAreaRatio, 0.0f // right bottom
+ };
+
+ // NOTE: We didn't flip the image in the texture, so V=0 is actually the top of the image
+ GLfloat vertsCarTex[] = {
+ 0.0f, 0.0f, // left top
+ 1.0f, 0.0f, // right top
+ 0.0f, 1.0f, // left bottom
+ 1.0f, 1.0f // right bottom
+ };
+ glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, vertsCarPos);
+ glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, vertsCarTex);
+ glEnableVertexAttribArray(0);
+ glEnableVertexAttribArray(1);
+
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+
+ // Clean up and flip the rendered result to the front so it is visible
+ glDisableVertexAttribArray(0);
+ glDisableVertexAttribArray(1);
+
+ glFinish();
+
+ eglSwapBuffers(mDisplay, mSurface);
+}
+
+} // namespace android::hardware::automotive::evs::V1_1::implementation
diff --git a/automotive/evs/1.1/default/GlWrapper.h b/automotive/evs/1.1/default/GlWrapper.h
new file mode 100644
index 0000000..44c206f
--- /dev/null
+++ b/automotive/evs/1.1/default/GlWrapper.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_DISPLAY_GLWRAPPER_H
+#define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_DISPLAY_GLWRAPPER_H
+
+#include <android-base/logging.h>
+#include <android/frameworks/automotive/display/1.0/IAutomotiveDisplayProxyService.h>
+#include <android/hardware/automotive/evs/1.1/types.h>
+#include <bufferqueueconverter/BufferQueueConverter.h>
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#include <GLES3/gl3.h>
+#include <GLES3/gl3ext.h>
+
+namespace android::hardware::automotive::evs::V1_1::implementation {
+
+using frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService;
+using hardware::graphics::bufferqueue::V2_0::IGraphicBufferProducer;
+
+class GlWrapper {
+ public:
+ GlWrapper() : mSurfaceHolder(android::SurfaceHolderUniquePtr(nullptr, nullptr)) {}
+ bool initialize(const sp<IAutomotiveDisplayProxyService>& service, uint64_t displayId);
+ void shutdown();
+
+ bool updateImageTexture(const V1_0::BufferDesc& buffer);
+ bool updateImageTexture(const BufferDesc& buffer);
+ void renderImageToScreen();
+
+ void showWindow(sp<IAutomotiveDisplayProxyService>& service, uint64_t id);
+ void hideWindow(sp<IAutomotiveDisplayProxyService>& service, uint64_t id);
+
+ unsigned getWidth() { return mWidth; };
+ unsigned getHeight() { return mHeight; };
+
+ private:
+ sp<IGraphicBufferProducer> mGfxBufferProducer;
+
+ EGLDisplay mDisplay;
+ EGLSurface mSurface;
+ EGLContext mContext;
+
+ unsigned mWidth = 0;
+ unsigned mHeight = 0;
+
+ EGLImageKHR mKHRimage = EGL_NO_IMAGE_KHR;
+
+ GLuint mTextureMap = 0;
+ GLuint mShaderProgram = 0;
+
+ // Opaque handle for a native hardware buffer defined in
+ // frameworks/native/opengl/include/EGL/eglplatform.h
+ ANativeWindow* mWindow;
+
+ // Pointer to a Surface wrapper.
+ android::SurfaceHolderUniquePtr mSurfaceHolder;
+};
+
+} // namespace android::hardware::automotive::evs::V1_1::implementation
+
+#endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_DISPLAY_GLWRAPPER_H
diff --git a/automotive/evs/1.1/default/android.hardware.automotive.evs@1.1-service.rc b/automotive/evs/1.1/default/android.hardware.automotive.evs@1.1-service.rc
index 284b3fd..5d4daf9 100644
--- a/automotive/evs/1.1/default/android.hardware.automotive.evs@1.1-service.rc
+++ b/automotive/evs/1.1/default/android.hardware.automotive.evs@1.1-service.rc
@@ -1,5 +1,8 @@
service vendor.evs-hal-mock /vendor/bin/hw/android.hardware.automotive.evs@1.1-service
class hal
- user automotive_evs
- group automotive_evs
- disabled
+ priority -20
+ user graphics
+ group automotive_evs camera
+ onrestart restart automotive_display
+ onrestart restart evs_manager
+ disabled # will not automatically start with its class; must be explicitly started.
diff --git a/automotive/evs/1.1/default/manifest_android.hardware.automotive.evs@1.1-service.xml b/automotive/evs/1.1/default/manifest_android.hardware.automotive.evs@1.1-service.xml
index d4d9b17..d975701 100644
--- a/automotive/evs/1.1/default/manifest_android.hardware.automotive.evs@1.1-service.xml
+++ b/automotive/evs/1.1/default/manifest_android.hardware.automotive.evs@1.1-service.xml
@@ -15,12 +15,8 @@
-->
<manifest version="1.0" type="device" >
<hal format="hidl">
- <name>android.hardware.automotive.evs</name>
<transport>hwbinder</transport>
- <version>1.1</version>
- <interface>
- <name>IEvsEnumerator</name>
- <instance>hw/0</instance>
- </interface>
+ <name>android.hardware.automotive.evs</name>
+ <fqname>@1.1::IEvsEnumerator/hw/0</fqname>
</hal>
</manifest>
diff --git a/automotive/evs/1.1/default/resources/evs_default_configuration.xml b/automotive/evs/1.1/default/resources/evs_default_configuration.xml
index a79e7c2..6cbc18e 100644
--- a/automotive/evs/1.1/default/resources/evs_default_configuration.xml
+++ b/automotive/evs/1.1/default/resources/evs_default_configuration.xml
@@ -30,31 +30,8 @@
<!-- camera information -->
<camera>
- <!-- camera group starts -->
- <group id='group1' synchronized='APPROXIMATE'>
- <caps>
- <stream id='0' width='640' height='360' format='RGBA_8888' framerate='30'/>
- </caps>
-
- <!-- list of parameters -->
- <characteristics>
- <parameter
- name='REQUEST_AVAILABLE_CAPABILITIES'
- type='enum'
- size='1'
- value='LOGICAL_MULTI_CAMERA'
- />
- <parameter
- name='LOGICAL_MULTI_CAMERA_PHYSICAL_IDS'
- type='byte[]'
- size='1'
- value='/dev/video1'
- />
- </characteristics>
- </group>
-
<!-- camera device starts -->
- <device id='/dev/video1' position='rear'>
+ <device id='/dev/video10' position='rear'>
<caps>
<!-- list of supported controls -->
<supported_controls>
diff --git a/automotive/evs/1.1/default/service.cpp b/automotive/evs/1.1/default/service.cpp
index 374b646..2764a26 100644
--- a/automotive/evs/1.1/default/service.cpp
+++ b/automotive/evs/1.1/default/service.cpp
@@ -14,42 +14,42 @@
* limitations under the License.
*/
-#define LOG_TAG "android.hardware.automotive.evs@1.1-service"
-
-#include <unistd.h>
+#include "EvsDisplay.h"
+#include "EvsEnumerator.h"
+#include "ServiceNames.h"
#include <hidl/HidlTransportSupport.h>
#include <log/log.h>
#include <utils/Errors.h>
#include <utils/StrongPointer.h>
-#include "ServiceNames.h"
-#include "EvsEnumerator.h"
-#include "EvsDisplay.h"
+#include <unistd.h>
-
-// libhidl:
+using android::frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService;
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
-
-// Generated HIDL files
+using android::hardware::automotive::evs::V1_0::DisplayState;
using android::hardware::automotive::evs::V1_1::IEvsEnumerator;
-
-// The namespace in which all our implementation code lives
-using namespace android::hardware::automotive::evs::V1_1::implementation;
-using namespace android;
-
+using android::hardware::automotive::evs::V1_1::implementation::EvsEnumerator;
int main() {
ALOGI("EVS Hardware Enumerator service is starting");
- android::sp<IEvsEnumerator> service = new EvsEnumerator();
+
+ android::sp<IAutomotiveDisplayProxyService> carWindowService =
+ IAutomotiveDisplayProxyService::getService("default");
+ if (carWindowService == nullptr) {
+ ALOGE("Cannot use AutomotiveDisplayProxyService. Exiting.");
+ return EXIT_FAILURE;
+ }
+
+ android::sp<IEvsEnumerator> service = new EvsEnumerator(carWindowService);
configureRpcThreadpool(1, true /* callerWillJoin */);
// Register our service -- if somebody is already registered by our name,
// they will be killed (their thread pool will throw an exception).
- status_t status = service->registerAsService(kEnumeratorServiceName);
- if (status == OK) {
+ auto status = service->registerAsService(kEnumeratorServiceName);
+ if (status == android::OK) {
ALOGD("%s is ready.", kEnumeratorServiceName);
joinRpcThreadpool();
} else {
@@ -58,5 +58,5 @@
// In normal operation, we don't expect the thread pool to exit
ALOGE("EVS Hardware Enumerator is shutting down");
- return 1;
+ return EXIT_SUCCESS;
}
diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl
index a79c68d..225b504 100644
--- a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl
+++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl
@@ -44,7 +44,7 @@
android.hardware.automotive.evs.UltrasonicsArrayDesc[] getUltrasonicsArrayList();
boolean isHardware();
android.hardware.automotive.evs.IEvsCamera openCamera(in String cameraId, in android.hardware.automotive.evs.Stream streamCfg);
- android.hardware.automotive.evs.IEvsDisplay openDisplay(in byte id);
+ android.hardware.automotive.evs.IEvsDisplay openDisplay(in int id);
android.hardware.automotive.evs.IEvsUltrasonicsArray openUltrasonicsArray(in String ultrasonicsArrayId);
void registerStatusCallback(in android.hardware.automotive.evs.IEvsEnumeratorStatusCallback callback);
}
diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl
index 8e380e0..8698700 100644
--- a/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl
+++ b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl
@@ -146,7 +146,7 @@
* @return EvsDisplay object to be used.
* @throws EvsResult::INVALID_ARG if no display with a given id exists
*/
- IEvsDisplay openDisplay(in byte id);
+ IEvsDisplay openDisplay(in int id);
/**
* Gets the IEvsUltrasonicsArray associated with a ultrasonicsArrayId from a
diff --git a/automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h b/automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h
index 8bcd867..03a578d 100644
--- a/automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h
+++ b/automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h
@@ -37,7 +37,7 @@
const ::aidl::android::hardware::automotive::evs::CameraDesc& desc,
std::vector<::aidl::android::hardware::automotive::evs::Stream>* _aidl_return) override;
::ndk::ScopedAStatus openDisplay(
- int8_t displayId,
+ int32_t displayId,
std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsDisplay>* obj) override;
::ndk::ScopedAStatus closeDisplay(
const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsDisplay>& obj)
diff --git a/automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp b/automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp
index 2ff6d59..5a81d05 100644
--- a/automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp
+++ b/automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp
@@ -51,7 +51,7 @@
return ScopedAStatus::ok();
}
-ScopedAStatus DefaultEvsEnumerator::openDisplay(int8_t displayId,
+ScopedAStatus DefaultEvsEnumerator::openDisplay(int32_t displayId,
std::shared_ptr<IEvsDisplay>* obj) {
return ScopedAStatus::ok();
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvChargeState.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvChargeState.aidl
index 5395b11..fe1c240 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvChargeState.aidl
@@ -31,13 +31,12 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.automotive.vehicle;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum EvChargeState {
+ UNKNOWN = 0,
+ CHARGING = 1,
+ FULLY_CHARGED = 2,
+ NOT_CHARGING = 3,
+ ERROR = 4,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
index 5395b11..b869562 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
@@ -31,13 +31,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.automotive.vehicle;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum EvRegenerativeBrakingState {
+ UNKNOWN = 0,
+ DISABLED = 1,
+ PARTIALLY_ENABLED = 2,
+ FULLY_ENABLED = 3,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/TrailerState.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/TrailerState.aidl
index 4f29c0b..2491340 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/TrailerState.aidl
@@ -31,9 +31,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
-@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+package android.hardware.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum TrailerState {
+ UNKNOWN = 0,
+ NOT_PRESENT = 1,
+ PRESENT = 2,
+ ERROR = 3,
}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
index bcb63b6..04f8fa3 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -198,4 +198,12 @@
FRONT_FOG_LIGHTS_SWITCH = 289410876,
REAR_FOG_LIGHTS_STATE = 289410877,
REAR_FOG_LIGHTS_SWITCH = 289410878,
+ EV_CHARGE_CURRENT_DRAW_LIMIT = 291508031,
+ EV_CHARGE_PERCENT_LIMIT = 291508032,
+ EV_CHARGE_STATE = 289410881,
+ EV_CHARGE_SWITCH = 287313730,
+ EV_CHARGE_TIME_REMAINING = 289410883,
+ EV_REGENERATIVE_BRAKING_STATE = 289410884,
+ TRAILER_PRESENT = 289410885,
+ VEHICLE_CURB_WEIGHT = 289410886,
}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl
index 034dec5..c80fdbb 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl
@@ -60,6 +60,7 @@
MILLIWATTS = 99,
AMPERE_HOURS = 100,
KILOWATT_HOUR = 101,
+ AMPERE = 102,
KILOPASCAL = 112,
PSI = 113,
BAR = 114,
diff --git a/automotive/vehicle/aidl/aidl_test/Android.bp b/automotive/vehicle/aidl/aidl_test/Android.bp
index 5284a0a..cb92c6b 100644
--- a/automotive/vehicle/aidl/aidl_test/Android.bp
+++ b/automotive/vehicle/aidl/aidl_test/Android.bp
@@ -26,7 +26,7 @@
"libhidlbase",
],
static_libs: [
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
"android.hardware.automotive.vehicle@2.0",
"libgtest",
"libgmock",
diff --git a/radio/aidl/android/hardware/radio/network/NeighboringCell.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvChargeState.aidl
similarity index 65%
rename from radio/aidl/android/hardware/radio/network/NeighboringCell.aidl
rename to automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvChargeState.aidl
index 270bdee..e095fc4 100644
--- a/radio/aidl/android/hardware/radio/network/NeighboringCell.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvChargeState.aidl
@@ -14,17 +14,20 @@
* limitations under the License.
*/
-package android.hardware.radio.network;
+package android.hardware.automotive.vehicle;
+/**
+ * Used by EV charging properties to enumerate the current state of the battery charging.
+ */
@VintfStability
-parcelable NeighboringCell {
+@Backing(type="int")
+enum EvChargeState {
+ UNKNOWN = 0,
+ CHARGING = 1,
+ FULLY_CHARGED = 2,
+ NOT_CHARGING = 3,
/**
- * Combination of LAC and cell ID in 32 bits in GSM. Upper 16 bits is LAC and lower 16 bits is
- * CID (as described in TS 27.005).
+ * Vehicle not charging due to an error
*/
- String cid;
- /**
- * Received RSSI in GSM, level index of CPICH Received Signal Code Power in UMTS
- */
- int rssi;
+ ERROR = 4,
}
diff --git a/radio/aidl/android/hardware/radio/network/NeighboringCell.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
similarity index 63%
copy from radio/aidl/android/hardware/radio/network/NeighboringCell.aidl
copy to automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
index 270bdee..4382287 100644
--- a/radio/aidl/android/hardware/radio/network/NeighboringCell.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl
@@ -14,17 +14,17 @@
* limitations under the License.
*/
-package android.hardware.radio.network;
+package android.hardware.automotive.vehicle;
+/**
+ * Used by the regenerative braking property to enumerate the current state
+ * of the regenerative braking.
+ */
@VintfStability
-parcelable NeighboringCell {
- /**
- * Combination of LAC and cell ID in 32 bits in GSM. Upper 16 bits is LAC and lower 16 bits is
- * CID (as described in TS 27.005).
- */
- String cid;
- /**
- * Received RSSI in GSM, level index of CPICH Received Signal Code Power in UMTS
- */
- int rssi;
+@Backing(type="int")
+enum EvRegenerativeBrakingState {
+ UNKNOWN = 0,
+ DISABLED = 1,
+ PARTIALLY_ENABLED = 2,
+ FULLY_ENABLED = 3,
}
diff --git a/radio/aidl/android/hardware/radio/network/NeighboringCell.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/TrailerState.aidl
similarity index 63%
copy from radio/aidl/android/hardware/radio/network/NeighboringCell.aidl
copy to automotive/vehicle/aidl/android/hardware/automotive/vehicle/TrailerState.aidl
index 270bdee..fd42062 100644
--- a/radio/aidl/android/hardware/radio/network/NeighboringCell.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/TrailerState.aidl
@@ -14,17 +14,17 @@
* limitations under the License.
*/
-package android.hardware.radio.network;
+package android.hardware.automotive.vehicle;
+/**
+ * Used by the trailer present property to enumerate the current state
+ * of the trailer.
+ */
@VintfStability
-parcelable NeighboringCell {
- /**
- * Combination of LAC and cell ID in 32 bits in GSM. Upper 16 bits is LAC and lower 16 bits is
- * CID (as described in TS 27.005).
- */
- String cid;
- /**
- * Received RSSI in GSM, level index of CPICH Received Signal Code Power in UMTS
- */
- int rssi;
+@Backing(type="int")
+enum TrailerState {
+ UNKNOWN = 0,
+ NOT_PRESENT = 1,
+ PRESENT = 2,
+ ERROR = 3,
}
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl
index 533c7a2..727b949 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -2724,4 +2724,120 @@
*/
REAR_FOG_LIGHTS_SWITCH = 0x0F3E + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+
+ /**
+ * Indicates the maximum current draw threshold for charging set by the user
+ *
+ * configArray[0] is used to specify the max current draw allowed by
+ * the vehicle in Amperes.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
+ * @unit VehicleUnit:AMPERE
+ */
+ EV_CHARGE_CURRENT_DRAW_LIMIT = 0x0F3F + 0x10000000 + 0x01000000
+ + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
+
+ /**
+ * Indicates the maximum charge percent threshold set by the user
+ *
+ * Returns a float value from 0 to 100.
+ *
+ * configArray is used to specify the valid values.
+ * For example, if the vehicle supports the following charge percent limit values:
+ * [20, 40, 60, 80, 100]
+ * then the configArray should be {20, 40, 60, 80, 100}
+ * If the configArray is empty then all values from 0 to 100 must be valid.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
+ */
+ EV_CHARGE_PERCENT_LIMIT = 0x0F40 + 0x10000000 + 0x01000000
+ + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
+
+ /**
+ * Charging state of the car
+ *
+ * Returns the current charging state of the car.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ
+ * @data_enum EvChargeState
+ */
+ EV_CHARGE_STATE = 0x0F41 + 0x10000000 + 0x01000000
+ + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+
+ /**
+ * Start or stop charging the EV battery
+ *
+ * The setting that the user wants. Setting this property to true starts the battery charging
+ * and setting to false stops charging.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
+ */
+ EV_CHARGE_SWITCH = 0x0F42 + 0x10000000 + 0x01000000
+ + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
+
+ /**
+ * Estimated charge time remaining in seconds
+ *
+ * Returns 0 if the vehicle is not charging.
+ *
+ * @change_mode VehiclePropertyChangeMode:CONTINUOUS
+ * @access VehiclePropertyAccess:READ
+ * @unit VehicleUnit:SECS
+ */
+ EV_CHARGE_TIME_REMAINING = 0x0F43 + 0x10000000 + 0x01000000
+ + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+
+ /**
+ * Regenerative braking or one-pedal drive state of the car
+ *
+ * Returns the current state associated with the regenerative braking
+ * setting in the car
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ
+ * @data_enum EvRegenerativeBrakingState
+ */
+ EV_REGENERATIVE_BRAKING_STATE = 0x0F44 + 0x10000000 + 0x01000000
+ + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+
+ /**
+ * Indicates if there is a trailer present or not.
+ *
+ * Returns the trailer state of the car.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ
+ * @data_enum TrailerState
+ */
+ TRAILER_PRESENT = 0x0F45 + 0x10000000 + 0x01000000
+ + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+
+ /**
+ * Vehicle’s curb weight
+ *
+ * Returns the vehicle's curb weight in kilograms. Curb weight is
+ * the total weight of the vehicle with standard equipment and all
+ * necessary operating consumables such as motor oil,transmission oil,
+ * brake fluid, coolant, air conditioning refrigerant, and weight of
+ * fuel at nominal tank capacity, while not loaded with either passengers
+ * or cargo.
+ *
+ * configArray[0] is used to specify the vehicle’s gross weight in kilograms.
+ * The vehicle’s gross weight is the maximum operating weight of the vehicle
+ * as specified by the manufacturer including the vehicle's chassis, body, engine,
+ * engine fluids, fuel, accessories, driver, passengers and cargo but excluding
+ * that of any trailers.
+ *
+ * @change_mode VehiclePropertyChangeMode:STATIC
+ * @access VehiclePropertyAccess:READ
+ * @unit VehicleUnit:KILOGRAM
+ */
+
+ VEHICLE_CURB_WEIGHT = 0x0F46 + 0x10000000 + 0x01000000
+ + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+
}
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl
index 9c3f8f9..3817b74 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl
@@ -51,6 +51,7 @@
MILLIWATTS = 0x63,
AMPERE_HOURS = 0x64,
KILOWATT_HOUR = 0x65,
+ AMPERE = 0x66,
KILOPASCAL = 0x70,
PSI = 0x71,
BAR = 0x72,
diff --git a/automotive/vehicle/aidl/impl/default_config/Android.bp b/automotive/vehicle/aidl/impl/default_config/Android.bp
index 0feaf23..7a98b64 100644
--- a/automotive/vehicle/aidl/impl/default_config/Android.bp
+++ b/automotive/vehicle/aidl/impl/default_config/Android.bp
@@ -24,8 +24,8 @@
local_include_dirs: ["include"],
export_include_dirs: ["include"],
defaults: ["VehicleHalDefaults"],
- static_libs: ["VehicleHalUtils"],
+ static_libs: ["VehicleHalUtilsVendor"],
header_libs: ["VehicleHalTestUtilHeaders"],
- export_static_lib_headers: ["VehicleHalUtils"],
+ export_static_lib_headers: ["VehicleHalUtilsVendor"],
export_header_lib_headers: ["VehicleHalTestUtilHeaders"],
}
diff --git a/automotive/vehicle/aidl/impl/default_config/test/Android.bp b/automotive/vehicle/aidl/impl/default_config/test/Android.bp
index 771472c..0c4a3a4 100644
--- a/automotive/vehicle/aidl/impl/default_config/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/default_config/test/Android.bp
@@ -24,7 +24,7 @@
defaults: ["VehicleHalDefaults"],
srcs: ["*.cpp"],
static_libs: [
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
"libgtest",
],
header_libs: [
diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/Android.bp
index ab223d3..e6c4ee9 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/Android.bp
@@ -26,7 +26,7 @@
export_include_dirs: ["include"],
defaults: ["VehicleHalDefaults"],
static_libs: [
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
"FakeObd2Frame",
],
shared_libs: [
diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/FakeValueGenerator.h b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/FakeValueGenerator.h
index 93ffebf..5c90c30 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/FakeValueGenerator.h
+++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/FakeValueGenerator.h
@@ -33,7 +33,7 @@
virtual ~FakeValueGenerator() = default;
// Returns the next event if there is one or {@code std::nullopt} if there is none.
- virtual std::optional<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>
+ virtual std::optional<aidl::android::hardware::automotive::vehicle::VehiclePropValue>
nextEvent() = 0;
};
diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/GeneratorHub.h b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/GeneratorHub.h
index ad04d23..9f112ae 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/GeneratorHub.h
+++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/GeneratorHub.h
@@ -44,7 +44,7 @@
class GeneratorHub {
public:
using OnHalEvent = std::function<void(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& event)>;
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& event)>;
explicit GeneratorHub(OnHalEvent&& onHalEvent);
~GeneratorHub();
@@ -60,7 +60,7 @@
private:
struct VhalEvent {
int32_t generatorId;
- ::aidl::android::hardware::automotive::vehicle::VehiclePropValue val;
+ aidl::android::hardware::automotive::vehicle::VehiclePropValue val;
};
// Comparator used by priority queue to keep track of soonest event.
diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h
index 8116ed2..947eb4f 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h
+++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h
@@ -37,7 +37,7 @@
// {@code int32Values} has less than 2 elements, number of iterations would be set to -1, which
// means iterate indefinitely.
explicit JsonFakeValueGenerator(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& request);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& request);
// Create a new JSON fake value generator using the specified JSON file path. All the events
// in the JSON file would be generated for number of {@code iteration}. If iteration is 0, no
// value would be generated. If iteration is less than 0, it would iterate indefinitely.
@@ -48,14 +48,14 @@
~JsonFakeValueGenerator() = default;
- std::optional<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> nextEvent()
+ std::optional<aidl::android::hardware::automotive::vehicle::VehiclePropValue> nextEvent()
override;
- const std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>&
+ const std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropValue>&
getAllEvents();
private:
size_t mEventIndex = 0;
- std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> mEvents;
+ std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropValue> mEvents;
long mLastEventTimestamp = 0;
int32_t mNumOfIterations = 0;
diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/LinearFakeValueGenerator.h b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/LinearFakeValueGenerator.h
index bd004f3..d2b701d 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/LinearFakeValueGenerator.h
+++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/LinearFakeValueGenerator.h
@@ -35,7 +35,7 @@
// int64Values[0]: interval
// {@code propId} must be INT32 or INT64 or FLOAT type.
explicit LinearFakeValueGenerator(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& request);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& request);
// A linear value generator in range [middleValue - dispersion, middleValue + dispersion),
// starts at 'currentValue' and at each 'interval', increase by 'increment' and loop back if
// exceeds middleValue + dispersion. {@code propId} must be INT32 or INT64 or FLOAT type.
@@ -43,7 +43,7 @@
float dispersion, float increment, int64_t interval);
~LinearFakeValueGenerator() = default;
- std::optional<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> nextEvent()
+ std::optional<aidl::android::hardware::automotive::vehicle::VehiclePropValue> nextEvent()
override;
private:
diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp
index ac8db44..58f0e98 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp
@@ -24,7 +24,7 @@
srcs: ["*.cpp"],
defaults: ["VehicleHalDefaults"],
static_libs: [
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
"FakeVehicleHalValueGenerators",
"FakeObd2Frame",
],
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp
index dcd9208..49f7671 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp
@@ -39,7 +39,7 @@
],
export_header_lib_headers: ["IVehicleHardware"],
static_libs: [
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
"FakeVehicleHalValueGenerators",
"FakeObd2Frame",
"FakeUserHal",
@@ -47,5 +47,5 @@
shared_libs: [
"libjsoncpp",
],
- export_static_lib_headers: ["VehicleHalUtils"],
+ export_static_lib_headers: ["VehicleHalUtilsVendor"],
}
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h
index 578d045..9634c80 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h
@@ -46,30 +46,30 @@
explicit FakeVehicleHardware(std::unique_ptr<VehiclePropValuePool> valuePool);
// Get all the property configs.
- std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig>
+ std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropConfig>
getAllPropertyConfigs() const override;
// Set property values asynchronously. Server could return before the property set requests
// are sent to vehicle bus or before property set confirmation is received. The callback is
// safe to be called after the function returns and is safe to be called in a different thread.
- ::aidl::android::hardware::automotive::vehicle::StatusCode setValues(
+ aidl::android::hardware::automotive::vehicle::StatusCode setValues(
std::shared_ptr<const SetValuesCallback> callback,
- const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>&
+ const std::vector<aidl::android::hardware::automotive::vehicle::SetValueRequest>&
requests) override;
// Get property values asynchronously. Server could return before the property values are ready.
// The callback is safe to be called after the function returns and is safe to be called in a
// different thread.
- ::aidl::android::hardware::automotive::vehicle::StatusCode getValues(
+ aidl::android::hardware::automotive::vehicle::StatusCode getValues(
std::shared_ptr<const GetValuesCallback> callback,
- const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>&
+ const std::vector<aidl::android::hardware::automotive::vehicle::GetValueRequest>&
requests) const override;
// Dump debug information in the server.
DumpResult dump(const std::vector<std::string>& options) override;
// Check whether the system is healthy, return {@code StatusCode::OK} for healthy.
- ::aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() override;
+ aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() override;
// Register a callback that would be called when there is a property change event from vehicle.
void registerOnPropertyChangeEvent(
@@ -85,11 +85,11 @@
const std::shared_ptr<VehiclePropValuePool> mValuePool;
const std::shared_ptr<VehiclePropertyStore> mServerSidePropStore;
- ::android::base::Result<VehiclePropValuePool::RecyclableType> getValue(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
+ android::base::Result<VehiclePropValuePool::RecyclableType> getValue(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
- ::android::base::Result<void> setValue(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
+ android::base::Result<void> setValue(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
private:
// Expose private methods to unit test.
@@ -108,33 +108,33 @@
void storePropInitialValue(const defaultconfig::ConfigDeclaration& config);
// The callback that would be called when a vehicle property value change happens.
void onValueChangeCallback(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
// If property "persist.vendor.vhal_init_value_override" is set to true, override the properties
// using config files in 'overrideDir'.
void maybeOverrideProperties(const char* overrideDir);
// Override the properties using config files in 'overrideDir'.
void overrideProperties(const char* overrideDir);
- ::android::base::Result<void> maybeSetSpecialValue(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
+ android::base::Result<void> maybeSetSpecialValue(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
bool* isSpecialValue);
- ::android::base::Result<VehiclePropValuePool::RecyclableType> maybeGetSpecialValue(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
+ android::base::Result<VehiclePropValuePool::RecyclableType> maybeGetSpecialValue(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
bool* isSpecialValue) const;
- ::android::base::Result<void> setApPowerStateReport(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
+ android::base::Result<void> setApPowerStateReport(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
VehiclePropValuePool::RecyclableType createApPowerStateReq(
- ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq state);
- ::android::base::Result<void> setUserHalProp(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
- ::android::base::Result<VehiclePropValuePool::RecyclableType> getUserHalProp(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
+ aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq state);
+ android::base::Result<void> setUserHalProp(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
+ android::base::Result<VehiclePropValuePool::RecyclableType> getUserHalProp(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
bool isHvacPropAndHvacNotAvailable(int32_t propId);
std::string dumpAllProperties();
std::string dumpOnePropertyByConfig(
int rowNumber,
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config);
std::string dumpOnePropertyById(int32_t propId, int32_t areaId);
std::string dumpHelp();
std::string dumpListProperties();
@@ -142,23 +142,23 @@
std::string dumpSetProperties(const std::vector<std::string>& options);
template <typename T>
- ::android::base::Result<T> safelyParseInt(int index, const std::string& s) {
+ android::base::Result<T> safelyParseInt(int index, const std::string& s) {
T out;
if (!::android::base::ParseInt(s, &out)) {
- return ::android::base::Error() << ::android::base::StringPrintf(
+ return android::base::Error() << android::base::StringPrintf(
"non-integer argument at index %d: %s\n", index, s.c_str());
}
return out;
}
- ::android::base::Result<float> safelyParseFloat(int index, const std::string& s);
+ android::base::Result<float> safelyParseFloat(int index, const std::string& s);
std::vector<std::string> getOptionValues(const std::vector<std::string>& options,
size_t* index);
- ::android::base::Result<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>
+ android::base::Result<aidl::android::hardware::automotive::vehicle::VehiclePropValue>
parseSetPropOptions(const std::vector<std::string>& options);
- ::android::base::Result<std::vector<uint8_t>> parseHexString(const std::string& s);
+ android::base::Result<std::vector<uint8_t>> parseHexString(const std::string& s);
- ::android::base::Result<void> checkArgumentsSize(const std::vector<std::string>& options,
- size_t minSize);
+ android::base::Result<void> checkArgumentsSize(const std::vector<std::string>& options,
+ size_t minSize);
};
} // namespace fake
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp
index 90d1516..9f679bc 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp
@@ -29,7 +29,7 @@
"VehicleHalTestUtilHeaders",
],
static_libs: [
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
"FakeVehicleHardware",
"FakeVehicleHalValueGenerators",
"FakeObd2Frame",
diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/Android.bp
index c1cee84..c21ad53 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/Android.bp
@@ -26,7 +26,7 @@
export_include_dirs: ["include"],
defaults: ["VehicleHalDefaults"],
static_libs: [
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
],
- export_static_lib_headers: ["VehicleHalUtils"],
+ export_static_lib_headers: ["VehicleHalUtilsVendor"],
}
diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h
index 118bb34..fa6d8f9 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h
+++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h
@@ -35,17 +35,17 @@
: mPropStore(propStore) {}
void initObd2LiveFrame(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig);
void initObd2FreezeFrame(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig);
- ::android::base::Result<VehiclePropValuePool::RecyclableType> getObd2FreezeFrame(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue&
+ const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig);
+ android::base::Result<VehiclePropValuePool::RecyclableType> getObd2FreezeFrame(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue&
requestedPropValue) const;
- ::android::base::Result<VehiclePropValuePool::RecyclableType> getObd2DtcInfo() const;
- ::android::base::Result<void> clearObd2FreezeFrames(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
+ android::base::Result<VehiclePropValuePool::RecyclableType> getObd2DtcInfo() const;
+ android::base::Result<void> clearObd2FreezeFrames(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
static bool isDiagnosticProperty(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig);
private:
std::shared_ptr<VehiclePropertyStore> mPropStore;
diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/Obd2SensorStore.h b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/Obd2SensorStore.h
index f6075cb..1395eae 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/Obd2SensorStore.h
+++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/Obd2SensorStore.h
@@ -45,7 +45,7 @@
template <class T>
static int getLastIndex() {
- auto range = ::ndk::enum_range<T>();
+ auto range = ndk::enum_range<T>();
auto it = range.begin();
while (std::next(it) != range.end()) {
it++;
@@ -54,19 +54,19 @@
}
// Stores an integer-valued sensor.
- ::aidl::android::hardware::automotive::vehicle::StatusCode setIntegerSensor(
- ::aidl::android::hardware::automotive::vehicle::DiagnosticIntegerSensorIndex index,
+ aidl::android::hardware::automotive::vehicle::StatusCode setIntegerSensor(
+ aidl::android::hardware::automotive::vehicle::DiagnosticIntegerSensorIndex index,
int32_t value);
// Stores an integer-valued sensor.
- ::aidl::android::hardware::automotive::vehicle::StatusCode setIntegerSensor(size_t index,
- int32_t value);
+ aidl::android::hardware::automotive::vehicle::StatusCode setIntegerSensor(size_t index,
+ int32_t value);
// Stores a float-valued sensor.
- ::aidl::android::hardware::automotive::vehicle::StatusCode setFloatSensor(
- ::aidl::android::hardware::automotive::vehicle::DiagnosticFloatSensorIndex index,
+ aidl::android::hardware::automotive::vehicle::StatusCode setFloatSensor(
+ aidl::android::hardware::automotive::vehicle::DiagnosticFloatSensorIndex index,
float value);
// Stores a float-valued sensor.
- ::aidl::android::hardware::automotive::vehicle::StatusCode setFloatSensor(size_t index,
- float value);
+ aidl::android::hardware::automotive::vehicle::StatusCode setFloatSensor(size_t index,
+ float value);
// Returns a sensor property value using the given DTC.
VehiclePropValuePool::RecyclableType getSensorProperty(const std::string& dtc) const;
@@ -76,8 +76,8 @@
public:
explicit BitmaskInVector(size_t numBits = 0);
void resize(size_t numBits);
- ::android::base::Result<bool> get(size_t index) const;
- ::android::base::Result<void> set(size_t index, bool value);
+ android::base::Result<bool> get(size_t index) const;
+ android::base::Result<void> set(size_t index, bool value);
const std::vector<uint8_t>& getBitmask() const;
diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp
index 55b8c93..a16185b 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp
@@ -25,7 +25,7 @@
defaults: ["VehicleHalDefaults"],
static_libs: [
"FakeObd2Frame",
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
],
test_suites: ["device-tests"],
}
diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/userhal/Android.bp
index 2e95531..1689102 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/userhal/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/Android.bp
@@ -26,7 +26,7 @@
export_include_dirs: ["include"],
defaults: ["VehicleHalDefaults"],
static_libs: [
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
],
- export_static_lib_headers: ["VehicleHalUtils"],
+ export_static_lib_headers: ["VehicleHalUtilsVendor"],
}
diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h b/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h
index 1424c81..a220146 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h
+++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h
@@ -49,13 +49,13 @@
//
// @return updated property and StatusCode
android::base::Result<VehiclePropValuePool::RecyclableType> onSetProperty(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
// Gets the property value from the emulator.
//
// @return property value and StatusCode
android::base::Result<VehiclePropValuePool::RecyclableType> onGetProperty(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
// Shows the User HAL emulation help.
std::string showDumpHelp() const;
@@ -94,30 +94,30 @@
// test this error scenario)
// - if it's 3, then don't send a property change (so Android can emulate a timeout)
android::base::Result<VehiclePropValuePool::RecyclableType> onSetInitialUserInfoResponse(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
// Used to emulate SWITCH_USER - see onSetInitialUserInfoResponse() for usage.
android::base::Result<VehiclePropValuePool::RecyclableType> onSetSwitchUserResponse(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
// Used to emulate CREATE_USER - see onSetInitialUserInfoResponse() for usage.
android::base::Result<VehiclePropValuePool::RecyclableType> onSetCreateUserResponse(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
// Used to emulate set USER_IDENTIFICATION_ASSOCIATION - see onSetInitialUserInfoResponse() for
// usage.
android::base::Result<VehiclePropValuePool::RecyclableType> onSetUserIdentificationAssociation(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
// Used to emulate get USER_IDENTIFICATION_ASSOCIATION - see onSetInitialUserInfoResponse() for
// usage.
android::base::Result<VehiclePropValuePool::RecyclableType> onGetUserIdentificationAssociation(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
// Creates a default USER_IDENTIFICATION_ASSOCIATION when it was not set by lshal.
static android::base::Result<VehiclePropValuePool::RecyclableType>
defaultUserIdentificationAssociation(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& request);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& request);
android::base::Result<VehiclePropValuePool::RecyclableType> sendUserHalResponse(
VehiclePropValuePool::RecyclableType response, int32_t requestId);
diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/include/UserHalHelper.h b/automotive/vehicle/aidl/impl/fake_impl/userhal/include/UserHalHelper.h
index 5be13be..104876c 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/userhal/include/UserHalHelper.h
+++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/include/UserHalHelper.h
@@ -35,48 +35,46 @@
// Verify whether the |value| can be casted to the type |T| and return the casted value on success.
// Otherwise, return the error.
template <typename T>
-::android::base::Result<T> verifyAndCast(int32_t value);
+android::base::Result<T> verifyAndCast(int32_t value);
// Below functions parse VehiclePropValues to the respective User HAL request structs. On success,
// these functions return the User HAL struct. Otherwise, they return the error.
-::android::base::Result<::aidl::android::hardware::automotive::vehicle::InitialUserInfoRequest>
+android::base::Result<aidl::android::hardware::automotive::vehicle::InitialUserInfoRequest>
toInitialUserInfoRequest(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
-::android::base::Result<::aidl::android::hardware::automotive::vehicle::SwitchUserRequest>
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
+android::base::Result<aidl::android::hardware::automotive::vehicle::SwitchUserRequest>
toSwitchUserRequest(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
-::android::base::Result<::aidl::android::hardware::automotive::vehicle::CreateUserRequest>
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
+android::base::Result<aidl::android::hardware::automotive::vehicle::CreateUserRequest>
toCreateUserRequest(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
-::android::base::Result<::aidl::android::hardware::automotive::vehicle::RemoveUserRequest>
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
+android::base::Result<aidl::android::hardware::automotive::vehicle::RemoveUserRequest>
toRemoveUserRequest(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
-::android::base::Result<
- ::aidl::android::hardware::automotive::vehicle::UserIdentificationGetRequest>
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
+android::base::Result<aidl::android::hardware::automotive::vehicle::UserIdentificationGetRequest>
toUserIdentificationGetRequest(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
-::android::base::Result<
- ::aidl::android::hardware::automotive::vehicle::UserIdentificationSetRequest>
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
+android::base::Result<aidl::android::hardware::automotive::vehicle::UserIdentificationSetRequest>
toUserIdentificationSetRequest(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
// Below functions convert the User HAL structs to VehiclePropValues. On success, these functions
// return the pointer to VehiclePropValue. Otherwise, they return the error.
-::android::base::Result<VehiclePropValuePool::RecyclableType> toVehiclePropValue(
+android::base::Result<VehiclePropValuePool::RecyclableType> toVehiclePropValue(
VehiclePropValuePool& pool,
- const ::aidl::android::hardware::automotive::vehicle::SwitchUserRequest& request);
+ const aidl::android::hardware::automotive::vehicle::SwitchUserRequest& request);
VehiclePropValuePool::RecyclableType toVehiclePropValue(
VehiclePropValuePool& pool,
- const ::aidl::android::hardware::automotive::vehicle::InitialUserInfoResponse& response);
+ const aidl::android::hardware::automotive::vehicle::InitialUserInfoResponse& response);
VehiclePropValuePool::RecyclableType toVehiclePropValue(
VehiclePropValuePool& pool,
- const ::aidl::android::hardware::automotive::vehicle::SwitchUserResponse& response);
+ const aidl::android::hardware::automotive::vehicle::SwitchUserResponse& response);
VehiclePropValuePool::RecyclableType toVehiclePropValue(
VehiclePropValuePool& pool,
- const ::aidl::android::hardware::automotive::vehicle::CreateUserResponse& response);
+ const aidl::android::hardware::automotive::vehicle::CreateUserResponse& response);
VehiclePropValuePool::RecyclableType toVehiclePropValue(
VehiclePropValuePool& pool,
- const ::aidl::android::hardware::automotive::vehicle::UserIdentificationResponse& response);
+ const aidl::android::hardware::automotive::vehicle::UserIdentificationResponse& response);
} // namespace user_hal_helper
} // namespace fake
diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp
index 7d0a534..1471ea6 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp
@@ -25,7 +25,7 @@
defaults: ["VehicleHalDefaults"],
static_libs: [
"FakeUserHal",
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
"libgtest",
"libgmock",
],
diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp
index 7670c25..6209880 100644
--- a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp
+++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp
@@ -34,10 +34,10 @@
shared_libs: ["libprotobuf-cpp-full"],
static_libs: [
"VehicleHalProtos",
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
],
defaults: ["VehicleHalDefaults"],
- export_static_lib_headers: ["VehicleHalUtils"],
+ export_static_lib_headers: ["VehicleHalUtilsVendor"],
}
cc_test {
@@ -51,7 +51,7 @@
static_libs: [
"VehicleHalProtoMessageConverter",
"VehicleHalProtos",
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
"libgtest",
],
header_libs: ["VehicleHalDefaultConfig"],
diff --git a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h
index 4b9de2d..4a38827 100644
--- a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h
+++ b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h
@@ -39,7 +39,7 @@
// A structure to represent a set value error event reported from vehicle.
struct SetValueErrorEvent {
- ::aidl::android::hardware::automotive::vehicle::StatusCode errorCode;
+ aidl::android::hardware::automotive::vehicle::StatusCode errorCode;
int32_t propId;
int32_t areaId;
};
@@ -51,40 +51,40 @@
class IVehicleHardware {
public:
using SetValuesCallback = std::function<void(
- std::vector<::aidl::android::hardware::automotive::vehicle::SetValueResult>)>;
+ std::vector<aidl::android::hardware::automotive::vehicle::SetValueResult>)>;
using GetValuesCallback = std::function<void(
- std::vector<::aidl::android::hardware::automotive::vehicle::GetValueResult>)>;
+ std::vector<aidl::android::hardware::automotive::vehicle::GetValueResult>)>;
using PropertyChangeCallback = std::function<void(
- std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>)>;
+ std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropValue>)>;
using PropertySetErrorCallback = std::function<void(std::vector<SetValueErrorEvent>)>;
virtual ~IVehicleHardware() = default;
// Get all the property configs.
- virtual std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig>
+ virtual std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropConfig>
getAllPropertyConfigs() const = 0;
// Set property values asynchronously. Server could return before the property set requests
// are sent to vehicle bus or before property set confirmation is received. The callback is
// safe to be called after the function returns and is safe to be called in a different thread.
- virtual ::aidl::android::hardware::automotive::vehicle::StatusCode setValues(
+ virtual aidl::android::hardware::automotive::vehicle::StatusCode setValues(
std::shared_ptr<const SetValuesCallback> callback,
- const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>&
+ const std::vector<aidl::android::hardware::automotive::vehicle::SetValueRequest>&
requests) = 0;
// Get property values asynchronously. Server could return before the property values are ready.
// The callback is safe to be called after the function returns and is safe to be called in a
// different thread.
- virtual ::aidl::android::hardware::automotive::vehicle::StatusCode getValues(
+ virtual aidl::android::hardware::automotive::vehicle::StatusCode getValues(
std::shared_ptr<const GetValuesCallback> callback,
- const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>&
+ const std::vector<aidl::android::hardware::automotive::vehicle::GetValueRequest>&
requests) const = 0;
// Dump debug information in the server.
virtual DumpResult dump(const std::vector<std::string>& options) = 0;
// Check whether the system is healthy, return {@code StatusCode::OK} for healthy.
- virtual ::aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() = 0;
+ virtual aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() = 0;
// Register a callback that would be called when there is a property change event from vehicle.
virtual void registerOnPropertyChangeEvent(
diff --git a/automotive/vehicle/aidl/impl/utils/common/Android.bp b/automotive/vehicle/aidl/impl/utils/common/Android.bp
index ace505d..88713f1 100644
--- a/automotive/vehicle/aidl/impl/utils/common/Android.bp
+++ b/automotive/vehicle/aidl/impl/utils/common/Android.bp
@@ -19,7 +19,7 @@
}
cc_library {
- name: "VehicleHalUtils",
+ name: "VehicleHalUtilsVendor",
srcs: ["src/*.cpp"],
vendor: true,
local_include_dirs: ["include"],
@@ -27,6 +27,33 @@
defaults: ["VehicleHalDefaults"],
}
+// This is a non-vendor version for VehicleHalUtilsVendor.
+cc_library {
+ name: "VehicleHalUtils",
+ srcs: ["src/*.cpp"],
+ local_include_dirs: ["include"],
+ export_include_dirs: ["include"],
+ static_libs: [
+ "android-automotive-large-parcelable-lib",
+ "android.hardware.automotive.vehicle-V1-ndk",
+ "libmath",
+ ],
+ shared_libs: [
+ "libbase",
+ "liblog",
+ "libutils",
+ ],
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Werror",
+ "-Wthread-safety",
+ ],
+ defaults: [
+ "android-automotive-large-parcelable-defaults",
+ ],
+}
+
cc_library_headers {
name: "VehicleHalUtilHeaders",
export_include_dirs: ["include"],
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h b/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h
index 9a8f19b..08b56a6 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h
@@ -35,7 +35,7 @@
public:
void waitForItems() {
std::unique_lock<std::mutex> lockGuard(mLock);
- ::android::base::ScopedLockAssertion lockAssertion(mLock);
+ android::base::ScopedLockAssertion lockAssertion(mLock);
while (mQueue.empty() && mIsActive) {
mCond.wait(lockGuard);
}
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/ParcelableUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/ParcelableUtils.h
index 7b2111b..ab7b895 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/ParcelableUtils.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/ParcelableUtils.h
@@ -33,13 +33,13 @@
// If values is small enough, it would be put into output.payloads, otherwise a shared memory file
// would be created and output.sharedMemoryFd would be filled in.
template <class T1, class T2>
-::ndk::ScopedAStatus vectorToStableLargeParcelable(std::vector<T1>&& values, T2* output) {
+ndk::ScopedAStatus vectorToStableLargeParcelable(std::vector<T1>&& values, T2* output) {
output->payloads = std::move(values);
- auto result = ::android::automotive::car_binder_lib::LargeParcelableBase::
+ auto result = android::automotive::car_binder_lib::LargeParcelableBase::
parcelableToStableLargeParcelable(*output);
if (!result.ok()) {
return toScopedAStatus(
- result, ::aidl::android::hardware::automotive::vehicle::StatusCode::INTERNAL_ERROR);
+ result, aidl::android::hardware::automotive::vehicle::StatusCode::INTERNAL_ERROR);
}
auto& fd = result.value();
if (fd != nullptr) {
@@ -48,14 +48,14 @@
output->payloads.clear();
output->sharedMemoryFd = std::move(*fd);
} else {
- output->sharedMemoryFd = ::ndk::ScopedFileDescriptor();
+ output->sharedMemoryFd = ndk::ScopedFileDescriptor();
// Do not modify payloads.
}
- return ::ndk::ScopedAStatus::ok();
+ return ndk::ScopedAStatus::ok();
}
template <class T1, class T2>
-::ndk::ScopedAStatus vectorToStableLargeParcelable(const std::vector<T1>& values, T2* output) {
+ndk::ScopedAStatus vectorToStableLargeParcelable(const std::vector<T1>& values, T2* output) {
// Because 'values' is passed in as const reference, we have to do a copy here.
std::vector<T1> valuesCopy = values;
@@ -63,16 +63,16 @@
}
template <class T>
-::android::base::expected<
- ::android::automotive::car_binder_lib::LargeParcelableBase::BorrowedOwnedObject<T>,
- ::ndk::ScopedAStatus>
+android::base::expected<
+ android::automotive::car_binder_lib::LargeParcelableBase::BorrowedOwnedObject<T>,
+ ndk::ScopedAStatus>
fromStableLargeParcelable(const T& largeParcelable) {
- auto result = ::android::automotive::car_binder_lib::LargeParcelableBase::
+ auto result = android::automotive::car_binder_lib::LargeParcelableBase::
stableLargeParcelableToParcelable(largeParcelable);
if (!result.ok()) {
- return ::android::base::unexpected(toScopedAStatus(
- result, ::aidl::android::hardware::automotive::vehicle::StatusCode::INVALID_ARG,
+ return android::base::unexpected(toScopedAStatus(
+ result, aidl::android::hardware::automotive::vehicle::StatusCode::INVALID_ARG,
"failed to parse large parcelable"));
}
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h
index 4b2a11a..6e812d1 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h
@@ -168,7 +168,7 @@
class VehiclePropValuePool {
public:
using RecyclableType =
- recyclable_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>;
+ recyclable_ptr<aidl::android::hardware::automotive::vehicle::VehiclePropValue>;
// Creates VehiclePropValuePool
//
@@ -188,20 +188,20 @@
// given type is not MIXED or STRING, the internal value vector size would be set to 1.
// If the given type is MIXED or STRING, all the internal vector sizes would be initialized to
// 0.
- RecyclableType obtain(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type);
+ RecyclableType obtain(aidl::android::hardware::automotive::vehicle::VehiclePropertyType type);
// Obtain a recyclable VehiclePropertyValue object from the pool for the given type. If the
// given type is *_VEC or BYTES, the internal value vector size would be set to vectorSize. If
// the given type is BOOLEAN, INT32, FLOAT, or INT64, the internal value vector size would be
// set to 1. If the given type is MIXED or STRING, all the internal value vector sizes would be
// set to 0. vectorSize must be larger than 0.
- RecyclableType obtain(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
+ RecyclableType obtain(aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
size_t vectorSize);
// Obtain a recyclable VehicePropertyValue object that is a copy of src. If src does not contain
// any value or the src property type is not valid, this function would return an empty
// VehiclePropValue.
RecyclableType obtain(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& src);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& src);
// Obtain a recyclable boolean object.
RecyclableType obtainBoolean(bool value);
// Obtain a recyclable int32 object.
@@ -220,36 +220,35 @@
private:
static inline bool isSingleValueType(
- ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) {
- return type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::
- BOOLEAN ||
- type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32 ||
- type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64 ||
- type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT;
+ aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) {
+ return type == aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BOOLEAN ||
+ type == aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32 ||
+ type == aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64 ||
+ type == aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT;
}
static inline bool isComplexType(
- ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) {
- return type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED ||
- type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING;
+ aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) {
+ return type == aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED ||
+ type == aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING;
}
- bool isDisposable(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
+ bool isDisposable(aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
size_t vectorSize) const {
return vectorSize > mMaxRecyclableVectorSize || isComplexType(type);
}
RecyclableType obtainDisposable(
- ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType valueType,
+ aidl::android::hardware::automotive::vehicle::VehiclePropertyType valueType,
size_t vectorSize) const;
RecyclableType obtainRecyclable(
- ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
+ aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
size_t vectorSize);
class InternalPool
- : public ObjectPool<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> {
+ : public ObjectPool<aidl::android::hardware::automotive::vehicle::VehiclePropValue> {
public:
- InternalPool(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
+ InternalPool(aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
size_t vectorSize, size_t maxPoolObjectsSize,
ObjectPool::GetSizeFunc getSizeFunc)
: ObjectPool(maxPoolObjectsSize, getSizeFunc),
@@ -257,11 +256,11 @@
mVectorSize(vectorSize) {}
protected:
- ::aidl::android::hardware::automotive::vehicle::VehiclePropValue* createObject() override;
- void recycle(::aidl::android::hardware::automotive::vehicle::VehiclePropValue* o) override;
+ aidl::android::hardware::automotive::vehicle::VehiclePropValue* createObject() override;
+ void recycle(aidl::android::hardware::automotive::vehicle::VehiclePropValue* o) override;
private:
- bool check(::aidl::android::hardware::automotive::vehicle::RawPropValues* v);
+ bool check(aidl::android::hardware::automotive::vehicle::RawPropValues* v);
template <typename VecType>
bool check(std::vector<VecType>* vec, bool isVectorType) {
@@ -269,12 +268,12 @@
}
private:
- ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType mPropType;
+ aidl::android::hardware::automotive::vehicle::VehiclePropertyType mPropType;
size_t mVectorSize;
};
- const Deleter<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>
+ const Deleter<aidl::android::hardware::automotive::vehicle::VehiclePropValue>
mDisposableDeleter{
- [](::aidl::android::hardware::automotive::vehicle::VehiclePropValue* v) {
+ [](aidl::android::hardware::automotive::vehicle::VehiclePropValue* v) {
delete v;
}};
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h
index 63129e7..2c7aa97 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h
@@ -49,18 +49,18 @@
// Callback when a property value has been updated or a new value added.
using OnValueChangeCallback = std::function<void(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue&)>;
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue&)>;
// Function that used to calculate unique token for given VehiclePropValue.
- using TokenFunction = ::std::function<int64_t(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value)>;
+ using TokenFunction = std::function<int64_t(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value)>;
// Register the given property according to the config. A property has to be registered first
// before write/read. If tokenFunc is not nullptr, it would be used to generate a unique
// property token to act as the key the property store. Otherwise, {propertyID, areaID} would be
// used as the key.
void registerProperty(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config,
+ const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config,
TokenFunction tokenFunc = nullptr);
// Stores provided value. Returns error if config wasn't registered. If 'updateStatus' is
@@ -68,13 +68,13 @@
// 'status' would be initialized to {@code VehiclePropertyStatus::AVAILABLE}, if this is to
// override an existing value, the status for the existing value would be used for the
// overridden value.
- ::android::base::Result<void> writeValue(VehiclePropValuePool::RecyclableType propValue,
- bool updateStatus = false);
+ android::base::Result<void> writeValue(VehiclePropValuePool::RecyclableType propValue,
+ bool updateStatus = false);
// Remove a given property value from the property store. The 'propValue' would be used to
// generate the key for the value to remove.
void removeValue(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
// Remove all the values for the property.
void removeValuesForProperty(int32_t propId);
@@ -83,28 +83,28 @@
std::vector<VehiclePropValuePool::RecyclableType> readAllValues() const;
// Read all the values for the property.
- ::android::base::Result<std::vector<VehiclePropValuePool::RecyclableType>>
- readValuesForProperty(int32_t propId) const;
+ android::base::Result<std::vector<VehiclePropValuePool::RecyclableType>> readValuesForProperty(
+ int32_t propId) const;
// Read the value for the requested property. Returns {@code StatusCode::NOT_AVAILABLE} if the
// value has not been set yet. Returns {@code StatusCode::INVALID_ARG} if the property is
// not configured.
- ::android::base::Result<VehiclePropValuePool::RecyclableType> readValue(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& request) const;
+ android::base::Result<VehiclePropValuePool::RecyclableType> readValue(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& request) const;
// Read the value for the requested property. Returns {@code StatusCode::NOT_AVAILABLE} if the
// value has not been set yet. Returns {@code StatusCode::INVALID_ARG} if the property is
// not configured.
- ::android::base::Result<VehiclePropValuePool::RecyclableType> readValue(
- int32_t prop, int32_t area = 0, int64_t token = 0) const;
+ android::base::Result<VehiclePropValuePool::RecyclableType> readValue(int32_t prop,
+ int32_t area = 0,
+ int64_t token = 0) const;
// Get all property configs.
- std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig> getAllConfigs()
+ std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropConfig> getAllConfigs()
const;
// Get the property config for the requested property.
- ::android::base::Result<
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig*>
+ android::base::Result<const aidl::android::hardware::automotive::vehicle::VehiclePropConfig*>
getConfig(int32_t propId) const;
// Set a callback that would be called when a property value has been updated.
@@ -127,7 +127,7 @@
};
struct Record {
- ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig propConfig;
+ aidl::android::hardware::automotive::vehicle::VehiclePropConfig propConfig;
TokenFunction tokenFunction;
std::unordered_map<RecordId, VehiclePropValuePool::RecyclableType, RecordIdHash> values;
};
@@ -143,10 +143,10 @@
Record* getRecordLocked(int32_t propId);
RecordId getRecordIdLocked(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue,
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue,
const Record& record) const;
- ::android::base::Result<VehiclePropValuePool::RecyclableType> readValueLocked(
+ android::base::Result<VehiclePropValuePool::RecyclableType> readValueLocked(
const RecordId& recId, const Record& record) const;
};
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h
index 0f0ccf1..1fc5613 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h
@@ -37,38 +37,36 @@
return static_cast<U>(value);
}
-inline constexpr ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType getPropType(
+inline constexpr aidl::android::hardware::automotive::vehicle::VehiclePropertyType getPropType(
int32_t prop) {
- return static_cast<::aidl::android::hardware::automotive::vehicle::VehiclePropertyType>(
- prop &
- toInt(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MASK));
+ return static_cast<aidl::android::hardware::automotive::vehicle::VehiclePropertyType>(
+ prop & toInt(aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MASK));
}
-inline constexpr ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup getPropGroup(
+inline constexpr aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup getPropGroup(
int32_t prop) {
- return static_cast<::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup>(
- prop &
- toInt(::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup::MASK));
+ return static_cast<aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup>(
+ prop & toInt(aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup::MASK));
}
-inline constexpr ::aidl::android::hardware::automotive::vehicle::VehicleArea getPropArea(
+inline constexpr aidl::android::hardware::automotive::vehicle::VehicleArea getPropArea(
int32_t prop) {
- return static_cast<::aidl::android::hardware::automotive::vehicle::VehicleArea>(
- prop & toInt(::aidl::android::hardware::automotive::vehicle::VehicleArea::MASK));
+ return static_cast<aidl::android::hardware::automotive::vehicle::VehicleArea>(
+ prop & toInt(aidl::android::hardware::automotive::vehicle::VehicleArea::MASK));
}
inline constexpr bool isGlobalProp(int32_t prop) {
- return getPropArea(prop) == ::aidl::android::hardware::automotive::vehicle::VehicleArea::GLOBAL;
+ return getPropArea(prop) == aidl::android::hardware::automotive::vehicle::VehicleArea::GLOBAL;
}
inline constexpr bool isSystemProp(int32_t prop) {
- return ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup::SYSTEM ==
+ return aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup::SYSTEM ==
getPropGroup(prop);
}
-inline const ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* getAreaConfig(
+inline const aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* getAreaConfig(
int32_t propId, int32_t areaId,
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config) {
+ const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config) {
if (config.areaConfigs.size() == 0) {
return nullptr;
}
@@ -85,43 +83,43 @@
return nullptr;
}
-inline const ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* getAreaConfig(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue,
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config) {
+inline const aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* getAreaConfig(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue,
+ const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config) {
return getAreaConfig(propValue.prop, propValue.areaId, config);
}
-inline std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>
-createVehiclePropValueVec(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
+inline std::unique_ptr<aidl::android::hardware::automotive::vehicle::VehiclePropValue>
+createVehiclePropValueVec(aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
size_t vecSize) {
- auto val = std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>(
- new ::aidl::android::hardware::automotive::vehicle::VehiclePropValue);
+ auto val = std::unique_ptr<aidl::android::hardware::automotive::vehicle::VehiclePropValue>(
+ new aidl::android::hardware::automotive::vehicle::VehiclePropValue);
switch (type) {
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32:
[[fallthrough]];
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BOOLEAN:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BOOLEAN:
vecSize = 1;
[[fallthrough]];
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32_VEC:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32_VEC:
val->value.int32Values.resize(vecSize);
break;
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT:
vecSize = 1;
[[fallthrough]];
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT_VEC:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT_VEC:
val->value.floatValues.resize(vecSize);
break;
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64:
vecSize = 1;
[[fallthrough]];
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64_VEC:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64_VEC:
val->value.int64Values.resize(vecSize);
break;
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BYTES:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BYTES:
val->value.byteValues.resize(vecSize);
break;
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING:
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED:
break; // Valid, but nothing to do.
default:
ALOGE("createVehiclePropValue: unknown type: %d", toInt(type));
@@ -130,34 +128,34 @@
return val;
}
-inline std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>
-createVehiclePropValue(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) {
+inline std::unique_ptr<aidl::android::hardware::automotive::vehicle::VehiclePropValue>
+createVehiclePropValue(aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) {
return createVehiclePropValueVec(type, 1);
}
inline size_t getVehicleRawValueVectorSize(
- const ::aidl::android::hardware::automotive::vehicle::RawPropValues& value,
- ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) {
+ const aidl::android::hardware::automotive::vehicle::RawPropValues& value,
+ aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) {
switch (type) {
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32:
[[fallthrough]];
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BOOLEAN:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BOOLEAN:
return std::min(value.int32Values.size(), static_cast<size_t>(1));
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT:
return std::min(value.floatValues.size(), static_cast<size_t>(1));
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64:
return std::min(value.int64Values.size(), static_cast<size_t>(1));
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32_VEC:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32_VEC:
return value.int32Values.size();
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT_VEC:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT_VEC:
return value.floatValues.size();
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64_VEC:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64_VEC:
return value.int64Values.size();
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BYTES:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BYTES:
return value.byteValues.size();
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING:
[[fallthrough]];
- case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED:
+ case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED:
return 0;
default:
ALOGE("getVehicleRawValueVectorSize: unknown type: %d", toInt(type));
@@ -166,8 +164,8 @@
}
inline void copyVehicleRawValue(
- ::aidl::android::hardware::automotive::vehicle::RawPropValues* dest,
- const ::aidl::android::hardware::automotive::vehicle::RawPropValues& src) {
+ aidl::android::hardware::automotive::vehicle::RawPropValues* dest,
+ const aidl::android::hardware::automotive::vehicle::RawPropValues& src) {
dest->int32Values = src.int32Values;
dest->floatValues = src.floatValues;
dest->int64Values = src.int64Values;
@@ -178,7 +176,7 @@
// getVehiclePropValueSize returns approximately how much memory 'value' would take. This should
// only be used in a limited-size memory pool to set an upper bound for memory consumption.
inline size_t getVehiclePropValueSize(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& prop) {
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& prop) {
size_t size = 0;
size += sizeof(prop.timestamp);
size += sizeof(prop.areaId);
@@ -193,22 +191,22 @@
}
template <class T>
-::aidl::android::hardware::automotive::vehicle::StatusCode getErrorCode(
- const ::android::base::Result<T>& result) {
+aidl::android::hardware::automotive::vehicle::StatusCode getErrorCode(
+ const android::base::Result<T>& result) {
if (result.ok()) {
- return ::aidl::android::hardware::automotive::vehicle::StatusCode::OK;
+ return aidl::android::hardware::automotive::vehicle::StatusCode::OK;
}
- return static_cast<::aidl::android::hardware::automotive::vehicle::StatusCode>(
+ return static_cast<aidl::android::hardware::automotive::vehicle::StatusCode>(
result.error().code());
}
template <class T>
-int getIntErrorCode(const ::android::base::Result<T>& result) {
+int getIntErrorCode(const android::base::Result<T>& result) {
return toInt(getErrorCode(result));
}
template <class T>
-std::string getErrorMsg(const ::android::base::Result<T>& result) {
+std::string getErrorMsg(const android::base::Result<T>& result) {
if (result.ok()) {
return "";
}
@@ -216,33 +214,32 @@
}
template <class T>
-::ndk::ScopedAStatus toScopedAStatus(
- const ::android::base::Result<T>& result,
- ::aidl::android::hardware::automotive::vehicle::StatusCode status,
- const std::string& additionalErrorMsg) {
+ndk::ScopedAStatus toScopedAStatus(const android::base::Result<T>& result,
+ aidl::android::hardware::automotive::vehicle::StatusCode status,
+ const std::string& additionalErrorMsg) {
if (result.ok()) {
- return ::ndk::ScopedAStatus::ok();
+ return ndk::ScopedAStatus::ok();
}
- return ::ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage(
+ return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage(
toInt(status),
fmt::format("{}, error: {}", additionalErrorMsg, getErrorMsg(result)).c_str());
}
template <class T>
-::ndk::ScopedAStatus toScopedAStatus(
- const ::android::base::Result<T>& result,
- ::aidl::android::hardware::automotive::vehicle::StatusCode status) {
+ndk::ScopedAStatus toScopedAStatus(
+ const android::base::Result<T>& result,
+ aidl::android::hardware::automotive::vehicle::StatusCode status) {
return toScopedAStatus(result, status, "");
}
template <class T>
-::ndk::ScopedAStatus toScopedAStatus(const ::android::base::Result<T>& result) {
+ndk::ScopedAStatus toScopedAStatus(const android::base::Result<T>& result) {
return toScopedAStatus(result, getErrorCode(result));
}
template <class T>
-::ndk::ScopedAStatus toScopedAStatus(const ::android::base::Result<T>& result,
- const std::string& additionalErrorMsg) {
+ndk::ScopedAStatus toScopedAStatus(const android::base::Result<T>& result,
+ const std::string& additionalErrorMsg) {
return toScopedAStatus(result, getErrorCode(result), additionalErrorMsg);
}
@@ -255,9 +252,9 @@
// * If the type is FLOAT, {@code value.floatValues} must contain one element.
// * If the type is FLOAT_VEC, {@code value.floatValues} must contain at least one element.
// * If the type is MIXED, see checkVendorMixedPropValue.
-::android::base::Result<void> checkPropValue(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig* config);
+android::base::Result<void> checkPropValue(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
+ const aidl::android::hardware::automotive::vehicle::VehiclePropConfig* config);
// Check whether the Mixed type value is valid according to config.
// We check for the following:
@@ -268,9 +265,9 @@
// * configArray[6] + configArray[7] must be equal to the number of {@code value.floatValues}
// elements.
// * configArray[8] must be equal to the number of {@code value.byteValues} elements.
-::android::base::Result<void> checkVendorMixedPropValue(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig* config);
+android::base::Result<void> checkVendorMixedPropValue(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
+ const aidl::android::hardware::automotive::vehicle::VehiclePropConfig* config);
// Check whether the value is within the configured range.
// We check for the following types:
@@ -282,9 +279,9 @@
// {@code minFloatValues} and {@code maxFloatValues} if either of them is not 0.
// We don't check other types. If more checks are required, they should be added in VehicleHardware
// implementation.
-::android::base::Result<void> checkValueRange(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
- const ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* config);
+android::base::Result<void> checkValueRange(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
+ const aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* config);
} // namespace vehicle
} // namespace automotive
diff --git a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp
index 250b331..bcb3c8d 100644
--- a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp
@@ -19,11 +19,11 @@
}
cc_test {
- name: "VehicleHalVehicleUtilsTest",
+ name: "VehicleHalVehicleUtilsVendorTest",
srcs: ["*.cpp"],
vendor: true,
static_libs: [
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
"libgtest",
"libgmock",
],
diff --git a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h
index f80d1e6..4213501 100644
--- a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h
+++ b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h
@@ -39,7 +39,7 @@
// Converts the system property to the vendor property.
// WARNING: This is only for the end-to-end testing, Should NOT include in the user build.
inline constexpr int32_t toVendor(
- const ::aidl::android::hardware::automotive::vehicle::VehicleProperty& prop) {
+ const aidl::android::hardware::automotive::vehicle::VehicleProperty& prop) {
return (toInt(prop) & ~toInt(testpropertyutils_impl::VehiclePropertyGroup::MASK)) |
toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR);
}
diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp
index 49f48f7..295cbb7 100644
--- a/automotive/vehicle/aidl/impl/vhal/Android.bp
+++ b/automotive/vehicle/aidl/impl/vhal/Android.bp
@@ -33,7 +33,7 @@
static_libs: [
"DefaultVehicleHal",
"FakeVehicleHardware",
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
],
header_libs: [
"IVehicleHardware",
@@ -58,7 +58,7 @@
"src/SubscriptionManager.cpp",
],
static_libs: [
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
],
header_libs: [
"IVehicleHardware",
diff --git a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h
index 15a6278..5d88f7c 100644
--- a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h
+++ b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h
@@ -43,7 +43,7 @@
class ConnectedClient {
public:
using CallbackType =
- std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>;
+ std::shared_ptr<aidl::android::hardware::automotive::vehicle::IVehicleCallback>;
ConnectedClient(std::shared_ptr<PendingRequestPool> requestPool, CallbackType callback);
@@ -57,7 +57,7 @@
// Returns {@code INVALID_ARG} error if any of the requestIds are duplicate with one of the
// pending request IDs or {@code TRY_AGAIN} error if the pending request pool is full and could
// no longer add requests.
- ::android::base::Result<void> addRequests(const std::unordered_set<int64_t>& requestIds);
+ android::base::Result<void> addRequests(const std::unordered_set<int64_t>& requestIds);
// Marks the requests as finished. Returns a list of request IDs that was pending and has been
// finished. It must be a set of the requested request IDs.
@@ -110,7 +110,7 @@
// callback.
static void sendUpdatedValues(
CallbackType callback,
- std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>&&
+ std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropValue>&&
updatedValues);
protected:
@@ -126,7 +126,7 @@
static void onGetValueResults(
const void* clientId, CallbackType callback,
std::shared_ptr<PendingRequestPool> requestPool,
- std::vector<::aidl::android::hardware::automotive::vehicle::GetValueResult> results);
+ std::vector<aidl::android::hardware::automotive::vehicle::GetValueResult> results);
};
} // namespace vehicle
diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h
index 5e7adfc..9735ed3 100644
--- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h
+++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h
@@ -39,39 +39,39 @@
namespace automotive {
namespace vehicle {
-class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::vehicle::BnVehicle {
+class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehicle::BnVehicle {
public:
using CallbackType =
- std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>;
+ std::shared_ptr<aidl::android::hardware::automotive::vehicle::IVehicleCallback>;
explicit DefaultVehicleHal(std::unique_ptr<IVehicleHardware> hardware);
~DefaultVehicleHal();
- ::ndk::ScopedAStatus getAllPropConfigs(
- ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs)
+ ndk::ScopedAStatus getAllPropConfigs(
+ aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs)
override;
- ::ndk::ScopedAStatus getValues(
+ ndk::ScopedAStatus getValues(
const CallbackType& callback,
- const ::aidl::android::hardware::automotive::vehicle::GetValueRequests& requests)
+ const aidl::android::hardware::automotive::vehicle::GetValueRequests& requests)
override;
- ::ndk::ScopedAStatus setValues(
+ ndk::ScopedAStatus setValues(
const CallbackType& callback,
- const ::aidl::android::hardware::automotive::vehicle::SetValueRequests& requests)
+ const aidl::android::hardware::automotive::vehicle::SetValueRequests& requests)
override;
- ::ndk::ScopedAStatus getPropConfigs(
+ ndk::ScopedAStatus getPropConfigs(
const std::vector<int32_t>& props,
- ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs)
+ aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs)
override;
- ::ndk::ScopedAStatus subscribe(
+ ndk::ScopedAStatus subscribe(
const CallbackType& callback,
- const std::vector<::aidl::android::hardware::automotive::vehicle::SubscribeOptions>&
+ const std::vector<aidl::android::hardware::automotive::vehicle::SubscribeOptions>&
options,
int32_t maxSharedMemoryFileCount) override;
- ::ndk::ScopedAStatus unsubscribe(const CallbackType& callback,
- const std::vector<int32_t>& propIds) override;
- ::ndk::ScopedAStatus returnSharedMemory(const CallbackType& callback,
- int64_t sharedMemoryId) override;
+ ndk::ScopedAStatus unsubscribe(const CallbackType& callback,
+ const std::vector<int32_t>& propIds) override;
+ ndk::ScopedAStatus returnSharedMemory(const CallbackType& callback,
+ int64_t sharedMemoryId) override;
binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
IVehicleHardware* getHardware();
@@ -81,11 +81,11 @@
friend class DefaultVehicleHalTest;
using GetValuesClient =
- GetSetValuesClient<::aidl::android::hardware::automotive::vehicle::GetValueResult,
- ::aidl::android::hardware::automotive::vehicle::GetValueResults>;
+ GetSetValuesClient<aidl::android::hardware::automotive::vehicle::GetValueResult,
+ aidl::android::hardware::automotive::vehicle::GetValueResults>;
using SetValuesClient =
- GetSetValuesClient<::aidl::android::hardware::automotive::vehicle::SetValueResult,
- ::aidl::android::hardware::automotive::vehicle::SetValueResults>;
+ GetSetValuesClient<aidl::android::hardware::automotive::vehicle::SetValueResult,
+ aidl::android::hardware::automotive::vehicle::SetValueResults>;
// A thread safe class to maintain an increasing request ID for each subscribe client. This
// class is safe to pass to async callbacks.
@@ -152,10 +152,10 @@
// mConfigsByPropId and mConfigFile are only modified during initialization, so no need to
// lock guard them.
- std::unordered_map<int32_t, ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig>
+ std::unordered_map<int32_t, aidl::android::hardware::automotive::vehicle::VehiclePropConfig>
mConfigsByPropId;
// Only modified in constructor, so thread-safe.
- std::unique_ptr<::ndk::ScopedFileDescriptor> mConfigFile;
+ std::unique_ptr<ndk::ScopedFileDescriptor> mConfigFile;
// PendingRequestPool is thread-safe.
std::shared_ptr<PendingRequestPool> mPendingRequestPool;
// SubscriptionManager is thread-safe.
@@ -176,31 +176,30 @@
// RecurrentTimer is thread-safe.
RecurrentTimer mRecurrentTimer;
- ::ndk::ScopedAIBinder_DeathRecipient mDeathRecipient;
+ ndk::ScopedAIBinder_DeathRecipient mDeathRecipient;
- ::android::base::Result<void> checkProperty(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
+ android::base::Result<void> checkProperty(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
- ::android::base::Result<std::vector<int64_t>> checkDuplicateRequests(
- const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>&
+ android::base::Result<std::vector<int64_t>> checkDuplicateRequests(
+ const std::vector<aidl::android::hardware::automotive::vehicle::GetValueRequest>&
requests);
- ::android::base::Result<std::vector<int64_t>> checkDuplicateRequests(
- const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>&
+ android::base::Result<std::vector<int64_t>> checkDuplicateRequests(
+ const std::vector<aidl::android::hardware::automotive::vehicle::SetValueRequest>&
requests);
- ::android::base::Result<void> checkSubscribeOptions(
- const std::vector<::aidl::android::hardware::automotive::vehicle::SubscribeOptions>&
+ android::base::Result<void> checkSubscribeOptions(
+ const std::vector<aidl::android::hardware::automotive::vehicle::SubscribeOptions>&
options);
- ::android::base::Result<void> checkReadPermission(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
+ android::base::Result<void> checkReadPermission(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
- ::android::base::Result<void> checkWritePermission(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
+ android::base::Result<void> checkWritePermission(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
- ::android::base::Result<
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig*>
+ android::base::Result<const aidl::android::hardware::automotive::vehicle::VehiclePropConfig*>
getConfig(int32_t propId) const;
void onBinderDiedWithContext(const AIBinder* clientId);
@@ -220,11 +219,11 @@
std::weak_ptr<IVehicleHardware> vehicleHardware,
std::shared_ptr<SubscribeIdByClient> subscribeIdByClient,
std::shared_ptr<SubscriptionClients> subscriptionClients, const CallbackType& callback,
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
static void onPropertyChangeEvent(
std::weak_ptr<SubscriptionManager> subscriptionManager,
- const std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>&
+ const std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropValue>&
updatedValues);
static void checkHealth(std::weak_ptr<IVehicleHardware> hardware,
diff --git a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h
index e739c8c..b0d6701 100644
--- a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h
+++ b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h
@@ -40,10 +40,10 @@
public:
using ClientIdType = const AIBinder*;
using CallbackType =
- std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>;
+ std::shared_ptr<aidl::android::hardware::automotive::vehicle::IVehicleCallback>;
using GetValueFunc = std::function<void(
const CallbackType& callback,
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value)>;
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value)>;
explicit SubscriptionManager(GetValueFunc&& action);
~SubscriptionManager();
@@ -54,9 +54,9 @@
// Returns error if any of the subscribe options is not valid. If error is returned, no
// properties would be subscribed.
// Returns ok if all the options are parsed correctly and all the properties are subscribed.
- ::android::base::Result<void> subscribe(
+ android::base::Result<void> subscribe(
const CallbackType& callback,
- const std::vector<::aidl::android::hardware::automotive::vehicle::SubscribeOptions>&
+ const std::vector<aidl::android::hardware::automotive::vehicle::SubscribeOptions>&
options,
bool isContinuousProperty);
@@ -64,23 +64,23 @@
// Returns error if the client was not subscribed before or one of the given property was not
// subscribed. If error is returned, no property would be unsubscribed.
// Returns ok if all the requested properties for the client are unsubscribed.
- ::android::base::Result<void> unsubscribe(ClientIdType client,
- const std::vector<int32_t>& propIds);
+ android::base::Result<void> unsubscribe(ClientIdType client,
+ const std::vector<int32_t>& propIds);
// Unsubscribes from all the properties for the client.
// Returns error if the client was not subscribed before. If error is returned, no property
// would be unsubscribed.
// Returns ok if all the properties for the client are unsubscribed.
- ::android::base::Result<void> unsubscribe(ClientIdType client);
+ android::base::Result<void> unsubscribe(ClientIdType client);
// For a list of updated properties, returns a map that maps clients subscribing to
// the updated properties to a list of updated values. This would only return on-change property
// clients that should be informed for the given updated values.
std::unordered_map<
CallbackType,
- std::vector<const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue*>>
+ std::vector<const aidl::android::hardware::automotive::vehicle::VehiclePropValue*>>
getSubscribedClients(
- const std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>&
+ const std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropValue>&
updatedValues);
// Checks whether the sample rate is valid.
@@ -145,7 +145,7 @@
std::shared_ptr<RecurrentTimer> mTimer;
const GetValueFunc mGetValue;
- static ::android::base::Result<int64_t> getInterval(float sampleRate);
+ static android::base::Result<int64_t> getInterval(float sampleRate);
// Checks whether the manager is empty. For testing purpose.
bool isEmpty();
diff --git a/automotive/vehicle/aidl/impl/vhal/test/Android.bp b/automotive/vehicle/aidl/impl/vhal/test/Android.bp
index 7122aa5..d89f2c1 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/vhal/test/Android.bp
@@ -24,7 +24,7 @@
srcs: ["*.cpp"],
static_libs: [
"DefaultVehicleHal",
- "VehicleHalUtils",
+ "VehicleHalUtilsVendor",
"libgtest",
"libgmock",
],
diff --git a/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp
index bdb0d31..682e9e6 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp
@@ -34,7 +34,7 @@
using ::aidl::android::hardware::automotive::vehicle::StatusCode;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue;
-class ConnectedClientTest : public ::testing::Test {
+class ConnectedClientTest : public testing::Test {
public:
void SetUp() override {
mCallback = ndk::SharedRefBase::make<MockVehicleCallback>();
diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
index 7443d5b..178498b 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
@@ -216,7 +216,7 @@
} // namespace
-class DefaultVehicleHalTest : public ::testing::Test {
+class DefaultVehicleHalTest : public testing::Test {
public:
void SetUp() override {
auto hardware = std::make_unique<MockVehicleHardware>();
@@ -479,7 +479,7 @@
auto hardware = std::make_unique<MockVehicleHardware>();
hardware->setPropertyConfigs(testConfigs);
- auto vhal = ::ndk::SharedRefBase::make<DefaultVehicleHal>(std::move(hardware));
+ auto vhal = ndk::SharedRefBase::make<DefaultVehicleHal>(std::move(hardware));
std::shared_ptr<IVehicle> client = IVehicle::fromBinder(vhal->asBinder());
VehiclePropConfigs output;
@@ -500,7 +500,7 @@
auto hardware = std::make_unique<MockVehicleHardware>();
hardware->setPropertyConfigs(testConfigs);
- auto vhal = ::ndk::SharedRefBase::make<DefaultVehicleHal>(std::move(hardware));
+ auto vhal = ndk::SharedRefBase::make<DefaultVehicleHal>(std::move(hardware));
std::shared_ptr<IVehicle> client = IVehicle::fromBinder(vhal->asBinder());
VehiclePropConfigs output;
@@ -818,7 +818,7 @@
INSTANTIATE_TEST_SUITE_P(
SetValuesInvalidRequestTests, SetValuesInvalidRequestTest,
- ::testing::ValuesIn(getSetValuesInvalidRequestTestCases()),
+ testing::ValuesIn(getSetValuesInvalidRequestTestCases()),
[](const testing::TestParamInfo<SetValuesInvalidRequestTest::ParamType>& info) {
return info.param.name;
});
@@ -1427,7 +1427,7 @@
INSTANTIATE_TEST_SUITE_P(
SubscribeInvalidOptionsTests, SubscribeInvalidOptionsTest,
- ::testing::ValuesIn(getSubscribeInvalidOptionsTestCases()),
+ testing::ValuesIn(getSubscribeInvalidOptionsTestCases()),
[](const testing::TestParamInfo<SubscribeInvalidOptionsTest::ParamType>& info) {
return info.param.name;
});
diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h
index c83164f..03bfd5b 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h
+++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h
@@ -43,35 +43,33 @@
// MockVehicleCallback is a mock VehicleCallback implementation that simply stores the results.
class MockVehicleCallback final
- : public ::aidl::android::hardware::automotive::vehicle::BnVehicleCallback {
+ : public aidl::android::hardware::automotive::vehicle::BnVehicleCallback {
public:
- ::ndk::ScopedAStatus onGetValues(
- const ::aidl::android::hardware::automotive::vehicle::GetValueResults& results)
- override;
- ::ndk::ScopedAStatus onSetValues(
- const ::aidl::android::hardware::automotive::vehicle::SetValueResults& results)
- override;
- ::ndk::ScopedAStatus onPropertyEvent(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropValues&,
+ ndk::ScopedAStatus onGetValues(
+ const aidl::android::hardware::automotive::vehicle::GetValueResults& results) override;
+ ndk::ScopedAStatus onSetValues(
+ const aidl::android::hardware::automotive::vehicle::SetValueResults& results) override;
+ ndk::ScopedAStatus onPropertyEvent(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValues&,
int32_t) override;
- ::ndk::ScopedAStatus onPropertySetError(
- const ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors&) override;
+ ndk::ScopedAStatus onPropertySetError(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropErrors&) override;
// Test functions
- std::optional<::aidl::android::hardware::automotive::vehicle::GetValueResults>
+ std::optional<aidl::android::hardware::automotive::vehicle::GetValueResults>
nextGetValueResults();
- std::optional<::aidl::android::hardware::automotive::vehicle::SetValueResults>
+ std::optional<aidl::android::hardware::automotive::vehicle::SetValueResults>
nextSetValueResults();
- std::optional<::aidl::android::hardware::automotive::vehicle::VehiclePropValues>
+ std::optional<aidl::android::hardware::automotive::vehicle::VehiclePropValues>
nextOnPropertyEventResults();
private:
std::mutex mLock;
- std::list<::aidl::android::hardware::automotive::vehicle::GetValueResults> mGetValueResults
+ std::list<aidl::android::hardware::automotive::vehicle::GetValueResults> mGetValueResults
GUARDED_BY(mLock);
- std::list<::aidl::android::hardware::automotive::vehicle::SetValueResults> mSetValueResults
+ std::list<aidl::android::hardware::automotive::vehicle::SetValueResults> mSetValueResults
GUARDED_BY(mLock);
- std::list<::aidl::android::hardware::automotive::vehicle::VehiclePropValues>
+ std::list<aidl::android::hardware::automotive::vehicle::VehiclePropValues>
mOnPropertyEventResults GUARDED_BY(mLock);
int32_t mSharedMemoryFileCount GUARDED_BY(mLock);
};
diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h
index 74d4fae..cb8b6a0 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h
+++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h
@@ -40,44 +40,44 @@
public:
~MockVehicleHardware();
- std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig>
+ std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropConfig>
getAllPropertyConfigs() const override;
- ::aidl::android::hardware::automotive::vehicle::StatusCode setValues(
+ aidl::android::hardware::automotive::vehicle::StatusCode setValues(
std::shared_ptr<const SetValuesCallback> callback,
- const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>&
+ const std::vector<aidl::android::hardware::automotive::vehicle::SetValueRequest>&
requests) override;
- ::aidl::android::hardware::automotive::vehicle::StatusCode getValues(
+ aidl::android::hardware::automotive::vehicle::StatusCode getValues(
std::shared_ptr<const GetValuesCallback> callback,
- const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>&
+ const std::vector<aidl::android::hardware::automotive::vehicle::GetValueRequest>&
requests) const override;
DumpResult dump(const std::vector<std::string>&) override;
- ::aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() override;
+ aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() override;
void registerOnPropertyChangeEvent(
std::unique_ptr<const PropertyChangeCallback> callback) override;
void registerOnPropertySetErrorEvent(std::unique_ptr<const PropertySetErrorCallback>) override;
// Test functions.
void setPropertyConfigs(
- const std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig>&
+ const std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropConfig>&
configs);
void addGetValueResponses(
- const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueResult>&
+ const std::vector<aidl::android::hardware::automotive::vehicle::GetValueResult>&
responses);
void addSetValueResponses(
- const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueResult>&
+ const std::vector<aidl::android::hardware::automotive::vehicle::SetValueResult>&
responses);
void setGetValueResponder(
- std::function<::aidl::android::hardware::automotive::vehicle::StatusCode(
+ std::function<aidl::android::hardware::automotive::vehicle::StatusCode(
std::shared_ptr<const GetValuesCallback>,
const std::vector<
- ::aidl::android::hardware::automotive::vehicle::GetValueRequest>&)>&&
+ aidl::android::hardware::automotive::vehicle::GetValueRequest>&)>&&
responder);
- std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>
+ std::vector<aidl::android::hardware::automotive::vehicle::GetValueRequest>
nextGetValueRequests();
- std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>
+ std::vector<aidl::android::hardware::automotive::vehicle::SetValueRequest>
nextSetValueRequests();
void setStatus(const char* functionName,
- ::aidl::android::hardware::automotive::vehicle::StatusCode status);
+ aidl::android::hardware::automotive::vehicle::StatusCode status);
void setSleepTime(int64_t timeInNano);
void setDumpResult(DumpResult result);
@@ -85,31 +85,31 @@
mutable std::mutex mLock;
mutable std::condition_variable mCv;
mutable std::atomic<int> mThreadCount;
- std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig> mPropertyConfigs
+ std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropConfig> mPropertyConfigs
GUARDED_BY(mLock);
- mutable std::list<std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>>
+ mutable std::list<std::vector<aidl::android::hardware::automotive::vehicle::GetValueRequest>>
mGetValueRequests GUARDED_BY(mLock);
- mutable std::list<std::vector<::aidl::android::hardware::automotive::vehicle::GetValueResult>>
+ mutable std::list<std::vector<aidl::android::hardware::automotive::vehicle::GetValueResult>>
mGetValueResponses GUARDED_BY(mLock);
- mutable std::list<std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>>
+ mutable std::list<std::vector<aidl::android::hardware::automotive::vehicle::SetValueRequest>>
mSetValueRequests GUARDED_BY(mLock);
- mutable std::list<std::vector<::aidl::android::hardware::automotive::vehicle::SetValueResult>>
+ mutable std::list<std::vector<aidl::android::hardware::automotive::vehicle::SetValueResult>>
mSetValueResponses GUARDED_BY(mLock);
- std::unordered_map<const char*, ::aidl::android::hardware::automotive::vehicle::StatusCode>
+ std::unordered_map<const char*, aidl::android::hardware::automotive::vehicle::StatusCode>
mStatusByFunctions GUARDED_BY(mLock);
int64_t mSleepTime GUARDED_BY(mLock) = 0;
std::unique_ptr<const PropertyChangeCallback> mPropertyChangeCallback GUARDED_BY(mLock);
- std::function<::aidl::android::hardware::automotive::vehicle::StatusCode(
+ std::function<aidl::android::hardware::automotive::vehicle::StatusCode(
std::shared_ptr<const GetValuesCallback>,
- const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>&)>
+ const std::vector<aidl::android::hardware::automotive::vehicle::GetValueRequest>&)>
mGetValueResponder GUARDED_BY(mLock);
template <class ResultType>
- ::aidl::android::hardware::automotive::vehicle::StatusCode returnResponse(
+ aidl::android::hardware::automotive::vehicle::StatusCode returnResponse(
std::shared_ptr<const std::function<void(std::vector<ResultType>)>> callback,
std::list<std::vector<ResultType>>* storedResponses) const;
template <class RequestType, class ResultType>
- ::aidl::android::hardware::automotive::vehicle::StatusCode handleRequestsLocked(
+ aidl::android::hardware::automotive::vehicle::StatusCode handleRequestsLocked(
const char* functionName,
std::shared_ptr<const std::function<void(std::vector<ResultType>)>> callback,
const std::vector<RequestType>& requests,
diff --git a/automotive/vehicle/aidl/impl/vhal/test/RecurrentTimerTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/RecurrentTimerTest.cpp
index d343cea..a033a24 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/RecurrentTimerTest.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/test/RecurrentTimerTest.cpp
@@ -28,7 +28,7 @@
namespace automotive {
namespace vehicle {
-class RecurrentTimerTest : public ::testing::Test {
+class RecurrentTimerTest : public testing::Test {
public:
std::shared_ptr<RecurrentTimer::Callback> getCallback(size_t token) {
return std::make_shared<RecurrentTimer::Callback>([this, token] {
diff --git a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp
index f81b1a2..2a468f6 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp
@@ -83,7 +83,7 @@
std::list<VehiclePropValue> mEvents GUARDED_BY(mLock);
};
-class SubscriptionManagerTest : public ::testing::Test {
+class SubscriptionManagerTest : public testing::Test {
public:
void SetUp() override {
mManager = std::make_unique<SubscriptionManager>(
@@ -95,7 +95,7 @@
},
0);
});
- mCallback = ::ndk::SharedRefBase::make<PropertyCallback>();
+ mCallback = ndk::SharedRefBase::make<PropertyCallback>();
// Keep the local binder alive.
mBinder = mCallback->asBinder();
mCallbackClient = IVehicleCallback::fromBinder(mBinder);
@@ -350,9 +350,9 @@
},
};
- SpAIBinder binder1 = ::ndk::SharedRefBase::make<PropertyCallback>()->asBinder();
+ SpAIBinder binder1 = ndk::SharedRefBase::make<PropertyCallback>()->asBinder();
std::shared_ptr<IVehicleCallback> client1 = IVehicleCallback::fromBinder(binder1);
- SpAIBinder binder2 = ::ndk::SharedRefBase::make<PropertyCallback>()->asBinder();
+ SpAIBinder binder2 = ndk::SharedRefBase::make<PropertyCallback>()->asBinder();
std::shared_ptr<IVehicleCallback> client2 = IVehicleCallback::fromBinder(binder2);
auto result = getManager()->subscribe(client1, options1, false);
ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message();
diff --git a/biometrics/face/aidl/Android.bp b/biometrics/face/aidl/Android.bp
index fff2c1d..174f1da 100644
--- a/biometrics/face/aidl/Android.bp
+++ b/biometrics/face/aidl/Android.bp
@@ -22,7 +22,6 @@
backend: {
java: {
platform_apis: true,
- srcs_available: true,
},
cpp: {
enabled: false,
diff --git a/bluetooth/audio/2.0/vts/OWNERS b/bluetooth/audio/2.0/vts/OWNERS
deleted file mode 100644
index b266b06..0000000
--- a/bluetooth/audio/2.0/vts/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-include platform/packages/modules/Bluetooth:/OWNERS
-
-cheneyni@google.com
diff --git a/bluetooth/audio/2.1/vts/OWNERS b/bluetooth/audio/2.1/vts/OWNERS
deleted file mode 100644
index b266b06..0000000
--- a/bluetooth/audio/2.1/vts/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-include platform/packages/modules/Bluetooth:/OWNERS
-
-cheneyni@google.com
diff --git a/bluetooth/audio/2.2/IBluetoothAudioProvider.hal b/bluetooth/audio/2.2/IBluetoothAudioProvider.hal
index f577537..7c91805 100644
--- a/bluetooth/audio/2.2/IBluetoothAudioProvider.hal
+++ b/bluetooth/audio/2.2/IBluetoothAudioProvider.hal
@@ -69,4 +69,12 @@
* encoding.
*/
updateAudioConfiguration(AudioConfiguration audioConfig);
+
+ /**
+ * Called when the supported latency mode is updated.
+ *
+ * @param allowed If the peripheral devices can't keep up with low latency
+ * mode, the API will be called with supported is false.
+ */
+ setLowLatencyModeAllowed(bool allowed);
};
diff --git a/bluetooth/audio/2.2/OWNERS b/bluetooth/audio/2.2/OWNERS
new file mode 100644
index 0000000..84f5b1e
--- /dev/null
+++ b/bluetooth/audio/2.2/OWNERS
@@ -0,0 +1,3 @@
+aliceypkuo@google.com
+ugoyu@google.com
+sattiraju@google.com
diff --git a/bluetooth/audio/2.2/default/BluetoothAudioProvider.cpp b/bluetooth/audio/2.2/default/BluetoothAudioProvider.cpp
index 202cfb9..62511e9 100644
--- a/bluetooth/audio/2.2/default/BluetoothAudioProvider.cpp
+++ b/bluetooth/audio/2.2/default/BluetoothAudioProvider.cpp
@@ -209,6 +209,18 @@
return Void();
}
+Return<void> BluetoothAudioProvider::setLowLatencyModeAllowed(bool allowed) {
+ LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_);
+
+ if (stack_iface_ == nullptr) {
+ LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_)
+ << " has NO session";
+ return Void();
+ }
+ LOG(INFO) << __func__ << " allowed: " << allowed;
+ return Void();
+}
+
} // namespace implementation
} // namespace V2_2
} // namespace audio
diff --git a/bluetooth/audio/2.2/default/BluetoothAudioProvider.h b/bluetooth/audio/2.2/default/BluetoothAudioProvider.h
index 425ea3b..90c158e 100644
--- a/bluetooth/audio/2.2/default/BluetoothAudioProvider.h
+++ b/bluetooth/audio/2.2/default/BluetoothAudioProvider.h
@@ -56,6 +56,8 @@
Return<void> updateAudioConfiguration(
const AudioConfiguration& audioConfig) override;
+ Return<void> setLowLatencyModeAllowed(bool allowed) override;
+
protected:
sp<BluetoothAudioDeathRecipient> death_recipient_;
diff --git a/bluetooth/audio/aidl/default/OWNERS b/bluetooth/audio/OWNERS
similarity index 98%
rename from bluetooth/audio/aidl/default/OWNERS
rename to bluetooth/audio/OWNERS
index 17ea464..a8e9bda 100644
--- a/bluetooth/audio/aidl/default/OWNERS
+++ b/bluetooth/audio/OWNERS
@@ -1,4 +1,4 @@
include platform/packages/modules/Bluetooth:/OWNERS
cheneyni@google.com
-aliceypkuo@google.com
\ No newline at end of file
+aliceypkuo@google.com
diff --git a/bluetooth/audio/aidl/Android.bp b/bluetooth/audio/aidl/Android.bp
index 5107240..52671b8 100644
--- a/bluetooth/audio/aidl/Android.bp
+++ b/bluetooth/audio/aidl/Android.bp
@@ -47,6 +47,7 @@
"//apex_available:platform",
"com.android.bluetooth",
],
+ min_sdk_version: "31",
},
},
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl
index 9a1557a..cc3c641 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl
@@ -40,4 +40,6 @@
void suspendStream();
void updateSourceMetadata(in android.hardware.audio.common.SourceMetadata sourceMetadata);
void updateSinkMetadata(in android.hardware.audio.common.SinkMetadata sinkMetadata);
+ void setLatencyMode(in android.hardware.bluetooth.audio.LatencyMode latencyMode);
+ void setCodecType(in android.hardware.bluetooth.audio.CodecType codecType);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LatencyMode.aidl
similarity index 88%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LatencyMode.aidl
index 4f29c0b..5583679 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LatencyMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
-@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+package android.hardware.bluetooth.audio;
+@Backing(type="int") @VintfStability
+enum LatencyMode {
+ UNKNOWN = 0,
+ LOW_LATENCY = 1,
+ FREE = 2,
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl
index 827f57d..81c2ce2 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl
@@ -18,6 +18,8 @@
import android.hardware.audio.common.SinkMetadata;
import android.hardware.audio.common.SourceMetadata;
+import android.hardware.bluetooth.audio.CodecType;
+import android.hardware.bluetooth.audio.LatencyMode;
import android.hardware.bluetooth.audio.PresentationPosition;
/**
@@ -78,4 +80,18 @@
* @param sinkMetadata as passed from Audio Framework
*/
void updateSinkMetadata(in SinkMetadata sinkMetadata);
+
+ /**
+ * Called when latency mode is changed.
+ *
+ * @param latencyMode latency mode from audio
+ */
+ void setLatencyMode(in LatencyMode latencyMode);
+
+ /**
+ * Called when codec type is changed.
+ *
+ * @param codecType codec type from audio
+ */
+ void setCodecType(in CodecType codecType);
}
diff --git a/audio/7.1/IStreamIn.hal b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LatencyMode.aidl
similarity index 74%
copy from audio/7.1/IStreamIn.hal
copy to bluetooth/audio/aidl/android/hardware/bluetooth/audio/LatencyMode.aidl
index abebe6a..0c354f7 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LatencyMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 The Android Open Source Project
+ * Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,9 +14,12 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.bluetooth.audio;
-import @7.0::IStreamIn;
-
-interface IStreamIn extends @7.0::IStreamIn {
-};
+@VintfStability
+@Backing(type="int")
+enum LatencyMode {
+ UNKNOWN,
+ LOW_LATENCY,
+ FREE,
+}
diff --git a/bluetooth/audio/aidl/vts/OWNERS b/bluetooth/audio/aidl/vts/OWNERS
deleted file mode 100644
index 17ea464..0000000
--- a/bluetooth/audio/aidl/vts/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-include platform/packages/modules/Bluetooth:/OWNERS
-
-cheneyni@google.com
-aliceypkuo@google.com
\ No newline at end of file
diff --git a/bluetooth/audio/utils/OWNERS b/bluetooth/audio/utils/OWNERS
deleted file mode 100644
index 17ea464..0000000
--- a/bluetooth/audio/utils/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-include platform/packages/modules/Bluetooth:/OWNERS
-
-cheneyni@google.com
-aliceypkuo@google.com
\ No newline at end of file
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
index f626db8..96cd9ef 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
@@ -508,6 +508,36 @@
}
}
+void BluetoothAudioSession::SetLatencyMode(LatencyMode latency_mode) {
+ std::lock_guard<std::recursive_mutex> guard(mutex_);
+ if (!IsSessionReady()) {
+ LOG(DEBUG) << __func__ << " - SessionType=" << toString(session_type_)
+ << " has NO session";
+ return;
+ }
+
+ auto hal_retval = stack_iface_->setLatencyMode(latency_mode);
+ if (!hal_retval.isOk()) {
+ LOG(WARNING) << __func__ << " - IBluetoothAudioPort SessionType="
+ << toString(session_type_) << " failed";
+ }
+}
+
+void BluetoothAudioSession::SetCodecType(CodecType codec_type) {
+ std::lock_guard<std::recursive_mutex> guard(mutex_);
+ if (!IsSessionReady()) {
+ LOG(DEBUG) << __func__ << " - SessionType=" << toString(session_type_)
+ << " has NO session";
+ return;
+ }
+
+ auto hal_retval = stack_iface_->setCodecType(codec_type);
+ if (!hal_retval.isOk()) {
+ LOG(WARNING) << __func__ << " - IBluetoothAudioPort SessionType="
+ << toString(session_type_) << " failed";
+ }
+}
+
bool BluetoothAudioSession::IsAidlAvailable() {
if (is_aidl_checked) return is_aidl_available;
is_aidl_available =
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.h b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.h
index 73bc0f8..5adc0e2 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.h
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.h
@@ -20,6 +20,7 @@
#include <aidl/android/hardware/audio/common/SourceMetadata.h>
#include <aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.h>
#include <aidl/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.h>
+#include <aidl/android/hardware/bluetooth/audio/LatencyMode.h>
#include <aidl/android/hardware/bluetooth/audio/SessionType.h>
#include <fmq/AidlMessageQueue.h>
#include <hardware/audio.h>
@@ -164,6 +165,8 @@
bool GetPresentationPosition(PresentationPosition& presentation_position);
void UpdateSourceMetadata(const struct source_metadata& source_metadata);
void UpdateSinkMetadata(const struct sink_metadata& sink_metadata);
+ void SetLatencyMode(LatencyMode latency_mode);
+ void SetCodecType(CodecType codec_type);
// The control function writes stream to FMQ
size_t OutWritePcmData(const void* buffer, size_t bytes);
diff --git a/camera/common/aidl/Android.bp b/camera/common/aidl/Android.bp
new file mode 100644
index 0000000..eca70aa
--- /dev/null
+++ b/camera/common/aidl/Android.bp
@@ -0,0 +1,19 @@
+aidl_interface {
+ name: "android.hardware.camera.common",
+ vendor_available: true,
+ srcs: ["android/hardware/camera/common/*.aidl"],
+ stability: "vintf",
+ backend: {
+ cpp: {
+ enabled: false,
+ },
+ java: {
+ enabled: false,
+ },
+ ndk: {
+ vndk: {
+ enabled: true,
+ },
+ },
+ },
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraDeviceStatus.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraDeviceStatus.aidl
index 4f29c0b..a53a914 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraDeviceStatus.aidl
@@ -31,9 +31,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
-@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+package android.hardware.camera.common;
+@Backing(type="int") @VintfStability
+enum CameraDeviceStatus {
+ NOT_PRESENT = 0,
+ PRESENT = 1,
+ ENUMERATING = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraMetadataType.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraMetadataType.aidl
index 5395b11..287dea3 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraMetadataType.aidl
@@ -31,13 +31,13 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.common;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum CameraMetadataType {
+ BYTE = 0,
+ INT32 = 1,
+ FLOAT = 2,
+ INT64 = 3,
+ DOUBLE = 4,
+ RATIONAL = 5,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraResourceCost.aidl
similarity index 92%
rename from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
rename to camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraResourceCost.aidl
index 4f29c0b..467f451 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraResourceCost.aidl
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.common;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable CameraResourceCost {
+ int resourceCost;
+ String[] conflictingDevices;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/Status.aidl
similarity index 87%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/Status.aidl
index 5395b11..e1ec189 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/Status.aidl
@@ -31,13 +31,15 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.common;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum Status {
+ OK = 0,
+ ILLEGAL_ARGUMENT = 1,
+ CAMERA_IN_USE = 2,
+ MAX_CAMERAS_IN_USE = 3,
+ METHOD_NOT_SUPPORTED = 4,
+ OPERATION_NOT_SUPPORTED = 5,
+ CAMERA_DISCONNECTED = 6,
+ INTERNAL_ERROR = 7,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TagBoundaryId.aidl
similarity index 91%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TagBoundaryId.aidl
index 4f29c0b..2c6b500 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TagBoundaryId.aidl
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
-@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+package android.hardware.camera.common;
+@Backing(type="long") @VintfStability
+enum TagBoundaryId {
+ AOSP = 0,
+ VENDOR = -2147483648,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TorchModeStatus.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TorchModeStatus.aidl
index 4f29c0b..cb1a2ae 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TorchModeStatus.aidl
@@ -31,9 +31,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
-@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+package android.hardware.camera.common;
+@Backing(type="int") @VintfStability
+enum TorchModeStatus {
+ NOT_AVAILABLE = 0,
+ AVAILABLE_OFF = 1,
+ AVAILABLE_ON = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/VendorTag.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/VendorTag.aidl
index 4f29c0b..b8b4ef4 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/VendorTag.aidl
@@ -31,9 +31,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.common;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable VendorTag {
+ int tagId;
+ String tagName;
+ android.hardware.camera.common.CameraMetadataType tagType;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/VendorTagSection.aidl
similarity index 91%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/VendorTagSection.aidl
index 4f29c0b..140fba4 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/VendorTagSection.aidl
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.common;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable VendorTagSection {
+ String sectionName;
+ android.hardware.camera.common.VendorTag[] tags;
}
diff --git a/camera/common/aidl/android/hardware/camera/common/CameraDeviceStatus.aidl b/camera/common/aidl/android/hardware/camera/common/CameraDeviceStatus.aidl
new file mode 100644
index 0000000..0e88ea8
--- /dev/null
+++ b/camera/common/aidl/android/hardware/camera/common/CameraDeviceStatus.aidl
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2021 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.camera.common;
+
+/**
+ * CameraDeviceStatus
+ *
+ * The current status of a camera device, as sent by a camera provider HAL
+ * through the ICameraProviderCallback::cameraDeviceStatusChange() call.
+ *
+ * At startup, the camera service must assume all internal camera devices listed
+ * by ICameraProvider::getCameraIdList() are in the PRESENT state. The provider
+ * must invoke ICameraProviderCallback::cameraDeviceStatusChange to inform the
+ * service of any initially NOT_PRESENT internal devices, and of any PRESENT
+ * external camera devices, as soon as the camera service has called
+ * ICameraProvider::setCallback().
+ *
+ * Allowed state transitions:
+ * PRESENT -> NOT_PRESENT
+ * NOT_PRESENT -> ENUMERATING
+ * NOT_PRESENT -> PRESENT
+ * ENUMERATING -> PRESENT
+ * ENUMERATING -> NOT_PRESENT
+ */
+@VintfStability
+@Backing(type="int")
+enum CameraDeviceStatus {
+ /**
+ * The camera device is not currently connected, and trying to reference it
+ * in provider method calls must return status code ILLEGAL_ARGUMENT.
+ *
+ */
+ NOT_PRESENT = 0,
+ /**
+ * The camera device is connected, and opening it is possible, as long as
+ * sufficient resources are available.
+ *
+ * By default, the framework must assume all devices returned by
+ * ICameraProvider::getCameraIdList() are in this state.
+ */
+ PRESENT = 1,
+ /**
+ * The camera device is connected, but it is undergoing enumeration and
+ * startup, and so opening the device must return CAMERA_IN_USE.
+ *
+ * Attempting to call ICameraProvider::getCameraCharacteristics() must
+ * succeed, however.
+ */
+ ENUMERATING = 2,
+}
diff --git a/radio/aidl/android/hardware/radio/network/NeighboringCell.aidl b/camera/common/aidl/android/hardware/camera/common/CameraMetadataType.aidl
similarity index 63%
copy from radio/aidl/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/common/aidl/android/hardware/camera/common/CameraMetadataType.aidl
index 270bdee..522bf9c 100644
--- a/radio/aidl/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/common/aidl/android/hardware/camera/common/CameraMetadataType.aidl
@@ -14,17 +14,19 @@
* limitations under the License.
*/
-package android.hardware.radio.network;
+package android.hardware.camera.common;
+/**
+ * Camera metadata type - duplicated from VNDK libcamera_metadata for vendor tag
+ * definitions.
+ */
@VintfStability
-parcelable NeighboringCell {
- /**
- * Combination of LAC and cell ID in 32 bits in GSM. Upper 16 bits is LAC and lower 16 bits is
- * CID (as described in TS 27.005).
- */
- String cid;
- /**
- * Received RSSI in GSM, level index of CPICH Received Signal Code Power in UMTS
- */
- int rssi;
+@Backing(type="int")
+enum CameraMetadataType {
+ BYTE = 0,
+ INT32 = 1,
+ FLOAT = 2,
+ INT64 = 3,
+ DOUBLE = 4,
+ RATIONAL = 5,
}
diff --git a/camera/common/aidl/android/hardware/camera/common/CameraResourceCost.aidl b/camera/common/aidl/android/hardware/camera/common/CameraResourceCost.aidl
new file mode 100644
index 0000000..a471c99
--- /dev/null
+++ b/camera/common/aidl/android/hardware/camera/common/CameraResourceCost.aidl
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2021 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.camera.common;
+
+/**
+ * CameraResourceCost:
+ *
+ * Structure defining the abstract resource cost of opening a camera device,
+ * and any usage conflicts between multiple camera devices.
+ *
+ * Obtainable via ICameraDevice::getResourceCost()
+ */
+@VintfStability
+parcelable CameraResourceCost {
+ /**
+ * The total resource "cost" of using this camera, represented as an integer
+ * value in the range [0, 100] where 100 represents total usage of the
+ * shared resource that is the limiting bottleneck of the camera subsystem.
+ * This may be a very rough estimate, and is used as a hint to the camera
+ * service to determine when to disallow multiple applications from
+ * simultaneously opening different cameras advertised by the camera
+ * service.
+ *
+ * The camera service must be able to simultaneously open and use any
+ * combination of camera devices exposed by the HAL where the sum of
+ * the resource costs of these cameras is <= 100. For determining cost,
+ * each camera device must be assumed to be configured and operating at
+ * the maximally resource-consuming framerate and stream size settings
+ * available in the configuration settings exposed for that device through
+ * the camera metadata.
+ *
+ * The camera service may still attempt to simultaneously open combinations
+ * of camera devices with a total resource cost > 100. This may succeed or
+ * fail. If this succeeds, combinations of configurations that are not
+ * supported due to resource constraints from having multiple open devices
+ * must fail during the configure calls. If the total resource cost is <=
+ * 100, open and configure must never fail for any stream configuration
+ * settings or other device capabilities that would normally succeed for a
+ * device when it is the only open camera device.
+ *
+ * This field may be used to determine whether background applications are
+ * allowed to use this camera device while other applications are using
+ * other camera devices. Note: multiple applications must never be allowed
+ * by the camera service to simultaneously open the same camera device.
+ *
+ * Example use cases:
+ *
+ * Ex. 1: Camera Device 0 = Back Camera
+ * Camera Device 1 = Front Camera
+ * - Using both camera devices causes a large framerate slowdown due to
+ * limited ISP bandwidth.
+ *
+ * Configuration:
+ *
+ * Camera Device 0 - resourceCost = 51
+ * conflicting_devices = empty
+ * Camera Device 1 - resourceCost = 51
+ * conflicting_devices = empty
+ *
+ * Result:
+ *
+ * Since the sum of the resource costs is > 100, if a higher-priority
+ * application has either device open, no lower-priority applications must
+ * be allowed by the camera service to open either device. If a
+ * lower-priority application is using a device that a higher-priority
+ * subsequently attempts to open, the lower-priority application must be
+ * forced to disconnect the device.
+ *
+ * If the highest-priority application chooses, it may still attempt to
+ * open both devices (since these devices are not listed as conflicting in
+ * the conflicting_devices fields), but usage of these devices may fail in
+ * the open or configure calls.
+ *
+ * Ex. 2: Camera Device 0 = Left Back Camera
+ * Camera Device 1 = Right Back Camera
+ * Camera Device 2 = Combined stereo camera using both right and left
+ * back camera sensors used by devices 0, and 1
+ * Camera Device 3 = Front Camera
+ * - Due to do hardware constraints, up to two cameras may be open at
+ * once. The combined stereo camera may never be used at the same time
+ * as either of the two back camera devices (device 0, 1), and typically
+ * requires too much bandwidth to use at the same time as the front
+ * camera (device 3).
+ *
+ * Configuration:
+ *
+ * Camera Device 0 - resourceCost = 50
+ * conflicting_devices = { 2 }
+ * Camera Device 1 - resourceCost = 50
+ * conflicting_devices = { 2 }
+ * Camera Device 2 - resourceCost = 100
+ * conflicting_devices = { 0, 1 }
+ * Camera Device 3 - resourceCost = 50
+ * conflicting_devices = empty
+ *
+ * Result:
+ *
+ * Based on the conflicting_devices fields, the camera service guarantees
+ * that the following sets of open devices must never be allowed: { 1, 2
+ * }, { 0, 2 }.
+ *
+ * Based on the resourceCost fields, if a high-priority foreground
+ * application is using camera device 0, a background application would be
+ * allowed to open camera device 1 or 3 (but would be forced to disconnect
+ * it again if the foreground application opened another device).
+ *
+ * The highest priority application may still attempt to simultaneously
+ * open devices 0, 2, and 3, but the HAL may fail in open or configure
+ * calls for this combination.
+ *
+ * Ex. 3: Camera Device 0 = Back Camera
+ * Camera Device 1 = Front Camera
+ * Camera Device 2 = Low-power Front Camera that uses the same sensor
+ * as device 1, but only exposes image stream
+ * resolutions that can be used in low-power mode
+ * - Using both front cameras (device 1, 2) at the same time is impossible
+ * due a shared physical sensor. Using the back and "high-power" front
+ * camera (device 1) may be impossible for some stream configurations due
+ * to hardware limitations, but the "low-power" front camera option may
+ * always be used as it has special dedicated hardware.
+ *
+ * Configuration:
+ *
+ * Camera Device 0 - resourceCost = 100
+ * conflicting_devices = empty
+ * Camera Device 1 - resourceCost = 100
+ * conflicting_devices = { 2 }
+ * Camera Device 2 - resourceCost = 0
+ * conflicting_devices = { 1 }
+ * Result:
+ *
+ * Based on the conflicting_devices fields, the camera service guarantees
+ * that the following sets of open devices must never be allowed:
+ * { 1, 2 }.
+ *
+ * Based on the resourceCost fields, only the highest priority application
+ * may attempt to open both device 0 and 1 at the same time. If a
+ * higher-priority application is not using device 1 or 2, a low-priority
+ * background application may open device 2 (but must be forced to
+ * disconnect it if a higher-priority application subsequently opens
+ * device 1 or 2).
+ */
+ int resourceCost;
+ /**
+ * An array of camera device IDs indicating other devices that cannot be
+ * simultaneously opened while this camera device is in use.
+ *
+ * This field is intended to be used to indicate that this camera device
+ * is a composite of several other camera devices, or otherwise has
+ * hardware dependencies that prohibit simultaneous usage. If there are no
+ * dependencies, an empty list may be returned to indicate this.
+ *
+ * The camera service must never simultaneously open any of the devices
+ * in this list while this camera device is open.
+ *
+ */
+ String[] conflictingDevices;
+}
diff --git a/camera/common/aidl/android/hardware/camera/common/Status.aidl b/camera/common/aidl/android/hardware/camera/common/Status.aidl
new file mode 100644
index 0000000..1ea6ee8
--- /dev/null
+++ b/camera/common/aidl/android/hardware/camera/common/Status.aidl
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2021 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.camera.common;
+
+/**
+ * Common enumeration and structure definitions for all HALs under
+ * android.hardware.camera
+ *
+ *
+ * Status codes for camera HAL method service specific errors.
+ *
+ */
+@VintfStability
+@Backing(type="int")
+enum Status {
+ /**
+ * Method call succeeded
+ */
+ OK = 0,
+ /**
+ * One of the arguments to the method call is invalid. For example,
+ * the camera ID is unknown.
+ */
+ ILLEGAL_ARGUMENT = 1,
+ /**
+ * The specified camera device is already in use
+ */
+ CAMERA_IN_USE = 2,
+ /**
+ * The HAL cannot support more simultaneous cameras in use.
+ */
+ MAX_CAMERAS_IN_USE = 3,
+ /**
+ * This HAL does not support this method.
+ */
+ METHOD_NOT_SUPPORTED = 4,
+ /**
+ * The specified camera device does not support this operation.
+ */
+ OPERATION_NOT_SUPPORTED = 5,
+ /**
+ * This camera device is no longer connected or otherwise available for use
+ */
+ CAMERA_DISCONNECTED = 6,
+ /**
+ * The HAL has encountered an internal error and cannot complete the
+ * request.
+ */
+ INTERNAL_ERROR = 7,
+}
diff --git a/audio/7.1/IStreamIn.hal b/camera/common/aidl/android/hardware/camera/common/TagBoundaryId.aidl
similarity index 73%
copy from audio/7.1/IStreamIn.hal
copy to camera/common/aidl/android/hardware/camera/common/TagBoundaryId.aidl
index abebe6a..f81e5b6 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/common/aidl/android/hardware/camera/common/TagBoundaryId.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 The Android Open Source Project
+ * Copyright (C) 2021 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.
@@ -14,9 +14,11 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.camera.common;
-import @7.0::IStreamIn;
-
-interface IStreamIn extends @7.0::IStreamIn {
-};
+@VintfStability
+@Backing(type="long")
+enum TagBoundaryId {
+ AOSP = 0x0,
+ VENDOR = 0x80000000,
+}
diff --git a/camera/common/aidl/android/hardware/camera/common/TorchModeStatus.aidl b/camera/common/aidl/android/hardware/camera/common/TorchModeStatus.aidl
new file mode 100644
index 0000000..42a8816
--- /dev/null
+++ b/camera/common/aidl/android/hardware/camera/common/TorchModeStatus.aidl
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2021 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.camera.common;
+
+/**
+ * TorchModeStatus:
+ *
+ * The current status of the torch mode on a given camera device, sent by a
+ * camera provider HAL via the ICameraProviderCallback::TorchModeStatusChange()
+ * call.
+ *
+ * The torch mode status of a camera device is applicable only when the camera
+ * device is present. The camera service must not call
+ * ICameraProvider::setTorchMode() to turn on torch mode of a camera device if
+ * the camera device is not present. At camera service startup time, the
+ * framework must assume torch modes are in the AVAILABLE_OFF state if the
+ * camera device is present and the camera characteristics entry
+ * android.flash.info.available is reported as true via
+ * ICameraProvider::getCameraCharacteristics() call. The same is assumed for
+ * external camera devices when they are initially connected.
+ *
+ * The camera service requires the following behaviors from the camera provider
+ * HAL when a camera device's status changes:
+ *
+ * 1. A previously-disconnected camera device becomes connected. After
+ * ICameraProviderCallback::CameraDeviceStatusChange() is invoked to inform
+ * the camera service that the camera device is present, the framework must
+ * assume the camera device's torch mode is in AVAILABLE_OFF state if it
+ * has a flash unit. The camera provider HAL does not need to invoke
+ * ICameraProviderCallback::TorchModeStatusChange() unless the flash unit
+ * is unavailable to use by ICameraProvider::setTorchMode().
+ *
+ * 2. A previously-connected camera becomes disconnected. After
+ * ICameraProviderCallback::CameraDeviceStatusChange() is invoked to inform
+ * the camera service that the camera device is not present, the framework
+ * must not call ICameraProvider::setTorchMode() for the disconnected camera
+ * device until it is connected again. The camera provider HAL does not
+ * need to invoke ICameraProviderCallback::TorchModeStatusChange()
+ * separately to inform that the flash unit has become NOT_AVAILABLE.
+ *
+ * 3. openCameraDevice() or openCameraDeviceVersion() is called to open a
+ * camera device. The camera provider HAL must invoke
+ * ICameraProviderCallback::TorchModeStatusChange() for all flash units
+ * that have entered NOT_AVAILABLE state and can not be turned on by
+ * calling ICameraProvider::setTorchMode() due to this open() call.
+ * openCameraDevice() must not trigger AVAILABLE_OFF before NOT_AVAILABLE
+ * for all flash units that have become unavailable.
+ *
+ * 4. ICameraDevice.close() is called to close a camera device. The camera
+ * provider HAL must call ICameraProviderCallback::torchModeStatusChange()
+ * for all flash units that have now entered the AVAILABLE_OFF state and
+ * can be turned on by calling ICameraProvider::setTorchMode() again because
+ * of sufficient new camera resources being freed up by this close() call.
+ *
+ * Note that the camera service calling ICameraProvider::setTorchMode()
+ * successfully must trigger AVAILABLE_OFF or AVAILABLE_ON callback for the
+ * given camera device. Additionally it must trigger AVAILABLE_OFF callbacks
+ * for other previously-on torch modes if HAL cannot keep multiple devices'
+ * flashlights on simultaneously.
+ */
+@VintfStability
+@Backing(type="int")
+enum TorchModeStatus {
+ /**
+ * The flash unit is no longer available and the torch mode can not be
+ * turned on by calling setTorchMode(). If the torch mode was AVAILABLE_ON,
+ * the flashlight must be turned off by the provider HAL before the provider
+ * HAL calls torchModeStatusChange().
+ */
+ NOT_AVAILABLE = 0,
+ /**
+ * A torch mode has become off and is available to be turned on via
+ * ICameraProvider::setTorchMode(). This may happen in the following
+ * cases:
+ * 1. After the resources to turn on the torch mode have become available.
+ * 2. After ICameraProvider::setTorchMode() is called to turn off the torch
+ * mode.
+ * 3. After the camera service turned on the torch mode for some other
+ * camera device and the provider HAL had to turn off the torch modes
+ * of other camera device(s) that were previously on, due to lack of
+ * resources to keep them all on.
+ */
+ AVAILABLE_OFF = 1,
+ /**
+ * A torch mode has become on and is available to be turned off via
+ * ICameraProvider::setTorchMode(). This can happen only after
+ * ICameraProvider::setTorchMode() has been called to turn on the torch mode.
+ */
+ AVAILABLE_ON = 2,
+}
diff --git a/radio/aidl/android/hardware/radio/network/NeighboringCell.aidl b/camera/common/aidl/android/hardware/camera/common/VendorTag.aidl
similarity index 63%
copy from radio/aidl/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/common/aidl/android/hardware/camera/common/VendorTag.aidl
index 270bdee..1de2fbf 100644
--- a/radio/aidl/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/common/aidl/android/hardware/camera/common/VendorTag.aidl
@@ -14,17 +14,17 @@
* limitations under the License.
*/
-package android.hardware.radio.network;
+package android.hardware.camera.common;
+import android.hardware.camera.common.CameraMetadataType;
+
+/**
+ * A single vendor-unique metadata tag.
+ * The full name of the tag is <sectionName>.<tagName>
+ */
@VintfStability
-parcelable NeighboringCell {
- /**
- * Combination of LAC and cell ID in 32 bits in GSM. Upper 16 bits is LAC and lower 16 bits is
- * CID (as described in TS 27.005).
- */
- String cid;
- /**
- * Received RSSI in GSM, level index of CPICH Received Signal Code Power in UMTS
- */
- int rssi;
+parcelable VendorTag {
+ int tagId;
+ String tagName;
+ CameraMetadataType tagType;
}
diff --git a/audio/7.1/IStreamIn.hal b/camera/common/aidl/android/hardware/camera/common/VendorTagSection.aidl
similarity index 66%
copy from audio/7.1/IStreamIn.hal
copy to camera/common/aidl/android/hardware/camera/common/VendorTagSection.aidl
index abebe6a..010eebc 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/common/aidl/android/hardware/camera/common/VendorTagSection.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 The Android Open Source Project
+ * Copyright (C) 2021 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.
@@ -14,9 +14,15 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.camera.common;
-import @7.0::IStreamIn;
+import android.hardware.camera.common.VendorTag;
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * A set of related vendor tags.
+ */
+@VintfStability
+parcelable VendorTagSection {
+ String sectionName;
+ VendorTag[] tags;
+}
diff --git a/camera/device/3.8/ICameraDevice.hal b/camera/device/3.8/ICameraDevice.hal
index 8832c68..09edb8b 100644
--- a/camera/device/3.8/ICameraDevice.hal
+++ b/camera/device/3.8/ICameraDevice.hal
@@ -113,7 +113,8 @@
*
* Identical to @3.7::ICameraDevice.isStreamCombinationSupported, except
* that it takes a @3.8::StreamConfiguration parameter, which could contain
- * additional information about a specific 10-bit dynamic range profile.
+ * additional information about a specific 10-bit dynamic range profile or
+ * stream use case.
*
*/
isStreamCombinationSupported_3_8(StreamConfiguration streams)
diff --git a/camera/device/3.8/ICameraDeviceSession.hal b/camera/device/3.8/ICameraDeviceSession.hal
index 88e4338..c3aa836 100644
--- a/camera/device/3.8/ICameraDeviceSession.hal
+++ b/camera/device/3.8/ICameraDeviceSession.hal
@@ -35,6 +35,8 @@
*
* - The requestedConfiguration allows the camera framework to configure
* 10-bit dynamic range profile.
+ * - The requestedConfiguration allows the camera framework to configure
+ * stream use cases.
*
* @return status Status code for the operation, one of:
* OK:
@@ -61,6 +63,7 @@
* input stream.
* - Invalid combination between a 10-bit dynamic range profile
* and none impl. defined 8-bit format for a particular stream.
+ * - Unsupported stream use case
* The camera service cannot filter out all possible illegal stream
* configurations, since some devices may support more simultaneous
* streams or larger stream resolutions than the minimum required
diff --git a/camera/device/3.8/types.hal b/camera/device/3.8/types.hal
index 9d1ac22..04a2450 100644
--- a/camera/device/3.8/types.hal
+++ b/camera/device/3.8/types.hal
@@ -17,6 +17,7 @@
package android.hardware.camera.device@3.8;
import @3.2::ErrorMsg;
+import @3.2::CameraMetadata;
import @3.2::MsgType;
import @3.2::ShutterMsg;
import @3.2::CameraMetadata;
@@ -24,6 +25,7 @@
import @3.7::Stream;
import android.hardware.camera.metadata@3.8::CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap;
+import android.hardware.camera.metadata@3.8::CameraMetadataEnumAndroidScalerAvailableStreamUseCases;
/**
* ShutterMsg:
@@ -80,7 +82,8 @@
* by the framework by its buffer resolution and format, and additionally by the
* HAL with the gralloc usage flags and the maximum in-flight buffer count.
*
- * This version extends the @3.7 Stream with the dynamic range profile field.
+ * This version extends the @3.7 Stream with the dynamic range profile and the
+ * stream use case field.
*/
struct Stream {
/**
@@ -98,6 +101,25 @@
*
*/
CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap dynamicRangeProfile;
+
+ /**
+ * The stream use case describing the stream's purpose
+ *
+ * This flag provides the camera device a hint on what user scenario this
+ * stream is intended for. With this flag, the camera device can optimize
+ * camera pipeline parameters, such as tuning, sensor mode, and ISP settings,
+ * for the intended use case.
+ *
+ * When this field is set to DEFAULT, the camera device should behave in
+ * the same way as in previous HAL versions, and optimize the camera pipeline
+ * based on stream format, data space, usage flag, and other stream properties.
+ *
+ * The HAL reports supported stream use cases in
+ * ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES. If the HAL doesn't support
+ * setting stream use cases, the camera framework leaves this field as
+ * DEFAULT.
+ */
+ CameraMetadataEnumAndroidScalerAvailableStreamUseCases useCase;
};
/**
@@ -115,7 +137,6 @@
/**
* The definition of operation mode from prior version.
- *
*/
@3.2::StreamConfigurationMode operationMode;
@@ -130,17 +151,7 @@
uint32_t streamConfigCounter;
/**
- * If an input stream is configured, whether the input stream is expected to
- * receive variable resolution images.
- *
- * This flag can only be set to true if the camera device supports
- * multi-resolution input streams by advertising input stream configurations in
- * physicalCameraMultiResolutionStreamConfigurations in its physical cameras'
- * characteristics.
- *
- * When this flag is set to true, the input stream's width and height can be
- * any one of the supported multi-resolution input stream sizes.
+ * The definition of multi-resolution input image flag from prior version.
*/
bool multiResolutionInputImage;
};
-
diff --git a/camera/device/aidl/Android.bp b/camera/device/aidl/Android.bp
new file mode 100644
index 0000000..b6cbea4
--- /dev/null
+++ b/camera/device/aidl/Android.bp
@@ -0,0 +1,27 @@
+aidl_interface {
+ name: "android.hardware.camera.device",
+ vendor_available: true,
+ srcs: ["android/hardware/camera/device/*.aidl"],
+ stability: "vintf",
+ imports: [
+ "android.hardware.common-V2",
+ "android.hardware.common.fmq-V1",
+ "android.hardware.camera.common",
+ "android.hardware.camera.metadata",
+ "android.hardware.graphics.common"
+ ],
+ backend: {
+ cpp: {
+ enabled: false,
+ },
+ java: {
+ sdk_version: "module_current",
+ enabled: false,
+ },
+ ndk: {
+ vndk: {
+ enabled: true,
+ },
+ },
+ },
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferCache.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferCache.aidl
index 4f29c0b..9439172 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferCache.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable BufferCache {
+ int streamId;
+ long bufferId;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferRequest.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferRequest.aidl
index 4f29c0b..c40a24a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferRequest.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable BufferRequest {
+ int streamId;
+ int numBuffersRequested;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferRequestStatus.aidl
similarity index 87%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferRequestStatus.aidl
index 5395b11..72fb61b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferRequestStatus.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,13 +31,12 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.device;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum BufferRequestStatus {
+ OK = 0,
+ FAILED_PARTIAL = 1,
+ FAILED_CONFIGURING = 2,
+ FAILED_ILLEGAL_ARGUMENTS = 3,
+ FAILED_UNKNOWN = 4,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferStatus.aidl
similarity index 89%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferStatus.aidl
index 4f29c0b..43a2b35 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferStatus.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
-@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+package android.hardware.camera.device;
+@Backing(type="int") @VintfStability
+enum BufferStatus {
+ OK = 0,
+ ERROR = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlob.aidl
similarity index 88%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlob.aidl
index 4f29c0b..520181c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlob.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable CameraBlob {
+ android.hardware.camera.device.CameraBlobId blobId;
+ int blobSizeBytes;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.aidl
similarity index 88%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.aidl
index 4f29c0b..632499d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
-@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+package android.hardware.camera.device;
+@Backing(type="int") @VintfStability
+enum CameraBlobId {
+ JPEG = 255,
+ JPEG_APP_SEGMENTS = 256,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraMetadata.aidl
similarity index 91%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraMetadata.aidl
index 4f29c0b..b96d69e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraMetadata.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,8 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable CameraMetadata {
+ byte[] metadata;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraOfflineSessionInfo.aidl
similarity index 85%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraOfflineSessionInfo.aidl
index 4f29c0b..1ad8e11 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraOfflineSessionInfo.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable CameraOfflineSessionInfo {
+ android.hardware.camera.device.OfflineStream[] offlineStreams;
+ android.hardware.camera.device.OfflineRequest[] offlineRequests;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CaptureRequest.aidl
similarity index 77%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CaptureRequest.aidl
index 4f29c0b..6b5b256 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CaptureRequest.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,15 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable CaptureRequest {
+ int frameNumber;
+ long fmqSettingsSize;
+ android.hardware.camera.device.CameraMetadata settings;
+ android.hardware.camera.device.StreamBuffer inputBuffer;
+ int inputWidth;
+ int inputHeight;
+ android.hardware.camera.device.StreamBuffer[] outputBuffers;
+ android.hardware.camera.device.PhysicalCameraSetting[] physicalCameraSettings;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CaptureResult.aidl
similarity index 78%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CaptureResult.aidl
index 4f29c0b..a820e2c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CaptureResult.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,14 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable CaptureResult {
+ int frameNumber;
+ long fmqResultSize;
+ android.hardware.camera.device.CameraMetadata result;
+ android.hardware.camera.device.StreamBuffer[] outputBuffers;
+ android.hardware.camera.device.StreamBuffer inputBuffer;
+ int partialResult;
+ android.hardware.camera.device.PhysicalCameraMetadata[] physicalCameraMetadata;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ErrorCode.aidl
similarity index 87%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ErrorCode.aidl
index 4f29c0b..2f9887a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ErrorCode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
-@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+package android.hardware.camera.device;
+@Backing(type="int") @VintfStability
+enum ErrorCode {
+ ERROR_DEVICE = 1,
+ ERROR_REQUEST = 2,
+ ERROR_RESULT = 3,
+ ERROR_BUFFER = 4,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ErrorMsg.aidl
similarity index 88%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ErrorMsg.aidl
index 4f29c0b..b2e9512 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ErrorMsg.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable ErrorMsg {
+ int frameNumber;
+ int errorStreamId;
+ android.hardware.camera.device.ErrorCode errorCode;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/HalStream.aidl
similarity index 78%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/HalStream.aidl
index 4f29c0b..a5784bc 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/HalStream.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,15 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable HalStream {
+ int id;
+ android.hardware.graphics.common.PixelFormat overrideFormat;
+ android.hardware.graphics.common.BufferUsage producerUsage;
+ android.hardware.graphics.common.BufferUsage consumerUsage;
+ int maxBuffers;
+ android.hardware.graphics.common.Dataspace overrideDataSpace;
+ String physicalCameraId;
+ boolean supportOffline;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl
similarity index 64%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl
index 4f29c0b..80bfc3c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,17 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+interface ICameraDevice {
+ void dumpState(in ParcelFileDescriptor fd);
+ android.hardware.camera.device.CameraMetadata getCameraCharacteristics();
+ android.hardware.camera.device.CameraMetadata getPhysicalCameraCharacteristics(in String physicalCameraId);
+ android.hardware.camera.common.CameraResourceCost getResourceCost();
+ boolean isStreamCombinationSupported(in android.hardware.camera.device.StreamConfiguration streams);
+ android.hardware.camera.device.ICameraDeviceSession open(in android.hardware.camera.device.ICameraDeviceCallback callback);
+ android.hardware.camera.device.ICameraInjectionSession openInjectionSession(in android.hardware.camera.device.ICameraDeviceCallback callback);
+ void setTorchMode(boolean on);
+ void turnOnTorchWithStrengthLevel(int torchStrength);
+ int getTorchStrengthLevel();
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceCallback.aidl
similarity index 74%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceCallback.aidl
index 4f29c0b..7b79c6c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceCallback.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+interface ICameraDeviceCallback {
+ void notify(in android.hardware.camera.device.NotifyMsg[] msgs);
+ void processCaptureResult(in android.hardware.camera.device.CaptureResult[] results);
+ android.hardware.camera.device.BufferRequestStatus requestStreamBuffers(in android.hardware.camera.device.BufferRequest[] bufReqs, out android.hardware.camera.device.StreamBufferRet[] buffers);
+ void returnStreamBuffers(in android.hardware.camera.device.StreamBuffer[] buffers);
}
diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceSession.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceSession.aidl
new file mode 100644
index 0000000..2196d37
--- /dev/null
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceSession.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.camera.device;
+@VintfStability
+interface ICameraDeviceSession {
+ void close();
+ android.hardware.camera.device.HalStream[] configureStreams(in android.hardware.camera.device.StreamConfiguration requestedConfiguration);
+ android.hardware.camera.device.CameraMetadata constructDefaultRequestSettings(in android.hardware.camera.device.RequestTemplate type);
+ void flush();
+ android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> getCaptureRequestMetadataQueue();
+ android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> getCaptureResultMetadataQueue();
+ boolean isReconfigurationRequired(in android.hardware.camera.device.CameraMetadata oldSessionParams, in android.hardware.camera.device.CameraMetadata newSessionParams);
+ int processCaptureRequest(in android.hardware.camera.device.CaptureRequest[] requests, in android.hardware.camera.device.BufferCache[] cachesToRemove);
+ oneway void signalStreamFlush(in int[] streamIds, in int streamConfigCounter);
+ android.hardware.camera.device.ICameraOfflineSession switchToOffline(in int[] streamsToKeep, out android.hardware.camera.device.CameraOfflineSessionInfo offlineSessionInfo);
+ void repeatingRequestEnd(in int frameNumber, in int[] streamIds);
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraInjectionSession.aidl
similarity index 80%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraInjectionSession.aidl
index 4f29c0b..80f74f3 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraInjectionSession.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+interface ICameraInjectionSession {
+ void configureInjectionStreams(in android.hardware.camera.device.StreamConfiguration requestedConfiguration, in android.hardware.camera.device.CameraMetadata characteristics);
+ android.hardware.camera.device.ICameraDeviceSession getCameraDeviceSession();
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraOfflineSession.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraOfflineSession.aidl
index 4f29c0b..727d856 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraOfflineSession.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+interface ICameraOfflineSession {
+ void close();
+ android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> getCaptureResultMetadataQueue();
+ void setCallback(in android.hardware.camera.device.ICameraDeviceCallback cb);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/NotifyMsg.aidl
similarity index 87%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/NotifyMsg.aidl
index 4f29c0b..3ad7e52 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/NotifyMsg.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+union NotifyMsg {
+ android.hardware.camera.device.ErrorMsg error;
+ android.hardware.camera.device.ShutterMsg shutter;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/OfflineRequest.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/OfflineRequest.aidl
index 4f29c0b..6e6f29d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/OfflineRequest.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable OfflineRequest {
+ int frameNumber;
+ int[] pendingStreams;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/OfflineStream.aidl
similarity index 88%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/OfflineStream.aidl
index 4f29c0b..54cb1fe 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/OfflineStream.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable OfflineStream {
+ int id;
+ int numOutstandingBuffers;
+ long[] circulatingBufferIds;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/PhysicalCameraMetadata.aidl
similarity index 86%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/PhysicalCameraMetadata.aidl
index 4f29c0b..3d66ab8 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/PhysicalCameraMetadata.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable PhysicalCameraMetadata {
+ long fmqMetadataSize;
+ String physicalCameraId;
+ android.hardware.camera.device.CameraMetadata metadata;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/PhysicalCameraSetting.aidl
similarity index 86%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/PhysicalCameraSetting.aidl
index 4f29c0b..a6c241d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/PhysicalCameraSetting.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable PhysicalCameraSetting {
+ long fmqSettingsSize;
+ String physicalCameraId;
+ android.hardware.camera.device.CameraMetadata settings;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.aidl
similarity index 85%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.aidl
index 5395b11..b70b899 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,13 +31,14 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.device;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum RequestTemplate {
+ PREVIEW = 1,
+ STILL_CAPTURE = 2,
+ VIDEO_RECORD = 3,
+ VIDEO_SNAPSHOT = 4,
+ ZERO_SHUTTER_LAG = 5,
+ MANUAL = 6,
+ VENDOR_TEMPLATE_START = 1073741824,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ShutterMsg.aidl
similarity index 89%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ShutterMsg.aidl
index 4f29c0b..ce059ac 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ShutterMsg.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable ShutterMsg {
+ int frameNumber;
+ long timestamp;
+ long readoutTimestamp;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl
similarity index 68%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl
index 4f29c0b..d2f295a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,21 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable Stream {
+ int id;
+ android.hardware.camera.device.StreamType streamType;
+ int width;
+ int height;
+ android.hardware.graphics.common.PixelFormat format;
+ android.hardware.graphics.common.BufferUsage usage;
+ android.hardware.graphics.common.Dataspace dataSpace;
+ android.hardware.camera.device.StreamRotation rotation;
+ String physicalCameraId;
+ int bufferSize;
+ int groupId;
+ android.hardware.camera.metadata.SensorPixelMode[] sensorPixelModesUsed;
+ android.hardware.camera.metadata.RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile;
+ android.hardware.camera.metadata.ScalerAvailableStreamUseCases useCase;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBuffer.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBuffer.aidl
index 4f29c0b..8fabf03 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBuffer.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,13 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable StreamBuffer {
+ int streamId;
+ long bufferId;
+ android.hardware.common.NativeHandle buffer;
+ android.hardware.camera.device.BufferStatus status;
+ android.hardware.common.NativeHandle acquireFence;
+ android.hardware.common.NativeHandle releaseFence;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBufferRequestError.aidl
similarity index 87%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBufferRequestError.aidl
index 5395b11..f450149 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBufferRequestError.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,13 +31,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.device;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum StreamBufferRequestError {
+ NO_BUFFER_AVAILABLE = 1,
+ MAX_BUFFER_EXCEEDED = 2,
+ STREAM_DISCONNECTED = 3,
+ UNKNOWN_ERROR = 4,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBufferRet.aidl
similarity index 88%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBufferRet.aidl
index 4f29c0b..3998cc3 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBufferRet.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable StreamBufferRet {
+ int streamId;
+ android.hardware.camera.device.StreamBuffersVal val;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBuffersVal.aidl
similarity index 83%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBuffersVal.aidl
index 4f29c0b..bebc9fc 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBuffersVal.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+union StreamBuffersVal {
+ android.hardware.camera.device.StreamBufferRequestError error = android.hardware.camera.device.StreamBufferRequestError.UNKNOWN_ERROR;
+ android.hardware.camera.device.StreamBuffer[] buffers;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.aidl
similarity index 80%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.aidl
index 4f29c0b..f340578 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,12 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.device;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable StreamConfiguration {
+ android.hardware.camera.device.Stream[] streams;
+ android.hardware.camera.device.StreamConfigurationMode operationMode;
+ android.hardware.camera.device.CameraMetadata sessionParams;
+ int streamConfigCounter;
+ boolean multiResolutionInputImage;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl
similarity index 80%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl
index 5395b11..bdef412 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,13 +31,17 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.device;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum StreamConfigurationMode {
+ NORMAL_MODE = 0,
+ CONSTRAINED_HIGH_SPEED_MODE = 1,
+ VENDOR_MODE_0 = 32768,
+ VENDOR_MODE_1 = 32769,
+ VENDOR_MODE_2 = 32770,
+ VENDOR_MODE_3 = 32771,
+ VENDOR_MODE_4 = 32772,
+ VENDOR_MODE_5 = 32773,
+ VENDOR_MODE_6 = 32774,
+ VENDOR_MODE_7 = 32775,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamRotation.aidl
similarity index 87%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamRotation.aidl
index 4f29c0b..2ef4274 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamRotation.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
-@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+package android.hardware.camera.device;
+@Backing(type="int") @VintfStability
+enum StreamRotation {
+ ROTATION_0 = 0,
+ ROTATION_90 = 1,
+ ROTATION_180 = 2,
+ ROTATION_270 = 3,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamType.aidl
similarity index 89%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamType.aidl
index 4f29c0b..0f13fe8 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamType.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
-@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+package android.hardware.camera.device;
+@Backing(type="int") @VintfStability
+enum StreamType {
+ OUTPUT = 0,
+ INPUT = 1,
}
diff --git a/camera/device/aidl/android/hardware/camera/device/BufferCache.aidl b/camera/device/aidl/android/hardware/camera/device/BufferCache.aidl
new file mode 100644
index 0000000..660250d
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/BufferCache.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+/**
+ * BufferCache:
+ *
+ * A bufferId associated with a certain stream.
+ * Buffers are passed between camera service and camera HAL via bufferId except
+ * the first time a new buffer is being passed to HAL in CaptureRequest. Camera
+ * service and camera HAL therefore need to maintain a cached map of bufferId
+ * and corresponing native handle.
+ *
+ */
+@VintfStability
+parcelable BufferCache {
+ /**
+ * The ID of the stream this list is associated with.
+ */
+
+ int streamId;
+ /**
+ * A cached buffer ID associated with streamId.
+ */
+ long bufferId;
+}
diff --git a/audio/7.1/IStreamIn.hal b/camera/device/aidl/android/hardware/camera/device/BufferRequest.aidl
similarity index 81%
rename from audio/7.1/IStreamIn.hal
rename to camera/device/aidl/android/hardware/camera/device/BufferRequest.aidl
index abebe6a..4a26db9 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/device/aidl/android/hardware/camera/device/BufferRequest.aidl
@@ -14,9 +14,11 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.camera.device;
-import @7.0::IStreamIn;
+@VintfStability
+parcelable BufferRequest {
+ int streamId;
-interface IStreamIn extends @7.0::IStreamIn {
-};
+ int numBuffersRequested;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/BufferRequestStatus.aidl b/camera/device/aidl/android/hardware/camera/device/BufferRequestStatus.aidl
new file mode 100644
index 0000000..0530173
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/BufferRequestStatus.aidl
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+@VintfStability
+@Backing(type="int")
+enum BufferRequestStatus {
+ /**
+ * Method call succeeded and all requested buffers are returned.
+ */
+ OK = 0,
+ /**
+ * Method call failed for some streams. Check per stream status for each
+ * returned StreamBufferRet.
+ */
+ FAILED_PARTIAL = 1,
+ /**
+ * Method call failed for all streams and no buffers are returned at all.
+ * Camera service is about to or is performing configureStreams. HAL must
+ * wait until next configureStreams call is finished before requesting
+ * buffers again.
+ */
+ FAILED_CONFIGURING = 2,
+ /**
+ * Method call failed for all streams and no buffers are returned at all.
+ * Failure due to bad BufferRequest input, eg: unknown streamId or repeated
+ * streamId.
+ */
+ FAILED_ILLEGAL_ARGUMENTS = 3,
+ /**
+ * Method call failed for all streams and no buffers are returned at all.
+ * Failure due to unknown reason, or all streams has individual failing
+ * reason. For the latter case, check per stream status for each returned
+ * StreamBufferRet.
+ */
+ FAILED_UNKNOWN = 4,
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/BufferStatus.aidl b/camera/device/aidl/android/hardware/camera/device/BufferStatus.aidl
new file mode 100644
index 0000000..9439e70
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/BufferStatus.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+/**
+ * BufferStatus:
+ *
+ * The current status of a single stream buffer.
+ */
+@VintfStability
+@Backing(type="int")
+enum BufferStatus {
+ /**
+ * The buffer is in a normal state, and can be used after waiting on its
+ * sync fence.
+ */
+ OK = 0,
+
+ /**
+ * The buffer does not contain valid data, and the data in it must not be
+ * used. The sync fence must still be waited on before reusing the buffer.
+ */
+ ERROR = 1,
+}
diff --git a/audio/7.1/IStreamIn.hal b/camera/device/aidl/android/hardware/camera/device/CameraBlob.aidl
similarity index 76%
copy from audio/7.1/IStreamIn.hal
copy to camera/device/aidl/android/hardware/camera/device/CameraBlob.aidl
index abebe6a..085efa6 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/device/aidl/android/hardware/camera/device/CameraBlob.aidl
@@ -14,9 +14,13 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.camera.device;
-import @7.0::IStreamIn;
+import android.hardware.camera.device.CameraBlobId;
-interface IStreamIn extends @7.0::IStreamIn {
-};
+@VintfStability
+parcelable CameraBlob {
+ CameraBlobId blobId;
+
+ int blobSizeBytes;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/CameraBlobId.aidl b/camera/device/aidl/android/hardware/camera/device/CameraBlobId.aidl
new file mode 100644
index 0000000..8c303d9
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/CameraBlobId.aidl
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+/**
+ * CameraBlob:
+ *
+ * Transport header for camera blob types; generally compressed JPEG buffers in
+ * output streams.
+ *
+ * To capture JPEG images, a stream is created using the pixel format
+ * HAL_PIXEL_FORMAT_BLOB and dataspace HAL_DATASPACE_V0_JFIF. The buffer size
+ * for the stream is calculated by the framework, based on the static metadata
+ * field android.jpeg.maxSize. Since compressed JPEG images are of variable
+ * size, the HAL needs to include the final size of the compressed image using
+ * this structure inside the output stream buffer. The camera blob ID field must
+ * be set to CameraBlobId::JPEG.
+ *
+ * The transport header must be at the end of the JPEG output stream
+ * buffer. That means the jpegBlobId must start at byte[buffer_size -
+ * sizeof(CameraBlob)], where the buffer_size is the size of gralloc
+ * buffer. Any HAL using this transport header must account for it in
+ * android.jpeg.maxSize. The JPEG data itself starts at the beginning of the
+ * buffer and must be blobSize bytes long.
+ *
+ * It also supports transport of JPEG APP segments blob, which contains JPEG APP1 to
+ * APPn (Application Marker) segments as specified in JEITA CP-3451.
+ *
+ * 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, and is assigned to both
+ * Stream width and Stream bufferSize. Camera framework sets
+ * 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
+ * structure inside the output stream buffer. The camera blob ID field must be
+ * set to CameraBlobId::JPEG_APP_SEGMENTS.
+ *
+ * The transport header must be at the end of the JPEG APP segments output stream
+ * buffer. That means the blobId must start at byte[buffer_size -
+ * sizeof(CameraBlob)], where the buffer_size is the size of gralloc
+ * buffer. The JPEG APP segments data itself starts at the beginning of the
+ * buffer and must be blobSize bytes long.
+ */
+@VintfStability
+@Backing(type="int")
+enum CameraBlobId {
+ JPEG = 0x00FF,
+
+ JPEG_APP_SEGMENTS = 0x100,
+}
diff --git a/audio/7.1/IStreamIn.hal b/camera/device/aidl/android/hardware/camera/device/CameraMetadata.aidl
similarity index 65%
copy from audio/7.1/IStreamIn.hal
copy to camera/device/aidl/android/hardware/camera/device/CameraMetadata.aidl
index abebe6a..dd8bb54 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/device/aidl/android/hardware/camera/device/CameraMetadata.aidl
@@ -14,9 +14,16 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.camera.device;
-import @7.0::IStreamIn;
-
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * Wrapper parcelable for CameraMetadata
+ */
+@VintfStability
+parcelable CameraMetadata {
+ /**
+ * A serialized metadata buffer created by libcamera_metadata.
+ * Access by casting to a camera_metadata* and using libcamera_metadata methods
+ */
+ byte[] metadata;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/CameraOfflineSessionInfo.aidl b/camera/device/aidl/android/hardware/camera/device/CameraOfflineSessionInfo.aidl
new file mode 100644
index 0000000..f635fe2
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/CameraOfflineSessionInfo.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.OfflineRequest;
+import android.hardware.camera.device.OfflineStream;
+
+/**
+ * CameraOfflineSessionInfo:
+ *
+ * Information about pending outputs that's being transferred to an offline
+ * session from an active session using the
+ * ICameraDeviceSession#switchToOffline method.
+ *
+ */
+@VintfStability
+parcelable CameraOfflineSessionInfo {
+ /**
+ * Information on what streams will be preserved in offline session.
+ * Streams not listed here will be removed by camera service after
+ * switchToOffline call returns.
+ */
+ OfflineStream[] offlineStreams;
+
+ /**
+ * Information for requests that will be handled by offline session
+ * Camera service will validate this matches what camera service has on
+ * record.
+ */
+ OfflineRequest[] offlineRequests;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/CaptureRequest.aidl b/camera/device/aidl/android/hardware/camera/device/CaptureRequest.aidl
new file mode 100644
index 0000000..1dad07a
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/CaptureRequest.aidl
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.CameraMetadata;
+import android.hardware.camera.device.PhysicalCameraSetting;
+import android.hardware.camera.device.StreamBuffer;
+
+/**
+ * CaptureRequest:
+ *
+ * A single request for image capture/buffer reprocessing, sent to the Camera
+ * HAL device by the framework in processCaptureRequest().
+ *
+ * The request contains the settings to be used for this capture, and the set of
+ * output buffers to write the resulting image data in. It may optionally
+ * contain an input buffer, in which case the request is for reprocessing that
+ * input buffer instead of capturing a new image with the camera sensor. The
+ * capture is identified by the frameNumber.
+ *
+ * In response, the camera HAL device must send a CaptureResult
+ * structure asynchronously to the framework, using the processCaptureResult()
+ * callback.
+ */
+@VintfStability
+parcelable CaptureRequest {
+ /**
+ * The frame number is an incrementing integer set by the framework to
+ * uniquely identify this capture. It needs to be returned in the result
+ * call, and is also used to identify the request in asynchronous
+ * notifications sent to ICameraDevice3Callback::notify().
+ */
+ int frameNumber;
+
+ /**
+ * If non-zero, read settings from request queue instead
+ * (see ICameraDeviceSession.getCaptureRequestMetadataQueue).
+ * If zero, read settings from .settings field.
+ */
+ long fmqSettingsSize;
+
+ /**
+ * If fmqSettingsSize is zero,
+ * the settings buffer contains the capture and processing parameters for
+ * the request. As a special case, an empty settings buffer indicates that
+ * the settings are identical to the most-recently submitted capture
+ * request. A empty buffer cannot be used as the first submitted request
+ * after a configureStreams() call.
+ *
+ * This field must be used if fmqSettingsSize is zero. It must not be used
+ * if fmqSettingsSize is non-zero.
+ */
+ CameraMetadata settings;
+
+ /**
+ * The input stream buffer to use for this request, if any.
+ *
+ * An invalid inputBuffer is signified by a null inputBuffer::buffer, in
+ * which case the value of all other members of inputBuffer must be ignored.
+ *
+ * If inputBuffer is invalid, then the request is for a new capture from the
+ * imager. If inputBuffer is valid, the request is for reprocessing the
+ * image contained in inputBuffer, and the HAL must release the inputBuffer
+ * back to the client in a subsequent processCaptureResult call.
+ *
+ * The HAL is required to wait on the acquire sync fence of the input buffer
+ * before accessing it.
+ *
+ */
+ StreamBuffer inputBuffer;
+ /**
+ * The width and height of the input buffer for this capture request.
+ *
+ * These fields will be [0, 0] if no input buffer exists in the capture
+ * request.
+ *
+ * If the stream configuration contains an input stream and has the
+ * multiResolutionInputImage flag set to true, the camera client may submit a
+ * reprocessing request with input buffer size different than the
+ * configured input stream size. In that case, the inputWith and inputHeight
+ * fields will be the actual size of the input image.
+ *
+ * If the stream configuration contains an input stream and the
+ * multiResolutionInputImage flag is false, the inputWidth and inputHeight must
+ * match the input stream size.
+ */
+ int inputWidth;
+
+ int inputHeight;
+
+ /**
+ * An array of at least 1 stream buffers, to be filled with image
+ * data from this capture/reprocess. The HAL must wait on the acquire fences
+ * of each stream buffer before writing to them.
+ *
+ * The HAL takes ownership of the handles in outputBuffers; the client
+ * must not access them until they are returned in a CaptureResult.
+ *
+ * Any or all of the buffers included here may be brand new in this
+ * request (having never before seen by the HAL).
+ */
+ StreamBuffer[] outputBuffers;
+
+ /**
+ * A vector containing individual camera settings for logical camera backed by multiple physical
+ * devices. In case the vector is empty, Hal should use the settings field. The
+ * individual settings should only be honored for physical devices that have respective Hal
+ * stream. Physical devices that have a corresponding Hal stream but don't have attached
+ * settings here should use the settings field.
+ * If any of the physical settings in the array are applied on one or more devices, then the
+ * visual effect on any Hal streams attached to the logical camera is undefined.
+ */
+ PhysicalCameraSetting[] physicalCameraSettings;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/CaptureResult.aidl b/camera/device/aidl/android/hardware/camera/device/CaptureResult.aidl
new file mode 100644
index 0000000..1522439
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/CaptureResult.aidl
@@ -0,0 +1,209 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.CameraMetadata;
+import android.hardware.camera.device.PhysicalCameraMetadata;
+import android.hardware.camera.device.StreamBuffer;
+
+/**
+ * CaptureResult:
+ *
+ * The result of a single capture/reprocess by the camera HAL device. This is
+ * sent to the framework asynchronously with processCaptureResult(), in
+ * response to a single capture request sent to the HAL with
+ * processCaptureRequest(). Multiple processCaptureResult() calls may be
+ * performed by the HAL for each request.
+ *
+ * Each call, all with the same frame
+ * number, may contain some subset of the output buffers, and/or the result
+ * metadata.
+ *
+ * The result structure contains the output metadata from this capture, and the
+ * set of output buffers that have been/will be filled for this capture. Each
+ * output buffer may come with a release sync fence that the framework must wait
+ * on before reading, in case the buffer has not yet been filled by the HAL.
+ *
+ * The metadata may be provided multiple times for a single frame number. The
+ * framework must accumulate together the final result set by combining each
+ * partial result together into the total result set.
+ *
+ * If an input buffer is given in a request, the HAL must return it in one of
+ * the processCaptureResult calls, and the call may be to just return the
+ * input buffer, without metadata and output buffers; the sync fences must be
+ * handled the same way they are done for output buffers.
+ *
+ * Performance considerations:
+ *
+ * Applications receive these partial results immediately, so sending partial
+ * results is a highly recommended performance optimization to avoid the total
+ * pipeline latency before sending the results for what is known very early on
+ * in the pipeline.
+ *
+ * A typical use case might be calculating the AF state halfway through the
+ * pipeline; by sending the state back to the framework immediately, we get a
+ * 50% performance increase and perceived responsiveness of the auto-focus.
+ *
+ * Physical camera metadata needs to be generated if and only if a
+ * request is pending on a stream from that physical camera. For example,
+ * if the processCaptureRequest call doesn't request on physical camera
+ * streams, the physicalCameraMetadata field of the CaptureResult being returned
+ * should be an 0-size vector. If the processCaptureRequest call requests on
+ * streams from one of the physical camera, the physicalCameraMetadata field
+ * should contain one metadata describing the capture from that physical camera.
+ *
+ * For a CaptureResult that contains physical camera metadata, its
+ * partialResult field must be android.request.partialResultCount. In other
+ * words, the physicalCameraMetadata must only be contained in a final capture
+ * result.
+ */
+@VintfStability
+parcelable CaptureResult {
+ /**
+ * The frame number is an incrementing integer set by the framework in the
+ * submitted request to uniquely identify this capture. It is also used to
+ * identify the request in asynchronous notifications sent to
+ * ICameraDevice3Callback::notify().
+ */
+ int frameNumber;
+
+ /**
+ * If non-zero, read result from result queue instead
+ * (see ICameraDeviceSession.getCaptureResultMetadataQueue).
+ * If zero, read result from .result field.
+ */
+ long fmqResultSize;
+
+ /**
+ * The result metadata for this capture. This contains information about the
+ * final capture parameters, the state of the capture and post-processing
+ * hardware, the state of the 3A algorithms, if enabled, and the output of
+ * any enabled statistics units.
+ *
+ * If there was an error producing the result metadata, result must be an
+ * empty metadata buffer, and notify() must be called with
+ * ErrorCode::ERROR_RESULT.
+ *
+ * Multiple calls to processCaptureResult() with a given frameNumber
+ * may include (partial) result metadata.
+ *
+ * Partial metadata submitted must not include any metadata key returned
+ * in a previous partial result for a given frame. Each new partial result
+ * for that frame must also set a distinct partialResult value.
+ *
+ * If notify has been called with ErrorCode::ERROR_RESULT, all further
+ * partial results for that frame are ignored by the framework.
+ */
+ CameraMetadata result;
+
+ /**
+ * The completed output stream buffers for this capture.
+ *
+ * They may not yet be filled at the time the HAL calls
+ * processCaptureResult(); the framework must wait on the release sync
+ * fences provided by the HAL before reading the buffers.
+ *
+ * The StreamBuffer::buffer handle must be null for all returned buffers;
+ * the client must cache the handle and look it up via the combination of
+ * frame number and stream ID.
+ *
+ * The number of output buffers returned must be less than or equal to the
+ * matching capture request's count. If this is less than the buffer count
+ * in the capture request, at least one more call to processCaptureResult
+ * with the same frameNumber must be made, to return the remaining output
+ * buffers to the framework. This may only be zero if the structure includes
+ * valid result metadata or an input buffer is returned in this result.
+ *
+ * The HAL must set the stream buffer's release sync fence to a valid sync
+ * fd, or to null if the buffer has already been filled.
+ *
+ * If the HAL encounters an error while processing the buffer, and the
+ * buffer is not filled, the buffer's status field must be set to ERROR. If
+ * the HAL did not wait on the acquire fence before encountering the error,
+ * the acquire fence must be copied into the release fence, to allow the
+ * framework to wait on the fence before reusing the buffer.
+ *
+ * The acquire fence must be set to null for all output buffers.
+ *
+ * This vector may be empty; if so, at least one other processCaptureResult
+ * call must be made (or have been made) by the HAL to provide the filled
+ * output buffers.
+ *
+ * When processCaptureResult is called with a new buffer for a frame,
+ * all previous frames' buffers for that corresponding stream must have been
+ * already delivered (the fences need not have yet been signaled).
+ *
+ * Buffers for a frame may be sent to framework before the corresponding
+ * SHUTTER-notify call is made by the HAL.
+ *
+ * Performance considerations:
+ *
+ * Buffers delivered to the framework are not dispatched to the
+ * application layer until a start of exposure timestamp has been received
+ * via a SHUTTER notify() call. It is highly recommended to
+ * dispatch that call as early as possible.
+ */
+ StreamBuffer[] outputBuffers;
+
+ /**
+ * The handle for the input stream buffer for this capture, if any.
+ *
+ * It may not yet be consumed at the time the HAL calls
+ * processCaptureResult(); the framework must wait on the release sync fence
+ * provided by the HAL before reusing the buffer.
+ *
+ * The HAL must handle the sync fences the same way they are done for
+ * outputBuffers.
+ *
+ * Only one input buffer is allowed to be sent per request. Similarly to
+ * output buffers, the ordering of returned input buffers must be
+ * maintained by the HAL.
+ *
+ * Performance considerations:
+ *
+ * The input buffer should be returned as early as possible. If the HAL
+ * supports sync fences, it can call processCaptureResult to hand it back
+ * with sync fences being set appropriately. If the sync fences are not
+ * supported, the buffer can only be returned when it is consumed, which
+ * may take long time; the HAL may choose to copy this input buffer to make
+ * the buffer return sooner.
+ */
+ StreamBuffer inputBuffer;
+
+ /**
+ * In order to take advantage of partial results, the HAL must set the
+ * static metadata android.request.partialResultCount to the number of
+ * partial results it sends for each frame.
+ *
+ * Each new capture result with a partial result must set
+ * this field to a distinct inclusive value between
+ * 1 and android.request.partialResultCount.
+ *
+ * HALs not wishing to take advantage of this feature must not
+ * set an android.request.partialResultCount or partial_result to a value
+ * other than 1.
+ *
+ * This value must be set to 0 when a capture result contains buffers only
+ * and no metadata.
+ */
+ int partialResult;
+
+ /**
+ * The physical metadata for logical multi-camera.
+ */
+ PhysicalCameraMetadata[] physicalCameraMetadata;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/ErrorCode.aidl b/camera/device/aidl/android/hardware/camera/device/ErrorCode.aidl
new file mode 100644
index 0000000..9a0f26c
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/ErrorCode.aidl
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+/**
+ * Defined error codes for the NotifyMsg union in ICameraDeviceCallback.notify callbacks.
+ */
+@VintfStability
+@Backing(type="int")
+enum ErrorCode {
+ /**
+ * A serious failure occurred. No further frames or buffer streams must
+ * be produced by the device. Device must be treated as closed. The
+ * client must reopen the device to use it again. The frameNumber field
+ * is unused.
+ */
+ ERROR_DEVICE = 1,
+
+ /**
+ * An error has occurred in processing a request. No output (metadata or
+ * buffers) must be produced for this request. The frameNumber field
+ * specifies which request has been dropped. Subsequent requests are
+ * unaffected, and the device remains operational.
+ */
+ ERROR_REQUEST = 2,
+
+ /**
+ * An error has occurred in producing an output result metadata buffer
+ * for a request, but output stream buffers for it must still be
+ * available. Subsequent requests are unaffected, and the device remains
+ * operational. The frameNumber field specifies the request for which
+ * result metadata won't be available.
+ */
+ ERROR_RESULT = 3,
+
+ /**
+ * An error has occurred in placing an output buffer into a stream for a
+ * request. The frame metadata and other buffers may still be
+ * available. Subsequent requests are unaffected, and the device remains
+ * operational. The frameNumber field specifies the request for which the
+ * buffer was dropped, and errorStreamId indicates the stream
+ * that dropped the frame.
+ */
+ ERROR_BUFFER = 4,
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/ErrorMsg.aidl b/camera/device/aidl/android/hardware/camera/device/ErrorMsg.aidl
new file mode 100644
index 0000000..56bc9f1
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/ErrorMsg.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.ErrorCode;
+
+/**
+ * ErrorMsg:
+ *
+ * Message contents for MsgType::ERROR
+ */
+@VintfStability
+parcelable ErrorMsg {
+ /**
+ * Frame number of the request the error applies to. 0 if the frame number
+ * isn't applicable to the error.
+ */
+ int frameNumber;
+
+ /**
+ * Pointer to the stream that had a failure. -1 if the stream isn't
+ * applicable to the error.
+ */
+ int errorStreamId;
+
+ /**
+ * The code for this error.
+ */
+ ErrorCode errorCode;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/HalStream.aidl b/camera/device/aidl/android/hardware/camera/device/HalStream.aidl
new file mode 100644
index 0000000..b8ec3de
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/HalStream.aidl
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+/**
+ * HalStream:
+ *
+ * The camera HAL's response to each requested stream configuration.
+ *
+ * The HAL may specify the desired format, maximum buffers, usage flags, physical camera id for
+ * each stream.
+ *
+ */
+@VintfStability
+parcelable HalStream {
+ /**
+ * Stream ID - a nonnegative integer identifier for a stream.
+ *
+ * The ID must be one of the stream IDs passed into configureStreams.
+ */
+ int id;
+
+ /**
+ * An override pixel format for the buffers in this stream.
+ *
+ * The HAL must respect the requested format in Stream unless it is
+ * IMPLEMENTATION_DEFINED, in which case the override format here must be
+ * used by the client instead, for this stream. This allows cross-platform
+ * HALs to use a standard format since IMPLEMENTATION_DEFINED formats often
+ * require device-specific information. In all other cases, the
+ * overrideFormat must match the requested format.
+ *
+ * When HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform
+ * gralloc module must select a format based on the usage flags provided by
+ * the camera device and the other endpoint of the stream.
+ */
+ android.hardware.graphics.common.PixelFormat overrideFormat;
+
+ /**
+ * The bitfield gralloc usage flags for this stream, as needed by the HAL.
+ *
+ * For output streams, these are the HAL's producer usage flags. For input
+ * streams, these are the HAL's consumer usage flags. The usage flags from
+ * the producer and the consumer must be combined together and then passed
+ * to the platform graphics allocator HAL for allocating the gralloc buffers
+ * for each stream.
+ *
+ * If the stream's type is INPUT, then producerUsage must be 0, and
+ * consumerUsage must be set. For other types, producerUsage must be set,
+ * and consumerUsage must be 0.
+ */
+ android.hardware.graphics.common.BufferUsage producerUsage;
+
+ android.hardware.graphics.common.BufferUsage consumerUsage;
+
+ /**
+ * The maximum number of buffers the HAL device may need to have dequeued at
+ * the same time. The HAL device may not have more buffers in-flight from
+ * this stream than this value.
+ */
+ int maxBuffers;
+
+ /**
+ * A bitfield override dataSpace for the buffers in this stream.
+ *
+ * The HAL must respect the requested dataSpace in Stream unless it is
+ * IMPLEMENTATION_DEFINED, in which case the override dataSpace here must be
+ * used by the client instead, for this stream. This allows cross-platform
+ * HALs to use a specific dataSpace since IMPLEMENTATION_DEFINED formats often
+ * require device-specific information for correct selection. In all other cases, the
+ * overrideFormat must match the requested format.
+ */
+ android.hardware.graphics.common.Dataspace overrideDataSpace;
+
+ /**
+ * The physical camera id the current Hal stream belongs to.
+ *
+ * If current camera device isn't a logical camera, or the Hal stream isn't
+ * from a physical camera of the logical camera, this must be an empty
+ * string.
+ *
+ * A logical camera is a camera device backed by multiple physical camera
+ * devices.
+ *
+ * When not empty, this field is the <id> field of one of the full-qualified device
+ * instance names returned by getCameraIdList().
+ */
+ String physicalCameraId;
+
+ /**
+ * Whether this stream can be switch to offline mode.
+ *
+ * For devices that does not support the OFFLINE_PROCESSING capability, this
+ * fields will always be false.
+ *
+ * For backward compatible camera devices that support the
+ * OFFLINE_PROCESSING capability: any input stream and any output stream
+ * that can be output of the input stream must set this field to true. Also
+ * any stream of YUV420_888 format or JPEG format, with CPU_READ usage flag,
+ * must set this field to true.
+ *
+ * For depth only camera devices that support the OFFLINE_PROCESSING
+ * capability: any DEPTH16 output stream must set this field to true.
+ *
+ * All other streams are up to camera HAL to advertise support or not,
+ * though it is not recommended to list support for streams with
+ * hardware composer or video encoder usage flags as these streams tend
+ * to be targeted continuously and can lead to long latency when trying to
+ * switch to offline.
+ *
+ */
+ boolean supportOffline;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl
new file mode 100644
index 0000000..f1f26d8
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl
@@ -0,0 +1,372 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.common.CameraResourceCost;
+import android.hardware.camera.device.CameraMetadata;
+import android.hardware.camera.device.ICameraDeviceCallback;
+import android.hardware.camera.device.ICameraDeviceSession;
+import android.hardware.camera.device.ICameraInjectionSession;
+import android.hardware.camera.device.StreamConfiguration;
+
+import android.os.ParcelFileDescriptor;
+
+/**
+ * Camera device interface
+ *
+ * Supports the android.hardware.Camera API, and the android.hardware.camera2
+ * API at LIMITED or better hardware level.
+ *
+ */
+@VintfStability
+interface ICameraDevice {
+ /**
+ * dumpState:
+ *
+ * Print out debugging state for the camera device. This may be called by
+ * the framework when the camera service is asked for a debug dump, which
+ * happens when using the dumpsys tool, or when capturing a bugreport.
+ *
+ * The passed-in file descriptor can be used to write debugging text using
+ * dprintf() or write().
+ *
+ * In case this camera device has been disconnected, the dump must not fail,
+ * but may simply print out 'Device disconnected' or equivalent.
+ *
+ * Performance requirements:
+ *
+ * This must be a non-blocking call. The HAL should return from this call
+ * in 1ms, must return from this call in 10ms. This call must avoid
+ * deadlocks, as it may be called at any point during camera operation.
+ * Any synchronization primitives used (such as mutex locks or semaphores)
+ * must be acquired with a timeout.
+ *
+ * @param fd The file descriptor to which the camera HAL must write any dumpState information.
+ */
+ void dumpState(in ParcelFileDescriptor fd);
+
+ /**
+ * getCameraCharacteristics:
+ *
+ * Return the static camera information for this camera device. This
+ * information may not change between consecutive calls.
+ *
+ * When an external camera is disconnected, its camera id becomes
+ * invalid. Calling this method with this invalid camera id must result in an
+ * ILLEGAL_ARGUMENT ServiceSpecificException on returning; this may happen even before the
+ * device status callback is invoked by the HAL.
+ *
+ * A service specific error will be returned on the following conditions
+ * INTERNAL_ERROR:
+ * The camera device cannot be opened due to an internal
+ * error.
+ * CAMERA_DISCONNECTED:
+ * An external camera device has been disconnected, and is no longer
+ * available. This camera device interface is now stale, and a new
+ * instance must be acquired if the device is reconnected. All
+ * subsequent calls on this interface must return
+ * CAMERA_DISCONNECTED.
+ *
+ * @return The static metadata for this camera device, or an empty metadata
+ * structure if status is not OK.
+ *
+ */
+ CameraMetadata getCameraCharacteristics();
+
+ /**
+ * getPhysicalCameraCharacteristics:
+ *
+ * Return the static camera information for a physical camera ID backing
+ * this logical camera device. This information may not change between consecutive calls.
+ *
+ * The characteristics of all cameras returned by
+ * ICameraProvider::getCameraIdList() must be queried via
+ * getCameraCharacteristics(). Calling getPhysicalCameraCharacteristics() on
+ * those cameras must return ILLEGAL_ARGUMENT ServiceSpecificException.
+ *
+ * @param physicalCameraId The physical camera id parsed from the logical
+ * camera's ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS static metadata
+ * key. The framework assumes that this ID is just the <id> part of fully
+ * qualified camera device name "device@<major>.<minor>/<type>/<id>". And
+ * the physical camera must be of the same version and type as the parent
+ * logical camera device.
+ *
+ * A service specific error will be returned on the following conditions
+ * INTERNAL_ERROR:
+ * The camera device cannot be opened due to an internal
+ * error.
+ * CAMERA_DISCONNECTED:
+ * An external camera device has been disconnected, and is no longer
+ * available. This camera device interface is now stale, and a new
+ * instance must be acquired if the device is reconnected. All
+ * subsequent calls on this interface must return
+ * CAMERA_DISCONNECTED.
+ * ILLEGAL_ARGUMENT:
+ * If the physicalCameraId is not a valid physical camera Id outside
+ * of ICameraProvider::getCameraIdList().
+ *
+ * @return The static metadata for this logical camera device's physical device, or an empty
+ * metadata structure if a service specific error is returned.
+ *
+ */
+ CameraMetadata getPhysicalCameraCharacteristics(in String physicalCameraId);
+
+ /**
+ * Get camera device resource cost information.
+ *
+ * A service specific error will be returned on the following conditions
+ * INTERNAL_ERROR:
+ * An unexpected internal camera HAL error occurred, and the
+ * resource cost is not available.
+ * CAMERA_DISCONNECTED:
+ * An external camera device has been disconnected, and is no longer
+ * available. This camera device interface is now stale, and a new
+ * instance must be acquired if the device is reconnected. All
+ * subsequent calls on this interface must return
+ * CAMERA_DISCONNECTED.
+ * @return resourceCost
+ * The resources required to open this camera device, or unspecified
+ * values if status is not OK.
+ */
+ CameraResourceCost getResourceCost();
+
+ /**
+ * isStreamCombinationSupported:
+ *
+ * Check for device support of specific camera stream combination.
+ *
+ * The streamList must contain at least one output-capable stream, and may
+ * not contain more than one input-capable stream.
+ * In contrast to regular stream configuration the framework does not create
+ * or initialize any actual streams. This means that Hal must not use or
+ * consider the stream "id" value.
+ *
+ * ------------------------------------------------------------------------
+ *
+ * Preconditions:
+ *
+ * The framework can call this method at any time before, during and
+ * after active session configuration. This means that calls must not
+ * impact the performance of pending camera requests in any way. In
+ * particular there must not be any glitches or delays during normal
+ * camera streaming.
+ *
+ * Performance requirements:
+ * This call is expected to be significantly faster than stream
+ * configuration. In general HW and SW camera settings must not be
+ * changed and there must not be a user-visible impact on camera performance.
+ *
+ *
+ * A service specific error will be returned on the following conditions
+ *
+ * INTERNAL_ERROR:
+ * The stream combination query cannot complete due to internal
+ * error.
+ * @param streams The StreamConfiguration to be tested for support.
+ * @return true in case the stream combination is supported, false otherwise.
+ *
+ */
+ boolean isStreamCombinationSupported(in StreamConfiguration streams);
+
+ /**
+ * open:
+ *
+ * Power on and initialize this camera device for active use, returning a
+ * session handle for active operations.
+ *
+ * @param callback Interface to invoke by the HAL for device asynchronous
+ * events.
+ *
+ * A service specific error will be returned on the following conditions
+ * INTERNAL_ERROR:
+ * The camera device cannot be opened due to an internal
+ * error.
+ * ILLEGAL_ARGUMENT:
+ * The callbacks handle is invalid (for example, it is null).
+ * CAMERA_IN_USE:
+ * This camera device is already open.
+ * MAX_CAMERAS_IN_USE:
+ * The maximal number of camera devices that can be
+ * opened concurrently were opened already.
+ * CAMERA_DISCONNECTED:
+ * This external camera device has been disconnected, and is no
+ * longer available. This interface is now stale, and a new instance
+ * must be acquired if the device is reconnected. All subsequent
+ * calls on this interface must return CAMERA_DISCONNECTED.
+ * @return The interface to the newly-opened camera session,
+ * or null if status is not OK.
+ */
+ ICameraDeviceSession open(in ICameraDeviceCallback callback);
+
+ /**
+ * openInjection:
+ *
+ * Similar to open, except that this return an ICameraInjectionSession instead.
+ * Details about ICameraInjectionSession can be found in ICameraInjectionSession.aidl
+ *
+ * @param callback Interface to invoke by the HAL for device asynchronous
+ * events.
+ *
+ * A service specific error will be returned on the following conditions
+ * INTERNAL_ERROR:
+ * The camera device cannot be opened due to an internal
+ * error.
+ * ILLEGAL_ARGUMENT:
+ * The callbacks handle is invalid (for example, it is null).
+ * CAMERA_IN_USE:
+ * This camera device is already open.
+ * MAX_CAMERAS_IN_USE:
+ * The maximal number of camera devices that can be
+ * opened concurrently were opened already.
+ * CAMERA_DISCONNECTED:
+ * This external camera device has been disconnected, and is no
+ * longer available. This interface is now stale, and a new instance
+ * must be acquired if the device is reconnected. All subsequent
+ * calls on this interface must return CAMERA_DISCONNECTED.
+ * @return The interface to the newly-opened camera session,
+ * or null if status is not OK.
+ */
+ ICameraInjectionSession openInjectionSession(in ICameraDeviceCallback callback);
+
+ /**
+ * setTorchMode:
+ *
+ * Turn on or off the torch mode of the flash unit associated with this
+ * camera device. If the operation is successful, HAL must notify the
+ * framework torch state by invoking
+ * ICameraProviderCallback::torchModeStatusChange() with the new state.
+ *
+ * An active camera session has a higher priority accessing the flash
+ * unit. When there are any resource conflicts, such as when open() is
+ * called to fully activate a camera device, the provider must notify the
+ * framework through ICameraProviderCallback::torchModeStatusChange() that
+ * the torch mode has been turned off and the torch mode state has become
+ * TORCH_MODE_STATUS_NOT_AVAILABLE. When resources to turn on torch mode
+ * become available again, the provider must notify the framework through
+ * ICameraProviderCallback::torchModeStatusChange() that the torch mode
+ * state has become TORCH_MODE_STATUS_AVAILABLE_OFF for set_torch_mode() to
+ * be called.
+ *
+ * When the client calls setTorchMode() to turn on the torch mode of a flash
+ * unit, if the HAL cannot keep multiple torch modes on simultaneously, the
+ * HAL must turn off the torch mode(s) that were turned on by previous
+ * setTorchMode() calls and notify the framework that the torch mode state
+ * of those flash unit(s) has become TORCH_MODE_STATUS_AVAILABLE_OFF.
+ *
+ * @param on Whether to turn the turn mode ON - specified by true or OFF, specified by false
+ *
+ * A service specific error will be returned on the following conditions
+ *
+ * INTERNAL_ERROR:
+ * The flash unit cannot be operated due to an unexpected internal
+ * error.
+ * ILLEGAL_ARGUMENT:
+ * The camera ID is unknown.
+ * CAMERA_IN_USE:
+ * This camera device has been opened, so the torch cannot be
+ * controlled until it is closed.
+ * MAX_CAMERAS_IN_USE:
+ * Due to other camera devices being open, or due to other
+ * resource constraints, the torch cannot be controlled currently.
+ * OPERATION_NOT_SUPPORTED:
+ * This camera device does not have a flash unit. This can
+ * be returned if and only if android.flash.info.available is
+ * false.
+ * CAMERA_DISCONNECTED:
+ * An external camera device has been disconnected, and is no longer
+ * available. This camera device interface is now stale, and a new
+ * instance must be acquired if the device is reconnected. All
+ * subsequent calls on this interface must return
+ * CAMERA_DISCONNECTED.
+ *
+ */
+ void setTorchMode(boolean on);
+
+ /**
+ * turnOnTorchWithStrengthLevel:
+ *
+ * Change the brightness level of the flash unit associated with this camera device
+ * and set it to value in torchStrength. This function also turns ON the torch
+ * with specified torchStrength if the torch is OFF.
+ *
+ * The torchStrength value must be within the valid range i.e. >=1 and
+ * <= FLASH_INFO_STRENGTH_MAXIMUM_LEVEL. Whenever the torch is turned OFF,
+ * the brightness level will reset to FLASH_INFO_STRENGTH_DEFAULT_LEVEL.
+ * When the client calls setTorchMode(ON) after turnOnTorchWithStrengthLevel(N),
+ * the flash unit will have brightness level equal to N. This level does not
+ * represent the real brightness units. It is linear in nature i.e. flashlight
+ * at level 10 is twice as bright as at level 5.
+ *
+ * @param torchStrength Brightness level to be set for the flashlight.
+ *
+ * A service specific error will be returned on the following conditions
+ * INTERNAL_ERROR:
+ * The flash unit cannot be operated due to an unexpected internal
+ * error.
+ * CAMERA_IN_USE:
+ * This status code is returned when:
+ * - This camera device has been opened, so the torch cannot be
+ * controlled until it is closed.
+ * - Due to other camera devices being open, or due to other
+ * resource constraints, the torch cannot be controlled currently.
+ * ILLEGAL_ARGUMENT:
+ * If the torchStrength value is not within the range i.e. < 1 or
+ * > FLASH_INFO_STRENGTH_MAXIMUM_LEVEL.
+ * OPERATION_NOT_SUPPORTED:
+ * This status code is returned when:
+ * - This camera device does not support direct operation of flashlight
+ * torch mode. The framework must open the camera device and turn
+ * the torch on through the device interface.
+ * - This camera device does not have a flash unit.
+ * - This camera device has flash unit but does not support torch
+ * strength control.
+ * CAMERA_DISCONNECTED:
+ * An external camera device has been disconnected, and is no longer
+ * available. This camera device interface is now stale, and a new
+ * instance must be acquired if the device is reconnected. All
+ * subsequent calls on this interface must return
+ * CAMERA_DISCONNECTED.
+ *
+ */
+ void turnOnTorchWithStrengthLevel(int torchStrength);
+
+ /**
+ * getTorchStrengthLevel:
+ *
+ * Get current torch strength level.
+ * If the device supports torch strength control, when the torch is OFF the
+ * strength level will reset to default level, so the return
+ * value in this case will be equal to FLASH_INFO_STRENGTH_DEFAULT_LEVEL.
+ *
+ * A service specific error will be returned on the following conditions
+ * INTERNAL_ERROR:
+ * An unexpected error occurred and the information is not
+ * available.
+ * OPERATION_NOT_SUPPORTED:
+ * This status code is returned when:
+ * - This camera device does not support direct operation of flashlight
+ * torch mode. The framework must open the camera device and turn
+ * the torch on through the device interface.
+ * - This camera device does not have a flash unit.
+ * - This camera device has flash unit but does not support torch
+ * strength control.
+ *
+ * @return torchStrength Current torch strength level.
+ *
+ */
+ int getTorchStrengthLevel();
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraDeviceCallback.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraDeviceCallback.aidl
new file mode 100644
index 0000000..83ff823
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/ICameraDeviceCallback.aidl
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.BufferRequest;
+import android.hardware.camera.device.BufferRequestStatus;
+import android.hardware.camera.device.CaptureResult;
+import android.hardware.camera.device.NotifyMsg;
+import android.hardware.camera.device.StreamBuffer;
+import android.hardware.camera.device.StreamBufferRet;
+
+/**
+ * Callback methods for the HAL to call into the framework.
+ */
+@VintfStability
+interface ICameraDeviceCallback {
+ /**
+ * notify:
+ *
+ * Asynchronous notification callback from the HAL, fired for various
+ * reasons. Only for information independent of frame capture, or that
+ * require specific timing. Multiple messages may be sent in one call; a
+ * message with a higher index must be considered to have occurred after a
+ * message with a lower index.
+ *
+ * Multiple threads may call notify() simultaneously.
+ *
+ * Buffers delivered to the framework must not be dispatched to the
+ * application layer until a start of exposure timestamp (or input image's
+ * start of exposure timestamp for a reprocess request) has been received
+ * via a SHUTTER notify() call. It is highly recommended to dispatch this
+ * call as early as possible.
+ *
+ * The SHUTTER notify calls for requests with android.control.enableZsl
+ * set to TRUE and ANDROID_CONTROL_CAPTURE_INTENT == STILL_CAPTURE may be
+ * out-of-order compared to SHUTTER notify for other kinds of requests
+ * (including regular, reprocess, or zero-shutter-lag requests with
+ * different capture intents).
+ *
+ * As a result, the capture results of zero-shutter-lag requests with
+ * ANDROID_CONTROL_CAPTURE_INTENT == STILL_CAPTURE may be out-of-order
+ * compared to capture results for other kinds of requests.
+ *
+ * Different SHUTTER notify calls for zero-shutter-lag requests with
+ * ANDROID_CONTROL_CAPTURE_INTENT == STILL_CAPTURE must be in order between
+ * them, as is for other kinds of requests. SHUTTER notify calls for
+ * zero-shutter-lag requests with non STILL_CAPTURE intent must be in order
+ * with SHUTTER notify calls for regular requests.
+ * ------------------------------------------------------------------------
+ * Performance requirements:
+ *
+ * This is a non-blocking call. The framework must handle each message in 5ms.
+ * @param msgs List of notification msgs to be processed by camera framework
+ */
+ void notify(in NotifyMsg[] msgs);
+
+ /**
+ * processCaptureResult:
+ *
+ * Send results from one or more completed or partially completed captures
+ * to the framework.
+ * processCaptureResult() may be invoked multiple times by the HAL in
+ * response to a single capture request. This allows, for example, the
+ * metadata and low-resolution buffers to be returned in one call, and
+ * post-processed JPEG buffers in a later call, once it is available. Each
+ * call must include the frame number of the request it is returning
+ * metadata or buffers for. Only one call to processCaptureResult
+ * may be made at a time by the HAL although the calls may come from
+ * different threads in the HAL.
+ *
+ * A component (buffer or metadata) of the complete result may only be
+ * included in one process_capture_result call. A buffer for each stream,
+ * and the result metadata, must be returned by the HAL for each request in
+ * one of the processCaptureResult calls, even in case of errors producing
+ * some of the output. A call to processCaptureResult() with neither
+ * output buffers or result metadata is not allowed.
+ *
+ * The order of returning metadata and buffers for a single result does not
+ * matter, but buffers for a given stream must be returned in FIFO order. So
+ * the buffer for request 5 for stream A must always be returned before the
+ * buffer for request 6 for stream A. This also applies to the result
+ * metadata; the metadata for request 5 must be returned before the metadata
+ * for request 6.
+ *
+ * However, different streams are independent of each other, so it is
+ * acceptable and expected that the buffer for request 5 for stream A may be
+ * returned after the buffer for request 6 for stream B is. And it is
+ * acceptable that the result metadata for request 6 for stream B is
+ * returned before the buffer for request 5 for stream A is. If multiple
+ * capture results are included in a single call, camera framework must
+ * process results sequentially from lower index to higher index, as if
+ * these results were sent to camera framework one by one, from lower index
+ * to higher index.
+ *
+ * The HAL retains ownership of result structure, which only needs to be
+ * valid to access during this call.
+ *
+ * The output buffers do not need to be filled yet; the framework must wait
+ * on the stream buffer release sync fence before reading the buffer
+ * data. Therefore, this method should be called by the HAL as soon as
+ * possible, even if some or all of the output buffers are still in
+ * being filled. The HAL must include valid release sync fences into each
+ * output_buffers stream buffer entry, or -1 if that stream buffer is
+ * already filled.
+ *
+ * If the result buffer cannot be constructed for a request, the HAL must
+ * return an empty metadata buffer, but still provide the output buffers and
+ * their sync fences. In addition, notify() must be called with an
+ * ERROR_RESULT message.
+ *
+ * If an output buffer cannot be filled, its status field must be set to
+ * STATUS_ERROR. In this case, notify() isn't required to be called with
+ * an ERROR_BUFFER message. The framework will simply treat the notify()
+ * call with ERROR_BUFFER as a no-op, and derive whether and when to notify
+ * the application of buffer loss based on the buffer status and whether or not
+ * the entire capture has failed.
+ *
+ * If the entire capture has failed, then this method still needs to be
+ * called to return the output buffers to the framework. All the buffer
+ * statuses must be STATUS_ERROR, and the result metadata must be an
+ * empty buffer. In addition, notify() must be called with a ERROR_REQUEST
+ * message. In this case, individual ERROR_RESULT/ERROR_BUFFER messages
+ * must not be sent. Note that valid partial results are still allowed
+ * as long as the final result metadata fails to be generated.
+ *
+ * Performance requirements:
+ *
+ * This is a non-blocking call. The framework must handle each CaptureResult
+ * within 5ms.
+ *
+ * The pipeline latency (see ICameraDeviceSession for definition) should be less than or equal
+ * to 4 frame intervals, and must be less than or equal to 8 frame intervals.
+ *
+ * @param results to be processed by the camera framework
+ *
+ */
+ void processCaptureResult(in CaptureResult[] results);
+
+ /**
+ * requestStreamBuffers:
+ *
+ * Synchronous callback for HAL to ask for output buffers from camera service.
+ *
+ * This call may be serialized in camera service so it is strongly
+ * recommended to only call this method from one thread.
+ *
+ * When camera device advertises
+ * InfoSupportedBufferManagementVersion ==
+ * ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5), HAL
+ * can use this method to request buffers from camera service.
+ *
+ * A BufferRequestStatus will be returned
+ * OK: All the requests succeeded
+ * FAILED_PARTIAL: some streams failed while some succeeds. Check
+ * individual StreamBufferRet for details.
+ * FAILED_CONFIGURING: the request failed because camera servicve is
+ * performing configureStreams and no buffers are returned.
+ * FAILED_UNKNOWN: the request failed for unknown reason and no buffers
+ * are returned.
+ * A service specific exception will be returned in the following case:
+ *
+ * ILLEGAL_ARGUMENT: If the buffer requests through bufReqs are not legal, do not correspond
+ * to a configured stream.
+ *
+ * Performance requirements:
+ * This is a blocking call that takes more time with more buffers requested.
+ * HAL must not request large amount of buffers on a latency critical code
+ * path. It is highly recommended to use a dedicated thread to perform
+ * all requestStreamBuffers calls, and adjust the thread priority and/or
+ * timing of making the call in order for buffers to arrive before HAL is
+ * ready to fill the buffer.
+ * @param bufReqs Buffers requested by the camera HAL
+ * @param buffers the buffers returned to the camera HAL by the camera framework
+ */
+ BufferRequestStatus requestStreamBuffers(
+ in BufferRequest[] bufReqs, out StreamBufferRet[] buffers);
+
+ /**
+ * returnStreamBuffers:
+ *
+ * Synchronous callback for HAL to return output buffers to camera service.
+ *
+ * If this method is called during a configureStreams call, it must be blocked
+ * until camera service finishes the ongoing configureStreams call.
+ * @param buffers The stream buffers returned to the camera framework
+ */
+ void returnStreamBuffers(in StreamBuffer[] buffers);
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl
new file mode 100644
index 0000000..885c71a
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl
@@ -0,0 +1,579 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.BufferCache;
+import android.hardware.camera.device.CameraMetadata;
+import android.hardware.camera.device.CameraOfflineSessionInfo;
+import android.hardware.camera.device.CaptureRequest;
+import android.hardware.camera.device.HalStream;
+import android.hardware.camera.device.ICameraOfflineSession;
+import android.hardware.camera.device.RequestTemplate;
+import android.hardware.camera.device.StreamConfiguration;
+import android.hardware.common.fmq.MQDescriptor;
+import android.hardware.common.fmq.SynchronizedReadWrite;
+
+/**
+ * Camera device active session interface.
+ *
+ * Obtained via ICameraDevice::open(), this interface contains the methods to
+ * configure and request captures from an active camera device.
+ */
+@VintfStability
+interface ICameraDeviceSession {
+ /**
+ * close:
+ *
+ * Shut down the camera device.
+ *
+ * After this call, all calls to this session instance must set a
+ * INTERNAL_ERROR ServiceSpecificException.
+ *
+ * This method must always succeed, even if the device has encountered a
+ * serious error.
+ */
+ void close();
+
+ /**
+ *
+ * configureStreams:
+ *
+ * Reset the HAL camera device processing pipeline and set up new input and
+ * output streams. This call replaces any existing stream configuration with
+ * the streams defined in the streamList. This method must be called at
+ * least once before a request is submitted with processCaptureRequest().
+ *
+ * The streamList must contain at least one output-capable stream, and may
+ * not contain more than one input-capable stream.
+ *
+ * The streamList may contain streams that are also in the currently-active
+ * set of streams (from the previous call to configureStreams()). These
+ * streams must already have valid values for usage, maxBuffers, and the
+ * private pointer.
+ *
+ * If the HAL needs to change the stream configuration for an existing
+ * stream due to the new configuration, it may rewrite the values of usage
+ * and/or maxBuffers during the configure call.
+ *
+ * The framework must detect such a change, and may then reallocate the
+ * stream buffers before using buffers from that stream in a request.
+ *
+ * If a currently-active stream is not included in streamList, the HAL may
+ * safely remove any references to that stream. It must not be reused in a
+ * later configureStreams() call by the framework, and all the gralloc
+ * buffers for it must be freed after the configureStreams() call returns.
+ *
+ * If the stream is new, the client must set the consumer usage flags in
+ * requestedConfiguration. Upon return, the HAL device must set producerUsage,
+ * maxBuffers, and other fields in the configureStreams() return values. These
+ * fields are then used by the framework and the platform gralloc module to
+ * allocate the gralloc buffers for each stream.
+ *
+ * Newly allocated buffers may be included in a capture request at any time
+ * by the framework. Once a gralloc buffer is returned to the framework
+ * with processCaptureResult (and its respective releaseFence has been
+ * signaled) the framework may free or reuse it at any time.
+ *
+ * ------------------------------------------------------------------------
+ *
+ * Preconditions:
+ *
+ * The framework must only call this method when no captures are being
+ * processed. That is, all results have been returned to the framework, and
+ * all in-flight input and output buffers have been returned and their
+ * release sync fences have been signaled by the HAL. The framework must not
+ * submit new requests for capture while the configureStreams() call is
+ * underway.
+ *
+ * Postconditions:
+ *
+ * The HAL device must configure itself to provide maximum possible output
+ * frame rate given the sizes and formats of the output streams, as
+ * documented in the camera device's static metadata.
+ *
+ * Performance requirements:
+ *
+ * This call is expected to be heavyweight and possibly take several hundred
+ * milliseconds to complete, since it may require resetting and
+ * reconfiguring the image sensor and the camera processing pipeline.
+ * Nevertheless, the HAL device should attempt to minimize the
+ * reconfiguration delay to minimize the user-visible pauses during
+ * application operational mode changes (such as switching from still
+ * capture to video recording).
+ *
+ * The HAL should return from this call in 500ms, and must return from this
+ * call in 1000ms.
+ *
+ * A service specific error will be returned on the following conditions
+ *
+ * INTERNAL_ERROR:
+ * If there has been a fatal error and the device is no longer
+ * operational. Only close() can be called successfully by the
+ * framework after this error is returned.
+ * ILLEGAL_ARGUMENT:
+ * If the requested stream configuration is invalid. Some examples
+ * of invalid stream configurations include:
+ * - Including more than 1 INPUT stream
+ * - Not including any OUTPUT streams
+ * - Including streams with unsupported formats, or an unsupported
+ * size for that format.
+ * - Including too many output streams of a certain format.
+ * - Unsupported rotation configuration
+ * - Stream sizes/formats don't satisfy the
+ * StreamConfigurationMode requirements for non-NORMAL mode, or
+ * the requested operation_mode is not supported by the HAL.
+ * - Unsupported usage flag
+ * The camera service cannot filter out all possible illegal stream
+ * configurations, since some devices may support more simultaneous
+ * streams or larger stream resolutions than the minimum required
+ * for a given camera device hardware level. The HAL must return an
+ * ILLEGAL_ARGUMENT for any unsupported stream set, and then be
+ * ready to accept a future valid stream configuration in a later
+ * configureStreams call.
+ * @param requestedConfiguration The stream configuration requested by the camera framework to
+ * be configured by the camera HAL.
+ * @return A list of the stream parameters desired by the HAL for
+ * each stream, including maximum buffers, the usage flags, and the
+ * override format.
+ *
+ */
+ HalStream[] configureStreams(in StreamConfiguration requestedConfiguration);
+
+ /**
+ * constructDefaultRequestSettings:
+ *
+ * Create capture settings for standard camera use cases.
+ *
+ * The device must return a settings buffer that is configured to meet the
+ * requested use case, which must be one of the RequestTemplate enums.
+ * All request control fields must be included.
+ *
+ * Performance requirements:
+ *
+ * This must be a non-blocking call. The HAL should return from this call
+ * in 1ms, and must return from this call in 5ms.
+ *
+ * A service specific error will be returned on the following conditions
+ * Return values:
+ *
+ * INTERNAL_ERROR:
+ * An unexpected internal error occurred, and the default settings
+ * are not available.
+ * ILLEGAL_ARGUMENT:
+ * The camera HAL does not support the input template type
+ * CAMERA_DISCONNECTED:
+ * An external camera device has been disconnected, and is no longer
+ * available. This camera device interface is now stale, and a new
+ * instance must be acquired if the device is reconnected. All
+ * subsequent calls on this interface must return
+ * CAMERA_DISCONNECTED.
+ * @param type The requested template CaptureRequest type to create the default settings for.
+ *
+ * @return capture settings for the requested use case.
+ *
+ */
+
+ CameraMetadata constructDefaultRequestSettings(in RequestTemplate type);
+
+ /**
+ * flush:
+ *
+ * Flush all currently in-process captures and all buffers in the pipeline
+ * on the given device. Generally, this method is used to dump all state as
+ * quickly as possible in order to prepare for a configure_streams() call.
+ *
+ * No buffers are required to be successfully returned, so every buffer
+ * held at the time of flush() (whether successfully filled or not) may be
+ * returned with BufferStatus.ERROR. Note the HAL is still allowed
+ * to return valid (BufferStatus.OK) buffers during this call,
+ * provided they are successfully filled.
+ *
+ * All requests currently in the HAL are expected to be returned as soon as
+ * possible. Not-in-process requests must return errors immediately. Any
+ * interruptible hardware blocks must be stopped, and any uninterruptible
+ * blocks must be waited on.
+ *
+ * flush() may be called concurrently to processCaptureRequest(), with the
+ * expectation that processCaptureRequest returns quickly and the
+ * request submitted in that processCaptureRequest call is treated like
+ * all other in-flight requests. Due to concurrency issues, it is possible
+ * that from the HAL's point of view, a processCaptureRequest() call may
+ * be started after flush has been invoked but has not returned yet. If such
+ * a call happens before flush() returns, the HAL must treat the new
+ * capture request like other in-flight pending requests (see #4 below).
+ *
+ * More specifically, the HAL must follow below requirements for various
+ * cases:
+ *
+ * 1. For captures that are too late for the HAL to cancel/stop, and must be
+ * completed normally by the HAL; i.e. the HAL can send shutter/notify
+ * and processCaptureResult and buffers as normal.
+ *
+ * 2. For pending requests that have not done any processing, the HAL must
+ * call notify with ErrorMsg set, and return all the output
+ * buffers with processCaptureResult in the error state
+ * (BufferStatus.ERROR). The HAL must not place the release
+ * fence into an error state, instead, the release fences must be set to
+ * the acquire fences passed by the framework, or -1 if they have been
+ * waited on by the HAL already. This is also the path to follow for any
+ * captures for which the HAL already called notify() with
+ * ShutterMsg set, but won't be producing any metadata/valid buffers
+ * for. After ErrorMsg is set, for a given frame, only
+ * processCaptureResults with buffers in BufferStatus.ERROR
+ * are allowed. No further notifys or processCaptureResult with
+ * non-empty metadata is allowed.
+ *
+ * 3. For partially completed pending requests that do not have all the
+ * output buffers or perhaps missing metadata, the HAL must follow
+ * below:
+ *
+ * 3.1. Call notify with ErrorMsg set with ErrorCode.ERROR_RESULT if some of the expected
+ * result metadata (i.e. one or more partial metadata) won't be
+ * available for the capture.
+ *
+ * 3.2. Call notify with ErrorMsg set with ErrorCode.ERROR_BUFFER for every buffer that
+ * won't be produced for the capture.
+ *
+ * 3.3. Call notify with ShutterMsg with the capture timestamp
+ * before any buffers/metadata are returned with
+ * processCaptureResult.
+ *
+ * 3.4. For captures that will produce some results, the HAL must not
+ * call notify with ErrorCode.ERROR_REQUEST, since that indicates complete
+ * failure.
+ *
+ * 3.5. Valid buffers/metadata must be passed to the framework as
+ * normal.
+ *
+ * 3.6. Failed buffers must be returned to the framework as described
+ * for case 2. But failed buffers do not have to follow the strict
+ * ordering valid buffers do, and may be out-of-order with respect
+ * to valid buffers. For example, if buffers A, B, C, D, E are sent,
+ * D and E are failed, then A, E, B, D, C is an acceptable return
+ * order.
+ *
+ * 3.7. For fully-missing metadata, calling ErrorCode.ERROR_RESULT is
+ * sufficient, no need to call processCaptureResult with empty
+ * metadata or equivalent.
+ *
+ * 4. If a flush() is invoked while a processCaptureRequest() invocation
+ * is active, that process call must return as soon as possible. In
+ * addition, if a processCaptureRequest() call is made after flush()
+ * has been invoked but before flush() has returned, the capture request
+ * provided by the late processCaptureRequest call must be treated
+ * like a pending request in case #2 above.
+ *
+ * flush() must only return when there are no more outstanding buffers or
+ * requests left in the HAL. The framework may call configure_streams (as
+ * the HAL state is now quiesced) or may issue new requests.
+ *
+ * Note that it's sufficient to only support fully-succeeded and
+ * fully-failed result cases. However, it is highly desirable to support
+ * the partial failure cases as well, as it could help improve the flush
+ * call overall performance.
+ *
+ * Performance requirements:
+ *
+ * The HAL should return from this call in 100ms, and must return from this
+ * call in 1000ms. And this call must not be blocked longer than pipeline
+ * latency (see below for definition).
+ *
+ * Pipeline Latency:
+ * For a given capture request, the duration from the framework calling
+ * process_capture_request to the HAL sending capture result and all buffers
+ * back by process_capture_result call. To make the Pipeline Latency measure
+ * independent of frame rate, it is measured by frame count.
+ *
+ * For example, when frame rate is 30 (fps), the frame duration (time interval
+ * between adjacent frame capture time) is 33 (ms).
+ * If it takes 5 frames for framework to get the result and buffers back for
+ * a given request, then the Pipeline Latency is 5 (frames), instead of
+ * 5 x 33 = 165 (ms).
+ *
+ * The Pipeline Latency is determined by android.request.pipelineDepth and
+ * android.request.pipelineMaxDepth, see their definitions for more details.
+ *
+ * A service specific error will be returned on the following conditions
+ * INTERNAL_ERROR:
+ * If the camera device has encountered a serious error. After this
+ * error is returned, only the close() method can be successfully
+ * called by the framework.
+ */
+ void flush();
+
+ /**
+ * getCaptureRequestMetadataQueue:
+ *
+ * Retrieves the queue used along with processCaptureRequest. If
+ * client decides to use fast message queue to pass request metadata,
+ * it must:
+ * - Call getCaptureRequestMetadataQueue to retrieve the fast message queue;
+ * - In each of the requests sent in processCaptureRequest, set
+ * fmqSettingsSize field of CaptureRequest to be the size to read from the
+ * fast message queue; leave settings field of CaptureRequest empty.
+ *
+ * @return the queue that client writes request metadata to.
+ */
+ MQDescriptor<byte, SynchronizedReadWrite> getCaptureRequestMetadataQueue();
+
+ /**
+ * getCaptureResultMetadataQueue:
+ *
+ * Retrieves the queue used along with
+ * ICameraDeviceCallback.processCaptureResult.
+ *
+ * Clients to ICameraDeviceSession must:
+ * - Call getCaptureRequestMetadataQueue to retrieve the fast message queue;
+ * - In implementation of ICameraDeviceCallback, test whether
+ * .fmqResultSize field is zero.
+ * - If .fmqResultSize != 0, read result metadata from the fast message
+ * queue;
+ * - otherwise, read result metadata in CaptureResult.result.
+ *
+ * @return the queue that implementation writes result metadata to.
+ */
+ MQDescriptor<byte, SynchronizedReadWrite> getCaptureResultMetadataQueue();
+
+ /**
+ * isReconfigurationRequired:
+ *
+ * Check whether complete stream reconfiguration is required for possible new session
+ * parameter values.
+ *
+ * This method must be called by the camera framework in case the client changes
+ * the value of any advertised session parameters. Depending on the specific values
+ * the HAL can decide whether a complete stream reconfiguration is required. In case
+ * the HAL returns false, the camera framework must skip the internal reconfiguration.
+ * In case Hal returns true, the framework must reconfigure the streams and pass the
+ * new session parameter values accordingly.
+ * This call may be done by the framework some time before the request with new parameters
+ * is submitted to the HAL, and the request may be cancelled before it ever gets submitted.
+ * Therefore, the HAL must not use this query as an indication to change its behavior in any
+ * way.
+ * ------------------------------------------------------------------------
+ *
+ * Preconditions:
+ *
+ * The framework can call this method at any time after active
+ * session configuration. There must be no impact on the performance of
+ * pending camera requests in any way. In particular there must not be
+ * any glitches or delays during normal camera streaming.
+ *
+ * Performance requirements:
+ * HW and SW camera settings must not be changed and there must not be
+ * a user-visible impact on camera performance.
+ *
+ * @param oldSessionParams Before session parameters, usually the current session parameters.
+ * @param newSessionParams The new session parameters which may be set by client.
+ * A service specific error will be returned in the following case:
+ *
+ * INTERNAL_ERROR:
+ * The reconfiguration query cannot complete due to internal
+ * error.
+ * @return true in case the stream reconfiguration is required, false otherwise.
+ */
+ boolean isReconfigurationRequired(in CameraMetadata oldSessionParams,
+ in CameraMetadata newSessionParams);
+
+ /**
+ * processCaptureRequest:
+ *
+ * Send a list of capture requests to the HAL. The HAL must not return from
+ * this call until it is ready to accept the next set of requests to
+ * process. Only one call to processCaptureRequest() must be made at a time
+ * by the framework, and the calls must all be from the same thread. The
+ * next call to processCaptureRequest() must be made as soon as a new
+ * request and its associated buffers are available. In a normal preview
+ * scenario, this means the function is generally called again by the
+ * framework almost instantly. If more than one request is provided by the
+ * client, the HAL must process the requests in order of lowest index to
+ * highest index.
+ *
+ * The cachesToRemove argument contains a list of buffer caches (see
+ * StreamBuffer document for more information on buffer cache) to be removed
+ * by camera HAL. Camera HAL must remove these cache entries whether or not
+ * this method returns OK.
+ *
+ * The actual request processing is asynchronous, with the results of
+ * capture being returned by the HAL through the processCaptureResult()
+ * call. This call requires the result metadata to be available, but output
+ * buffers may simply provide sync fences to wait on. Multiple requests are
+ * expected to be in flight at once, to maintain full output frame rate.
+ *
+ * The framework retains ownership of the request structure. It is only
+ * guaranteed to be valid during this call. The HAL device must make copies
+ * of the information it needs to retain for the capture processing. The HAL
+ * is responsible for waiting on and closing the buffers' fences and
+ * returning the buffer handles to the framework.
+ *
+ * The HAL must write the file descriptor for the input buffer's release
+ * sync fence into input_buffer->release_fence, if input_buffer is not
+ * valid. If the HAL returns -1 for the input buffer release sync fence, the
+ * framework is free to immediately reuse the input buffer. Otherwise, the
+ * framework must wait on the sync fence before refilling and reusing the
+ * input buffer.
+ *
+ * The input/output buffers provided by the framework in each request
+ * may be brand new (having never before seen by the HAL).
+ *
+ * ------------------------------------------------------------------------
+ * Performance considerations:
+ *
+ * Handling a new buffer should be extremely lightweight and there must be
+ * no frame rate degradation or frame jitter introduced.
+ *
+ * This call must return fast enough to ensure that the requested frame
+ * rate can be sustained, especially for streaming cases (post-processing
+ * quality settings set to FAST). The HAL should return this call in 1
+ * frame interval, and must return from this call in 4 frame intervals.
+ *
+ * - The capture request can include individual settings for physical camera devices
+ * backing a logical multi-camera.
+ *
+ * - The capture request can include width and height of the input buffer for
+ * a reprocessing request.
+ *
+ * A service specific error will be returned on the following conditions
+ * ILLEGAL_ARGUMENT:
+ * If the input is malformed (the settings are empty when not
+ * allowed, the physical camera settings are invalid, there are 0
+ * output buffers, etc) and capture processing
+ * cannot start. Failures during request processing must be
+ * handled by calling ICameraDeviceCallback::notify(). In case of
+ * this error, the framework retains responsibility for the
+ * stream buffers' fences and the buffer handles; the HAL must not
+ * close the fences or return these buffers with
+ * ICameraDeviceCallback::processCaptureResult().
+ * In case of multi-resolution input image, this error must be returned
+ * if the caller passes in a CaptureRequest with an invalid
+ * [inputWith, inputHeight].
+ * INTERNAL_ERROR:
+ * If the camera device has encountered a serious error. After this
+ * error is returned, only the close() method can be successfully
+ * called by the framework.
+ *
+ * @param requests The capture requests to be processed by the camera HAL
+ * @param cachesToRemove list of buffer caches to be removed by the camera HAL
+ * @return Number of requests successfully processed by
+ * camera HAL. On success, this must be equal to the size of
+ * requests. When the call fails, this number is the number of requests
+ * that HAL processed successfully before HAL runs into an error and a service specific
+ * error is also set.
+ *
+ */
+ int processCaptureRequest(in CaptureRequest[] requests, in BufferCache[] cachesToRemove);
+
+ /**
+ * signalStreamFlush:
+ *
+ * Signaling to the HAL, camera service is about to perform configureStreams and
+ * HAL must return all buffers of designated streams. HAL must finish
+ * inflight requests normally and return all buffers that belongs to the
+ * designated streams through processCaptureResult or returnStreamBuffer
+ * API in a timely manner, or camera service will run into a fatal error.
+ *
+ * Note that this call serves as an optional hint and camera service may
+ * skip sending this call if all buffers are already returned.
+ *
+ * @param streamIds The ID of streams camera service need all of its
+ * buffers returned.
+ *
+ * @param streamConfigCounter Note that due to concurrency nature, it is
+ * possible the signalStreamFlush call arrives later than the
+ * corresponding configureStreams() call, HAL must check
+ * streamConfigCounter for such race condition. If the counter is less
+ * than the counter in the last configureStreams() call HAL last
+ * received, the call is stale and HAL should just return this call.
+ */
+ oneway void signalStreamFlush(in int[] streamIds, in int streamConfigCounter);
+
+ /**
+ * switchToOffline:
+ *
+ * Switch the current running session from actively streaming mode to the
+ * offline mode. See ICameraOfflineSession for more details.
+ *
+ * The streamsToKeep argument contains list of streams IDs where application
+ * still needs its output. For all streams application does not need anymore,
+ * camera HAL can send ERROR_BUFFER to speed up the transition, or even send
+ * ERROR_REQUEST if all output targets of a request is not needed. By the
+ * time this call returns, camera HAL must have returned all buffers coming
+ * from streams no longer needed and have erased buffer caches of such streams.
+ *
+ * For all requests that are going to be transferred to offline session,
+ * the ICameraDeviceSession is responsible to capture all input buffers from
+ * the image sensor before the switchToOffline call returns. Before
+ * switchToOffline returns, camera HAL must have completed all requests not
+ * switching to offline mode, and collected information on what streams and
+ * requests are going to continue in the offline session, in the
+ * offlineSessionInfo output argument.
+ *
+ * If there are no requests qualified to be transferred to offline session,
+ * the camera HAL must return a null ICameraOfflineSession object with OK
+ * status. In this scenario, the camera HAL still must flush all inflight
+ * requests and unconfigure all streams before returning this call.
+ *
+ * After switchToOffline returns, the ICameraDeviceSession must be back to
+ * unconfigured state as if it is just created and no streams are configured.
+ * Also, camera HAL must not call any methods in ICameraDeviceCallback since
+ * all unfinished requests are now transferred to the offline session.
+ * After the call returns, camera service may then call close to close
+ * the camera device, or call configureStream* again to reconfigure the
+ * camera and then send new capture requests with processCaptureRequest. In
+ * the latter case, it is legitimate for camera HAL to call methods in
+ * ICameraDeviceCallback again in response to the newly submitted capture
+ * requests.
+ *
+ * A service specific error will be returned on the following conditions
+ * ILLEGAL_ARGUMENT:
+ * If camera does not support offline mode in any one of streams
+ * in streamsToKeep argument. Note that the camera HAL must report
+ * if a stream supports offline mode in HalStreamConfiguration
+ * output of configureStreams_3_6 method. If all streams in
+ * streamsToKeep argument support offline mode, then the camera HAL
+ * must not return this error.
+ *
+ * @param in streamsToKeep The streamIds of the streams that will continue in the offline
+ * session
+ * @param out offlineSessionInfo Information on what streams and requests will
+ * be transferred to offline session to continue processing.
+ *
+ * @return offlineSession The offline session object camera service will use
+ * to interact with.
+ */
+ ICameraOfflineSession switchToOffline(
+ in int[] streamsToKeep, out CameraOfflineSessionInfo offlineSessionInfo);
+
+ /**
+ * repeatingRequestEnd:
+ *
+ * Notification about the last frame number in a repeating request along with the
+ * ids of all streams included in the repeating request.
+ *
+ * This can be called at any point after 'processCaptureRequest' in response
+ * to camera clients disabling an active repeating request.
+ *
+ * Performance requirements:
+ * The call must not be blocked for extensive periods and should be extremely lightweight. There
+ * must be no frame rate degradation or frame jitter introduced.
+ *
+ * This method must always succeed, even if the device has encountered a
+ * serious error.
+ */
+ void repeatingRequestEnd(in int frameNumber, in int[] streamIds);
+
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraInjectionSession.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraInjectionSession.aidl
new file mode 100644
index 0000000..ecb8a27
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/ICameraInjectionSession.aidl
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.CameraMetadata;
+import android.hardware.camera.device.ICameraDeviceSession;
+import android.hardware.camera.device.StreamConfiguration;
+
+/**
+ * Camera device active session interface.
+ *
+ * Obtained via ICameraDevice::open(), this interface contains the methods to
+ * configure and request captures from an active camera device.
+ */
+@VintfStability
+interface ICameraInjectionSession {
+ /**
+ * configureInjectionStreams:
+ *
+ * Identical to ICameraDeviceSession.configureStreams, except that:
+ *
+ * @param requestedConfiguration
+ * The current stream configuration of the internal camera session and
+ * the injection camera must follow the configuration without overriding
+ * any part of it.
+ * @param characteristics
+ * The characteristics of internal camera contains a list of keys so that
+ * the stream continuity can be maintained after the external camera is
+ * injected.
+ *
+ * A service specific error will be returned on the following conditions
+ *
+ * INTERNAL_ERROR:
+ * If there has been a fatal error and the device is no longer
+ * operational. Only close() can be called successfully by the
+ * framework after this error is returned.
+ * ILLEGAL_ARGUMENT:
+ * If the requested stream configuration is invalid. Some examples
+ * of invalid stream configurations include:
+ * - Not including any OUTPUT streams
+ * - Including streams with unsupported formats, or an unsupported
+ * size for that format.
+ * - Including too many output streams of a certain format.
+ * - Unsupported rotation configuration
+ * - Stream sizes/formats don't satisfy the
+ * StreamConfigurationMode requirements
+ * for non-NORMAL mode, or the requested operation_mode is not
+ * supported by the HAL.
+ * - Unsupported usage flag
+ * The camera service cannot filter out all possible illegal stream
+ * configurations, since some devices may support more simultaneous
+ * streams or larger stream resolutions than the minimum required
+ * for a given camera device hardware level. The HAL must return an
+ * ILLEGAL_ARGUMENT for any unsupported stream set, and then be
+ * ready to accept a future valid stream configuration in a later
+ * configureInjectionStreams call.
+ */
+ void configureInjectionStreams(
+ in StreamConfiguration requestedConfiguration, in CameraMetadata characteristics);
+
+ /**
+ * Retrieves the ICameraDeviceSession interface in order for the camera framework to be able
+ * to use the injection session for all of the operations that a non-injected
+ * ICameraDeviceSession would be able to perform.
+ */
+ ICameraDeviceSession getCameraDeviceSession();
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraOfflineSession.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraOfflineSession.aidl
new file mode 100644
index 0000000..ec35b36
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/ICameraOfflineSession.aidl
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.ICameraDeviceCallback;
+import android.hardware.common.fmq.MQDescriptor;
+import android.hardware.common.fmq.SynchronizedReadWrite;
+
+/**
+ * Camera device offline session interface.
+ *
+ * Obtained via ICameraDeviceSession::switchToOffline(), this interface contains
+ * the methods and callback interfaces that define how camera service interacts
+ * with an offline session.
+ *
+ * An offline session contains some unfinished capture requests that were submitted
+ * to the parent ICameraDeviceSession before calling switchToOffline, and is
+ * responsible for delivering these capture results back to camera service regardless
+ * of whether the parent camera device is still opened or not. An offline session must
+ * not have access to the camera device's image sensor. During switchToOffline
+ * call, camera HAL must capture all necessary frames from the image sensor that
+ * is needed for completing the requests offline later.
+ */
+@VintfStability
+interface ICameraOfflineSession {
+ /**
+ * Close the offline session and release all resources.
+ *
+ * Camera service may call this method before or after the offline session
+ * has finished all requests it needs to handle. If there are still unfinished
+ * requests when close is called, camera HAL must send ERROR_REQUEST for
+ * all unfinished requests and return all buffers via
+ * ICameraDeviceCallback#processCaptureResult or
+ * ICameraDeviceCallback#returnStreamBuffers.
+ * Also, all buffer caches maintained by the offline session must be erased
+ * before the close call returns.
+ */
+ void close();
+
+ /**
+ * getCaptureResultMetadataQueue:
+ *
+ * Retrieves the queue used along with
+ * ICameraDeviceCallback#processCaptureResult.
+ *
+ * Clients to ICameraOfflineSession must:
+ * - Call getCaptureRequestMetadataQueue to retrieve the fast message queue;
+ * - In implementation of ICameraDeviceCallback, test whether
+ * .fmqResultSize field is zero.
+ * - If .fmqResultSize != 0, read result metadata from the fast message
+ * queue;
+ * - otherwise, read result metadata in CaptureResult.result.
+ *
+ * @return the queue that implementation writes result metadata to.
+ */
+ MQDescriptor<byte, SynchronizedReadWrite> getCaptureResultMetadataQueue();
+
+ /**
+ * Set the callbacks for offline session to communicate with camera service.
+ *
+ * Offline session is responsible to store all callbacks the camera HAL
+ * generated after the return of ICameraDeviceSession::switchToOffline, and
+ * send them to camera service once this method is called.
+ *
+ * Camera service must not call this method more than once, so these
+ * callbacks can be assumed to be constant after the first setCallback call.
+ */
+ void setCallback(in ICameraDeviceCallback cb);
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/NotifyMsg.aidl b/camera/device/aidl/android/hardware/camera/device/NotifyMsg.aidl
new file mode 100644
index 0000000..7910967
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/NotifyMsg.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.ErrorMsg;
+import android.hardware.camera.device.ShutterMsg;
+
+/**
+ * NotifyMsg:
+ *
+ * The message structure sent to ICameraDeviceCallback::notify()
+ */
+@VintfStability
+union NotifyMsg {
+ /**
+ * Error message contents.
+ */
+ ErrorMsg error;
+
+ /**
+ * Shutter message contents.
+ */
+ ShutterMsg shutter;
+
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/OfflineRequest.aidl b/camera/device/aidl/android/hardware/camera/device/OfflineRequest.aidl
new file mode 100644
index 0000000..ccfc50f
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/OfflineRequest.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+/**
+ * OfflineRequest:
+ *
+ * Information about a capture request being switched to offline mode via the
+ * ICameraDeviceSession#switchToOffline method.
+ *
+ */
+@VintfStability
+parcelable OfflineRequest {
+ /**
+ * Must match a inflight CaptureRequest sent by camera service
+ */
+ int frameNumber;
+
+ /**
+ * Stream IDs for outputs that will be returned via ICameraDeviceCallback.
+ * The stream ID must be within one of offline stream listed in
+ * CameraOfflineSessionInfo.
+ * Camera service will validate these pending buffers are matching camera
+ * service's record to make sure no buffers are leaked during the
+ * switchToOffline call.
+ */
+ int[] pendingStreams;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/OfflineStream.aidl b/camera/device/aidl/android/hardware/camera/device/OfflineStream.aidl
new file mode 100644
index 0000000..0b95449
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/OfflineStream.aidl
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+/**
+ * OfflineStream:
+ *
+ * Information about a stream being switched to offline mode via the
+ * ICameraDeviceSession#switchToOffline method.
+ *
+ */
+@VintfStability
+parcelable OfflineStream {
+ /**
+ * IDs of a stream to be transferred to offline session.
+ *
+ * For devices that do not support HAL buffer management, this must be
+ * one of stream ID listed in streamsToKeep argument of the
+ * switchToOffline call.
+ * For devices that support HAL buffer management, this could be any stream
+ * that was configured right before calling switchToOffline.
+ */
+ int id;
+
+ /**
+ * Number of outstanding buffers that will be returned via offline session
+ */
+ int numOutstandingBuffers;
+
+ /**
+ * Buffer ID of buffers currently cached between camera service and this
+ * stream, which may or may not be owned by the camera HAL right now.
+ * See StreamBuffer#bufferId for more details.
+ */
+ long[] circulatingBufferIds;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/PhysicalCameraMetadata.aidl b/camera/device/aidl/android/hardware/camera/device/PhysicalCameraMetadata.aidl
new file mode 100644
index 0000000..ea88802
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/PhysicalCameraMetadata.aidl
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.CameraMetadata;
+
+/**
+ * PhysicalCameraMetadata:
+ *
+ * Individual camera metadata for a physical camera as part of a logical
+ * multi-camera. Camera HAL should return one such metadata for each physical
+ * camera being requested on.
+ */
+@VintfStability
+parcelable PhysicalCameraMetadata {
+ /**
+ * If non-zero, read metadata from result metadata queue instead
+ * (see ICameraDeviceSession.getCaptureResultMetadataQueue).
+ * If zero, read metadata from .metadata field.
+ *
+ * The logical CaptureResult metadata is read first from the FMQ, followed by
+ * the physical cameras' metadata starting from index 0.
+ */
+ long fmqMetadataSize;
+
+ /**
+ * Contains the physical device camera id. As long as the corresponding
+ * processCaptureRequest requests on a particular physical camera stream,
+ * the metadata for that physical camera should be generated for the capture
+ * result.
+ */
+ String physicalCameraId;
+
+ /**
+ * If fmqMetadataSize is zero, the metadata buffer contains the metadata
+ * for the physical device with physicalCameraId.
+ */
+ CameraMetadata metadata;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/PhysicalCameraSetting.aidl b/camera/device/aidl/android/hardware/camera/device/PhysicalCameraSetting.aidl
new file mode 100644
index 0000000..a8c235f
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/PhysicalCameraSetting.aidl
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.CameraMetadata;
+
+/**
+ * PhysicalCameraSetting:
+ *
+ * Individual camera settings for logical camera backed by multiple physical devices.
+ * Clients are allowed to pass separate settings for each physical device that has
+ * corresponding configured HalStream and the respective stream id is present in the
+ * output buffers of the capture request.
+ */
+@VintfStability
+parcelable PhysicalCameraSetting {
+ /**
+ * If non-zero, read settings from request queue instead
+ * (see ICameraDeviceSession.getCaptureRequestMetadataQueue).
+ * If zero, read settings from .settings field.
+ *
+ * The logical settings metadata is read first from the FMQ, followed by
+ * the physical cameras' settings metadata starting from index 0.
+ */
+ long fmqSettingsSize;
+
+ /**
+ * Contains the physical device camera id. Any settings passed by client here
+ * should be applied for this physical device. In case the physical id is invalid or
+ * it is not present among the last configured streams, Hal should fail the process
+ * request and return Status::ILLEGAL_ARGUMENT.
+ */
+ String physicalCameraId;
+
+ /**
+ * If fmqSettingsSize is zero, the settings buffer contains the capture and
+ * processing parameters for the physical device with id 'physicalCameraId'.
+ * As a special case, an empty settings buffer indicates that the
+ * settings are identical to the most-recently submitted capture request.
+ * An empty buffer cannot be used as the first submitted request after
+ * a configureStreams() call.
+ *
+ * This field must be used if fmqSettingsSize is zero. It must not be used
+ * if fmqSettingsSize is non-zero.
+ */
+ CameraMetadata settings;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/RequestTemplate.aidl b/camera/device/aidl/android/hardware/camera/device/RequestTemplate.aidl
new file mode 100644
index 0000000..0235d8a
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/RequestTemplate.aidl
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+/**
+ * RequestTemplate:
+ *
+ * Available template types for
+ * ICameraDevice::constructDefaultRequestSettings()
+ */
+@VintfStability
+@Backing(type="int")
+enum RequestTemplate {
+ /**
+ * Standard camera preview operation with 3A on auto.
+ */
+ PREVIEW = 1,
+
+ /**
+ * Standard camera high-quality still capture with 3A and flash on auto.
+ */
+ STILL_CAPTURE = 2,
+
+ /**
+ * Standard video recording plus preview with 3A on auto, torch off.
+ */
+ VIDEO_RECORD = 3,
+
+ /**
+ * High-quality still capture while recording video. Applications typically
+ * include preview, video record, and full-resolution YUV or JPEG streams in
+ * request. Must not cause stuttering on video stream. 3A on auto.
+ */
+ VIDEO_SNAPSHOT = 4,
+
+ /**
+ * Zero-shutter-lag mode. Application typically request preview and
+ * full-resolution data for each frame, and reprocess it to JPEG when a
+ * still image is requested by user. Settings must provide highest-quality
+ * full-resolution images without compromising preview frame rate. 3A on
+ * auto.
+ */
+ ZERO_SHUTTER_LAG = 5,
+
+ /**
+ * A basic template for direct application control of capture
+ * parameters. All automatic control is disabled (auto-exposure, auto-white
+ * balance, auto-focus), and post-processing parameters are set to preview
+ * quality. The manual capture parameters (exposure, sensitivity, etc.)
+ * are set to reasonable defaults, but may be overridden by the
+ * application depending on the intended use case.
+ */
+ MANUAL = 6,
+
+ /**
+ * First value for vendor-defined request templates
+ */
+ VENDOR_TEMPLATE_START = 0x40000000,
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/ShutterMsg.aidl b/camera/device/aidl/android/hardware/camera/device/ShutterMsg.aidl
new file mode 100644
index 0000000..24ae1a0
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/ShutterMsg.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+/**
+ * ShutterMsg:
+ *
+ * Message contents for MsgType::SHUTTER
+ */
+@VintfStability
+parcelable ShutterMsg {
+ /**
+ * Frame number of the request that has begun exposure or reprocessing.
+ */
+ int frameNumber;
+
+ /**
+ * Timestamp for the start of capture. For a reprocess request, this must
+ * be input image's start of capture. This must match the capture result
+ * metadata's sensor exposure start timestamp.
+ */
+ long timestamp;
+
+ /**
+ * Timestamp for the capture readout. This must be in the same time domain
+ * as timestamp, and for a rolling shutter sensor, the value must be
+ * timestamp + exposureTime + t_crop_top where t_crop_top is the exposure time
+ * skew of the cropped lines on the top.
+ */
+ long readoutTimestamp;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/Stream.aidl b/camera/device/aidl/android/hardware/camera/device/Stream.aidl
new file mode 100644
index 0000000..e35e4ff
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/Stream.aidl
@@ -0,0 +1,225 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.StreamRotation;
+import android.hardware.camera.device.StreamType;
+
+/**
+ * Stream:
+ *
+ * A descriptor for a single camera input or output stream. A stream is defined
+ * by the framework by its buffer resolution and format, and additionally by the
+ * HAL with the gralloc usage flags and the maximum in-flight buffer count.
+ *
+ * Also contains the multi-resolution output surface group Id field, sensor pixel modes and
+ * dynamic range profile.
+ */
+@VintfStability
+parcelable Stream {
+ /**
+ * Stream ID - a nonnegative integer identifier for a stream.
+ *
+ * The identical stream ID must reference the same stream, with the same
+ * width/height/format, across consecutive calls to configureStreams.
+ *
+ * If previously-used stream ID is not used in a new call to
+ * configureStreams, then that stream is no longer active. Such a stream ID
+ * may be reused in a future configureStreams with a new
+ * width/height/format.
+ *
+ */
+ int id;
+
+ /**
+ * The type of the stream (input vs output, etc).
+ */
+ StreamType streamType;
+
+ /**
+ * The width in pixels of the buffers in this stream
+ */
+ int width;
+
+ /**
+ * The height in pixels of the buffers in this stream
+ */
+ int height;
+
+ /**
+ * The pixel format for the buffers in this stream.
+ *
+ * If IMPLEMENTATION_DEFINED is used, then the platform
+ * gralloc module must select a format based on the usage flags provided by
+ * the camera device and the other endpoint of the stream.
+ *
+ */
+ android.hardware.graphics.common.PixelFormat format;
+
+ /**
+ * The bitfield of gralloc usage flags for this stream, as needed by the consumer of
+ * the stream.
+ *
+ * The usage flags from the producer and the consumer must be combined
+ * together and then passed to the platform gralloc HAL module for
+ * allocating the gralloc buffers for each stream.
+ *
+ * The HAL may use these consumer flags to decide stream configuration. For
+ * streamType INPUT, the value of this field is always 0. For all streams
+ * passed via configureStreams(), the HAL must set its own
+ * additional usage flags in its output HalStreamConfiguration.
+ *
+ * The usage flag for an output stream may be bitwise combination of usage
+ * flags for multiple consumers, for the purpose of sharing one camera
+ * stream between those consumers. The HAL must fail configureStreams call
+ * with ILLEGAL_ARGUMENT if the combined flags cannot be supported due to
+ * imcompatible buffer format, dataSpace, or other hardware limitations.
+ */
+ android.hardware.graphics.common.BufferUsage usage;
+
+ /**
+ * A bitfield that describes the contents of the buffer. The format and buffer
+ * dimensions define the memory layout and structure of the stream buffers,
+ * while dataSpace defines the meaning of the data within the buffer.
+ *
+ * For most formats, dataSpace defines the color space of the image data.
+ * In addition, for some formats, dataSpace indicates whether image- or
+ * depth-based data is requested. See
+ * android.hardware.graphics.common@1.0::types for details of formats and
+ * valid dataSpace values for each format.
+ *
+ * The HAL must use this dataSpace to configure the stream to the correct
+ * colorspace, or to select between color and depth outputs if
+ * supported. The dataspace values are set using the V0 dataspace
+ * definitions.
+ */
+ android.hardware.graphics.common.Dataspace dataSpace;
+
+ /**
+ * The required output rotation of the stream.
+ *
+ * This must be inspected by HAL along with stream width and height. For
+ * example, if the rotation is 90 degree and the stream width and height is
+ * 720 and 1280 respectively, camera service must supply buffers of size
+ * 720x1280, and HAL must capture a 1280x720 image and rotate the image by
+ * 90 degree counterclockwise. The rotation field must be ignored when the
+ * stream type is input.
+ *
+ * The HAL must inspect this field during stream configuration and return
+ * IllegalArgument if HAL cannot perform such rotation. HAL must always
+ * support ROTATION_0, so a configureStreams() call must not fail for
+ * unsupported rotation if rotation field of all streams is ROTATION_0.
+ *
+ */
+ StreamRotation rotation;
+
+ /**
+ * The physical camera id this stream belongs to.
+ *
+ * If the camera device is not a logical multi camera, or if the camera is a logical
+ * multi camera but the stream is not a physical output stream, this field will point to a
+ * 0-length string.
+ *
+ * A logical multi camera is a camera device backed by multiple physical cameras that
+ * are also exposed to the application. And for a logical multi camera, a physical output
+ * stream is an output stream specifically requested on an underlying physical camera.
+ *
+ * A logical camera is a camera device backed by multiple physical camera
+ * devices. And a physical stream is a stream specifically requested on a
+ * underlying physical camera device.
+ *
+ * For an input stream, this field is guaranteed to be a 0-length string.
+ *
+ * When not empty, this field is the <id> field of one of the full-qualified device
+ * instance names returned by getCameraIdList().
+ */
+ String physicalCameraId;
+
+ /**
+ * The size of a buffer from this Stream, in bytes.
+ *
+ * For non PixelFormat::BLOB formats, this entry must be 0 and HAL should use
+ * android.hardware.graphics.mapper lockYCbCr API to get buffer layout.
+ *
+ * For BLOB format with dataSpace Dataspace::DEPTH, this must be zero and HAL must
+ * determine the buffer size based on ANDROID_DEPTH_MAX_DEPTH_SAMPLES.
+ *
+ * For BLOB format with dataSpace Dataspace::JFIF, this must be non-zero and represent the
+ * maximal size HAL can lock using android.hardware.graphics.mapper lock API.
+ *
+ */
+ int bufferSize;
+
+ /**
+ * The surface group id used for multi-resolution output streams.
+ *
+ * This works similar to the surfaceGroupId of OutputConfiguration in the
+ * public API, with the exception that this is for multi-resolution image
+ * reader and is used by the camera HAL to choose a target stream within
+ * the same group to which images are written. All streams in the same group
+ * will have the same image format, data space, and usage flag.
+ *
+ * The framework must only call processCaptureRequest on at most one of the
+ * streams within a surface group. Depending on current active physical
+ * camera backing the logical multi-camera, or the pixel mode the camera is
+ * running in, the HAL can choose to request and return a buffer from any
+ * stream within the same group. -1 means that this stream is an input
+ * stream, or is an output stream which doesn't belong to any group.
+ *
+ * Streams with the same non-negative group id must have the same format and
+ * usage flag.
+ */
+ int groupId;
+
+ /**
+ * The sensor pixel modes used by this stream. This can assist the camera
+ * HAL in decision making about stream combination support.
+ * If this is empty, the HAL must assume that this stream will only be used
+ * with ANDROID_SENSOR_PIXEL_MODE set to ANDROID_SENSOR_PIXEL_MODE_DEFAULT.
+ */
+ android.hardware.camera.metadata.SensorPixelMode[] sensorPixelModesUsed;
+
+ /**
+ * The dynamic range profile for this stream.
+ *
+ * This field is valid and must only be considered for streams with format
+ * android.hardware.graphics.common.PixelFormat.YCBCR_P010 or
+ * android.hardware.graphics.common.PixelFormat.IMPLEMENTATION_DEFINED on devices supporting the
+ * ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_10_BIT capability.
+ *
+ */
+ android.hardware.camera.metadata.RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile;
+
+ /**
+ * The stream use case describing the stream's purpose
+ *
+ * This flag provides the camera device a hint on what user scenario this
+ * stream is intended for. With this flag, the camera device can optimize
+ * camera pipeline parameters, such as tuning, sensor mode, and ISP settings,
+ * for the intended use case.
+ *
+ * When this field is set to DEFAULT, the camera device should behave in
+ * the same way as in previous HAL versions, and optimize the camera pipeline
+ * based on stream format, data space, usage flag, and other stream properties.
+ *
+ * The HAL reports supported stream use cases in
+ * ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES. If the HAL doesn't support
+ * setting stream use cases, the camera framework leaves this field as
+ * DEFAULT.
+ */
+ android.hardware.camera.metadata.ScalerAvailableStreamUseCases useCase;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/StreamBuffer.aidl b/camera/device/aidl/android/hardware/camera/device/StreamBuffer.aidl
new file mode 100644
index 0000000..e487494
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/StreamBuffer.aidl
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.BufferStatus;
+import android.hardware.common.NativeHandle;
+
+/**
+ * StreamBuffer:
+ *
+ * A single buffer from a camera HAL stream. It includes a handle to its parent
+ * stream, the handle to the gralloc buffer itself, and sync fences
+ *
+ * The buffer does not specify whether it is to be used for input or output;
+ * that is determined by its parent stream type and how the buffer is passed to
+ * the HAL device.
+ */
+@VintfStability
+parcelable StreamBuffer {
+ /**
+ * The ID of the stream this buffer is associated with. -1 indicates an
+ * invalid (empty) StreamBuffer, in which case buffer must also point to
+ * null and bufferId must be 0.
+ */
+ int streamId;
+
+ /**
+ * The unique ID of the buffer within this StreamBuffer. 0 indicates this
+ * StreamBuffer contains no buffer.
+ * For StreamBuffers sent to the HAL in a CaptureRequest, this ID uniquely
+ * identifies a buffer. When a buffer is sent to HAL for the first time,
+ * both bufferId and buffer handle must be filled. HAL must keep track of
+ * the mapping between bufferId and corresponding buffer until the
+ * corresponding stream is removed from stream configuration or until camera
+ * device session is closed. After the first time a buffer is introduced to
+ * HAL, in the future camera service must refer to the same buffer using
+ * only bufferId, and keep the buffer handle null.
+ */
+ long bufferId;
+
+ /**
+ * The graphics buffer handle to the buffer.
+ *
+ * For StreamBuffers sent to the HAL in a CaptureRequest, if the bufferId
+ * is not seen by the HAL before, this buffer handle is guaranteed to be a
+ * valid handle to a graphics buffer, with dimensions and format matching
+ * that of the stream. If the bufferId has been sent to the HAL before, this
+ * buffer handle must be null and HAL must look up the actual buffer handle
+ * to use from its own bufferId to buffer handle map.
+ *
+ * For StreamBuffers returned in a CaptureResult, this must be null, since
+ * the handle to the buffer is already known to the client (since the client
+ * sent it in the matching CaptureRequest), and the handle can be identified
+ * by the combination of frame number and stream ID.
+ */
+ NativeHandle buffer;
+
+ /**
+ * Current state of the buffer. The framework must not pass buffers to the
+ * HAL that are in an error state. In case a buffer could not be filled by
+ * the HAL, it must have its status set to ERROR when returned to the
+ * framework with processCaptureResult().
+ */
+ BufferStatus status;
+
+ /**
+ * The acquire sync fence for this buffer. The HAL must wait on this fence
+ * fd before attempting to read from or write to this buffer.
+ *
+ * In a buffer included in a CaptureRequest, the client may set this to null
+ * to indicate that no waiting is necessary for this buffer.
+ *
+ * When the HAL returns an input or output buffer to the framework with
+ * processCaptureResult(), the acquireFence must be set to null. If the HAL
+ * never waits on the acquireFence due to an error in filling or reading a
+ * buffer, when calling processCaptureResult() the HAL must set the
+ * releaseFence of the buffer to be the acquireFence passed to it by the
+ * client. This allows the client to wait on the fence before reusing the
+ * buffer.
+ */
+ NativeHandle acquireFence;
+
+ /**
+ * The release sync fence for this buffer. The HAL must set this to a valid
+ * fence fd when returning the input buffer or output buffers to the client
+ * in a CaptureResult, or set it to null to indicate that no waiting is
+ * required for this buffer.
+ *
+ * The client must set this to be null for all buffers included in a
+ * processCaptureRequest call.
+ *
+ * After signaling the releaseFence for this buffer, the HAL
+ * must not make any further attempts to access this buffer as the
+ * ownership has been fully transferred back to the client.
+ *
+ * If this is null, then the ownership of this buffer is transferred back
+ * immediately upon the call of processCaptureResult.
+ */
+ NativeHandle releaseFence;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/StreamBufferRequestError.aidl b/camera/device/aidl/android/hardware/camera/device/StreamBufferRequestError.aidl
new file mode 100644
index 0000000..4ba0045
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/StreamBufferRequestError.aidl
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+@VintfStability
+@Backing(type="int")
+enum StreamBufferRequestError {
+ /**
+ * Get buffer failed due to timeout waiting for an available buffer. This is
+ * likely due to the client application holding too many buffers, or the
+ * system is under memory pressure.
+ * This is not a fatal error. HAL may try to request buffer for this stream
+ * later. If HAL cannot get a buffer for certain capture request in time
+ * due to this error, HAL can send an ERROR_REQUEST to camera service and
+ * drop processing that request.
+ */
+ NO_BUFFER_AVAILABLE = 1,
+ /**
+ * Get buffer failed due to HAL has reached its maxBuffer count. This is not
+ * a fatal error. HAL may try to request buffer for this stream again after
+ * it returns at least one buffer of that stream to camera service.
+ */
+ MAX_BUFFER_EXCEEDED = 2,
+ /**
+ * Get buffer failed due to the stream is disconnected by client
+ * application, has been removed, or not recognized by camera service.
+ * This means application is no longer interested in this stream.
+ * Requesting buffer for this stream must never succeed after this error is
+ * returned. HAL must safely return all buffers of this stream after
+ * getting this error. If HAL gets another capture request later targeting
+ * a disconnected stream, HAL must send an ERROR_REQUEST to camera service
+ * and drop processing that request.
+ */
+ STREAM_DISCONNECTED = 3,
+ /**
+ * Get buffer failed for unknown reasons. This is a fatal error and HAL must
+ * send ERROR_DEVICE to camera service and be ready to be closed.
+ */
+ UNKNOWN_ERROR = 4,
+}
diff --git a/audio/7.1/IStreamIn.hal b/camera/device/aidl/android/hardware/camera/device/StreamBufferRet.aidl
similarity index 76%
copy from audio/7.1/IStreamIn.hal
copy to camera/device/aidl/android/hardware/camera/device/StreamBufferRet.aidl
index abebe6a..b6d85c2 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/device/aidl/android/hardware/camera/device/StreamBufferRet.aidl
@@ -14,9 +14,13 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.camera.device;
-import @7.0::IStreamIn;
+import android.hardware.camera.device.StreamBuffersVal;
-interface IStreamIn extends @7.0::IStreamIn {
-};
+@VintfStability
+parcelable StreamBufferRet {
+ int streamId;
+
+ StreamBuffersVal val;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/StreamBuffersVal.aidl b/camera/device/aidl/android/hardware/camera/device/StreamBuffersVal.aidl
new file mode 100644
index 0000000..125d9c7
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/StreamBuffersVal.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.StreamBuffer;
+import android.hardware.camera.device.StreamBufferRequestError;
+
+/**
+ * Per-stream return value for requestStreamBuffers.
+ * For each stream, either an StreamBufferRequestError error code, or all
+ * requested buffers for this stream is returned, so buffers.size() must be
+ * equal to BufferRequest::numBuffersRequested of corresponding stream.
+ */
+@VintfStability
+union StreamBuffersVal {
+ StreamBufferRequestError error = StreamBufferRequestError.UNKNOWN_ERROR;
+
+ StreamBuffer[] buffers;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl b/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl
new file mode 100644
index 0000000..cacd32c
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.CameraMetadata;
+import android.hardware.camera.device.Stream;
+import android.hardware.camera.device.StreamConfigurationMode;
+
+/**
+ * StreamConfiguration:
+ *
+ * A structure of stream definitions, used by configureStreams(). This
+ * structure defines all the output streams and the reprocessing input
+ * stream for the current camera use case.
+ */
+@VintfStability
+parcelable StreamConfiguration {
+ /**
+ * An array of camera stream pointers, defining the input/output
+ * configuration for the camera HAL device.
+ */
+ Stream[] streams;
+
+ /**
+ * The operation mode of streams in this configuration. The HAL can use this
+ * mode as an indicator to set the stream property (e.g.,
+ * HalStream.maxBuffers) appropriately. For example, if the
+ * configuration is
+ * CONSTRAINED_HIGH_SPEED_MODE, the HAL may
+ * want to set aside more buffers for batch mode operation (see
+ * android.control.availableHighSpeedVideoConfigurations for batch mode
+ * definition).
+ *
+ */
+ StreamConfigurationMode operationMode;
+
+ /**
+ * Session wide camera parameters.
+ *
+ * The session parameters contain the initial values of any request keys that were
+ * made available via ANDROID_REQUEST_AVAILABLE_SESSION_KEYS. The Hal implementation
+ * can advertise any settings that can potentially introduce unexpected delays when
+ * their value changes during active process requests. Typical examples are
+ * parameters that trigger time-consuming HW re-configurations or internal camera
+ * pipeline updates. The field is optional, clients can choose to ignore it and avoid
+ * including any initial settings. If parameters are present, then hal must examine
+ * their values and configure the internal camera pipeline accordingly.
+ */
+ CameraMetadata sessionParams;
+
+ /**
+ * An incrementing counter used for HAL to keep track of the stream
+ * configuration and the paired oneway signalStreamFlush call. When the
+ * counter in signalStreamFlush call is less than the counter here, that
+ * signalStreamFlush call is stale.
+ */
+ int streamConfigCounter;
+
+ /**
+ * If an input stream is configured, whether the input stream is expected to
+ * receive variable resolution images.
+ *
+ * This flag can only be set to true if the camera device supports
+ * multi-resolution input streams by advertising input stream configurations in
+ * physicalCameraMultiResolutionStreamConfigurations in its physical cameras'
+ * characteristics.
+ *
+ * When this flag is set to true, the input stream's width and height can be
+ * any one of the supported multi-resolution input stream sizes.
+ */
+ boolean multiResolutionInputImage;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/StreamConfigurationMode.aidl b/camera/device/aidl/android/hardware/camera/device/StreamConfigurationMode.aidl
new file mode 100644
index 0000000..10feecb
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/StreamConfigurationMode.aidl
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+/**
+ * StreamConfigurationMode:
+ *
+ * This defines the general operation mode for the HAL (for a given stream
+ * configuration) where modes besides NORMAL have different semantics, and
+ * usually limit the generality of the API in exchange for higher performance in
+ * some particular area.
+ */
+@VintfStability
+@Backing(type="int")
+enum StreamConfigurationMode {
+ /**
+ * Normal stream configuration operation mode. This is the default camera
+ * operation mode, where all semantics of HAL APIs and metadata controls
+ * apply.
+ */
+ NORMAL_MODE = 0,
+
+ /**
+ * Special constrained high speed operation mode for devices that can not
+ * support high speed output in NORMAL mode. All streams in this
+ * configuration are operating at high speed mode and have different
+ * characteristics and limitations to achieve high speed output. The NORMAL
+ * mode can still be used for high speed output if the HAL can support high
+ * speed output while satisfying all the semantics of HAL APIs and metadata
+ * controls. It is recommended for the HAL to support high speed output in
+ * NORMAL mode (by advertising the high speed FPS ranges in
+ * android.control.aeAvailableTargetFpsRanges) if possible.
+ *
+ * This mode has below limitations/requirements:
+ *
+ * 1. The HAL must support up to 2 streams with sizes reported by
+ * android.control.availableHighSpeedVideoConfigurations.
+ * 2. In this mode, the HAL is expected to output up to 120fps or
+ * higher. This mode must support the targeted FPS range and size
+ * configurations reported by
+ * android.control.availableHighSpeedVideoConfigurations.
+ * 3. The HAL must support IMPLEMENTATION_DEFINED output
+ * stream format.
+ * 4. To achieve efficient high speed streaming, the HAL may have to
+ * aggregate multiple frames together and send to camera device for
+ * processing where the request controls are same for all the frames in
+ * this batch (batch mode). The HAL must support max batch size and the
+ * max batch size requirements defined by
+ * android.control.availableHighSpeedVideoConfigurations.
+ * 5. In this mode, the HAL must override aeMode, awbMode, and afMode to
+ * ON, ON, and CONTINUOUS_VIDEO, respectively. All post-processing
+ * block mode controls must be overridden to be FAST. Therefore, no
+ * manual control of capture and post-processing parameters is
+ * possible. All other controls operate the same as when
+ * android.control.mode == AUTO. This means that all other
+ * android.control.* fields must continue to work, such as
+ *
+ * android.control.aeTargetFpsRange
+ * android.control.aeExposureCompensation
+ * android.control.aeLock
+ * android.control.awbLock
+ * android.control.effectMode
+ * android.control.aeRegions
+ * android.control.afRegions
+ * android.control.awbRegions
+ * android.control.afTrigger
+ * android.control.aePrecaptureTrigger
+ *
+ * Outside of android.control.*, the following controls must work:
+ *
+ * android.flash.mode (TORCH mode only, automatic flash for still
+ * capture must not work since aeMode is ON)
+ * android.lens.opticalStabilizationMode (if it is supported)
+ * android.scaler.cropRegion
+ * android.statistics.faceDetectMode (if it is supported)
+ * 6. To reduce the amount of data passed across process boundaries at
+ * high frame rate, within one batch, camera framework only propagates
+ * the last shutter notify and the last capture results (including partial
+ * results and final result) to the app. The shutter notifies and capture
+ * results for the other requests in the batch are derived by
+ * the camera framework. As a result, the HAL can return empty metadata
+ * except for the last result in the batch.
+ *
+ * For more details about high speed stream requirements, see
+ * android.control.availableHighSpeedVideoConfigurations and
+ * CONSTRAINED_HIGH_SPEED_VIDEO capability defined in
+ * android.request.availableCapabilities.
+ *
+ * This mode only needs to be supported by HALs that include
+ * CONSTRAINED_HIGH_SPEED_VIDEO in the android.request.availableCapabilities
+ * static metadata.
+ */
+ CONSTRAINED_HIGH_SPEED_MODE = 1,
+
+ /**
+ * A set of vendor-defined operating modes, for custom default camera
+ * application features that can't be implemented in the fully flexible fashion
+ * required for NORMAL_MODE.
+ */
+ VENDOR_MODE_0 = 0x8000,
+ VENDOR_MODE_1,
+ VENDOR_MODE_2,
+ VENDOR_MODE_3,
+ VENDOR_MODE_4,
+ VENDOR_MODE_5,
+ VENDOR_MODE_6,
+ VENDOR_MODE_7,
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/StreamRotation.aidl b/camera/device/aidl/android/hardware/camera/device/StreamRotation.aidl
new file mode 100644
index 0000000..1eee97c
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/StreamRotation.aidl
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+/**
+ * StreamRotation:
+ *
+ * The required counterclockwise rotation of camera stream.
+ */
+@VintfStability
+@Backing(type="int")
+enum StreamRotation {
+ /**
+ * No rotation
+ */
+ ROTATION_0 = 0,
+
+ /**
+ * Rotate by 90 degree counterclockwise
+ */
+ ROTATION_90 = 1,
+
+ /**
+ * Rotate by 180 degree counterclockwise
+ */
+ ROTATION_180 = 2,
+
+ /**
+ * Rotate by 270 degree counterclockwise
+ */
+ ROTATION_270 = 3,
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/StreamType.aidl b/camera/device/aidl/android/hardware/camera/device/StreamType.aidl
new file mode 100644
index 0000000..4a876c7
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/StreamType.aidl
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device;
+
+/**
+ * StreamType:
+ *
+ * The type of the camera stream, which defines whether the camera HAL device is
+ * the producer or the consumer for that stream, and how the buffers of the
+ * stream relate to the other streams.
+ */
+@VintfStability
+@Backing(type="int")
+enum StreamType {
+ /**
+ * This stream is an output stream; the camera HAL device must fill buffers
+ * from this stream with newly captured or reprocessed image data.
+ */
+ OUTPUT = 0,
+
+ /**
+ * This stream is an input stream; the camera HAL device must read buffers
+ * from this stream and send them through the camera processing pipeline,
+ * as if the buffer was a newly captured image from the imager.
+ *
+ * The pixel format for input stream can be any format reported by
+ * android.scaler.availableInputOutputFormatsMap. The pixel format of the
+ * output stream that is used to produce the reprocessing data may be any
+ * format reported by android.scaler.availableStreamConfigurations. The
+ * supported input/output stream combinations depends the camera device
+ * capabilities, see android.scaler.availableInputOutputFormatsMap for
+ * stream map details.
+ *
+ * This kind of stream is generally used to reprocess data into higher
+ * quality images (that otherwise would cause a frame rate performance
+ * loss), or to do off-line reprocessing.
+ *
+ * The typical use cases are OPAQUE (typically ZSL) and YUV reprocessing,
+ * see S8.2, S8.3 and S10 for more details.
+ */
+ INPUT = 1,
+}
diff --git a/camera/metadata/3.8/types.hal b/camera/metadata/3.8/types.hal
index 4c70eb9..1b1a7a2 100644
--- a/camera/metadata/3.8/types.hal
+++ b/camera/metadata/3.8/types.hal
@@ -29,7 +29,34 @@
import android.hardware.camera.metadata@3.6;
import android.hardware.camera.metadata@3.7;
-// No new metadata sections added in this revision
+/**
+ * Top level hierarchy definitions for camera metadata. *_INFO sections are for
+ * the static metadata that can be retrieved without opening the camera device.
+ */
+enum CameraMetadataSection : @3.4::CameraMetadataSection {
+ ANDROID_AUTOMOTIVE =
+ android.hardware.camera.metadata@3.4::CameraMetadataSection:ANDROID_SECTION_COUNT,
+
+ ANDROID_AUTOMOTIVE_LENS,
+
+ ANDROID_SECTION_COUNT_3_8,
+
+ VENDOR_SECTION_3_8 = 0x8000,
+
+};
+
+/**
+ * Hierarchy positions in enum space. All vendor extension sections must be
+ * defined with tag >= VENDOR_SECTION_START
+ */
+enum CameraMetadataSectionStart : android.hardware.camera.metadata@3.4::CameraMetadataSectionStart {
+ ANDROID_AUTOMOTIVE_START = CameraMetadataSection:ANDROID_AUTOMOTIVE << 16,
+
+ ANDROID_AUTOMOTIVE_LENS_START = CameraMetadataSection:ANDROID_AUTOMOTIVE_LENS << 16,
+
+ VENDOR_SECTION_START_3_8 = CameraMetadataSection:VENDOR_SECTION_3_8 << 16,
+
+};
/**
* Main enumeration for defining camera metadata tags added in this revision
@@ -68,6 +95,31 @@
ANDROID_REQUEST_END_3_8,
+ /** android.scaler.availableStreamUseCases [static, enum[], public]
+ *
+ * <p>The stream use cases supported by this camera device.</p>
+ */
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES = android.hardware.camera.metadata@3.6::CameraMetadataTag:ANDROID_SCALER_END_3_6,
+
+ ANDROID_SCALER_END_3_8,
+
+ /** android.automotive.location [static, enum, public]
+ *
+ * <p>Location of the cameras on the automotive devices.</p>
+ */
+ ANDROID_AUTOMOTIVE_LOCATION = CameraMetadataSectionStart:ANDROID_AUTOMOTIVE_START,
+
+ ANDROID_AUTOMOTIVE_END_3_8,
+
+ /** android.automotive.lens.facing [static, enum[], public]
+ *
+ * <p>The direction of the camera faces relative to the vehicle body frame and the
+ * passenger seats.</p>
+ */
+ ANDROID_AUTOMOTIVE_LENS_FACING = CameraMetadataSectionStart:ANDROID_AUTOMOTIVE_LENS_START,
+
+ ANDROID_AUTOMOTIVE_LENS_END_3_8,
+
};
/*
@@ -82,12 +134,21 @@
ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION,
};
+/** android.lens.poseReference enumeration values added since v3.5
+ * @see ANDROID_LENS_POSE_REFERENCE
+ */
+enum CameraMetadataEnumAndroidLensPoseReference :
+ @3.5::CameraMetadataEnumAndroidLensPoseReference {
+ ANDROID_LENS_POSE_REFERENCE_AUTOMOTIVE,
+};
+
/** android.request.availableCapabilities enumeration values added since v3.6
* @see ANDROID_REQUEST_AVAILABLE_CAPABILITIES
*/
enum CameraMetadataEnumAndroidRequestAvailableCapabilities :
@3.6::CameraMetadataEnumAndroidRequestAvailableCapabilities {
ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE,
};
/** android.request.availableDynamicRangeProfilesMap enumeration values
@@ -129,3 +190,55 @@
ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END_3_8
= 0x9,
};
+
+/** android.scaler.availableStreamUseCases enumeration values
+ * @see ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES
+ */
+enum CameraMetadataEnumAndroidScalerAvailableStreamUseCases : uint32_t {
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0x0,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 0x1,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE = 0x2,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD = 0x3,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL
+ = 0x4,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL = 0x5,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START = 0x10000,
+};
+
+/** android.automotive.location enumeration values
+ * @see ANDROID_AUTOMOTIVE_LOCATION
+ */
+enum CameraMetadataEnumAndroidAutomotiveLocation : uint32_t {
+ ANDROID_AUTOMOTIVE_LOCATION_INTERIOR,
+ ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_OTHER,
+ ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_FRONT,
+ ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_REAR,
+ ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_LEFT,
+ ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_RIGHT,
+ ANDROID_AUTOMOTIVE_LOCATION_EXTRA_OTHER,
+ ANDROID_AUTOMOTIVE_LOCATION_EXTRA_FRONT,
+ ANDROID_AUTOMOTIVE_LOCATION_EXTRA_REAR,
+ ANDROID_AUTOMOTIVE_LOCATION_EXTRA_LEFT,
+ ANDROID_AUTOMOTIVE_LOCATION_EXTRA_RIGHT,
+};
+
+/** android.automotive.lens.facing enumeration values
+ * @see ANDROID_AUTOMOTIVE_LENS_FACING
+ */
+enum CameraMetadataEnumAndroidAutomotiveLensFacing : uint32_t {
+ ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_OTHER,
+ ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_FRONT,
+ ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_REAR,
+ ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_LEFT,
+ ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_RIGHT,
+ ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_OTHER,
+ ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_LEFT,
+ ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_CENTER,
+ ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_RIGHT,
+ ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_LEFT,
+ ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_CENTER,
+ ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_RIGHT,
+ ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_LEFT,
+ ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_CENTER,
+ ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_RIGHT,
+};
diff --git a/camera/metadata/aidl/Android.bp b/camera/metadata/aidl/Android.bp
new file mode 100644
index 0000000..05f280c
--- /dev/null
+++ b/camera/metadata/aidl/Android.bp
@@ -0,0 +1,19 @@
+aidl_interface {
+ name: "android.hardware.camera.metadata",
+ vendor_available: true,
+ srcs: ["android/hardware/camera/metadata/*.aidl"],
+ stability: "vintf",
+ backend: {
+ cpp: {
+ enabled: false,
+ },
+ java: {
+ enabled: false,
+ },
+ ndk: {
+ vndk: {
+ enabled: true,
+ },
+ },
+ },
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/BlackLevelLock.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/BlackLevelLock.aidl
index 5395b11..dcefa2f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/BlackLevelLock.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum BlackLevelLock {
+ ANDROID_BLACK_LEVEL_LOCK_OFF = 0,
+ ANDROID_BLACK_LEVEL_LOCK_ON = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl
similarity index 61%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl
index 5395b11..dc33836 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,38 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum CameraMetadataSection {
+ ANDROID_COLOR_CORRECTION = 0,
+ ANDROID_CONTROL = 1,
+ ANDROID_DEMOSAIC = 2,
+ ANDROID_EDGE = 3,
+ ANDROID_FLASH = 4,
+ ANDROID_FLASH_INFO = 5,
+ ANDROID_HOT_PIXEL = 6,
+ ANDROID_JPEG = 7,
+ ANDROID_LENS = 8,
+ ANDROID_LENS_INFO = 9,
+ ANDROID_NOISE_REDUCTION = 10,
+ ANDROID_QUIRKS = 11,
+ ANDROID_REQUEST = 12,
+ ANDROID_SCALER = 13,
+ ANDROID_SENSOR = 14,
+ ANDROID_SENSOR_INFO = 15,
+ ANDROID_SHADING = 16,
+ ANDROID_STATISTICS = 17,
+ ANDROID_STATISTICS_INFO = 18,
+ ANDROID_TONEMAP = 19,
+ ANDROID_LED = 20,
+ ANDROID_INFO = 21,
+ ANDROID_BLACK_LEVEL = 22,
+ ANDROID_SYNC = 23,
+ ANDROID_REPROCESS = 24,
+ ANDROID_DEPTH = 25,
+ ANDROID_LOGICAL_MULTI_CAMERA = 26,
+ ANDROID_DISTORTION_CORRECTION = 27,
+ ANDROID_HEIC = 28,
+ ANDROID_HEIC_INFO = 29,
+ VENDOR_SECTION = 32768,
}
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
new file mode 100644
index 0000000..0c355c8
--- /dev/null
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.camera.metadata;
+@Backing(type="int") @VintfStability
+enum CameraMetadataSectionStart {
+ ANDROID_COLOR_CORRECTION_START = 0,
+ ANDROID_CONTROL_START = 65536,
+ ANDROID_DEMOSAIC_START = 131072,
+ ANDROID_EDGE_START = 196608,
+ ANDROID_FLASH_START = 262144,
+ ANDROID_FLASH_INFO_START = 327680,
+ ANDROID_HOT_PIXEL_START = 393216,
+ ANDROID_JPEG_START = 458752,
+ ANDROID_LENS_START = 524288,
+ ANDROID_LENS_INFO_START = 589824,
+ ANDROID_NOISE_REDUCTION_START = 655360,
+ ANDROID_QUIRKS_START = 720896,
+ ANDROID_REQUEST_START = 786432,
+ ANDROID_SCALER_START = 851968,
+ ANDROID_SENSOR_START = 917504,
+ ANDROID_SENSOR_INFO_START = 983040,
+ ANDROID_SHADING_START = 1048576,
+ ANDROID_STATISTICS_START = 1114112,
+ ANDROID_STATISTICS_INFO_START = 1179648,
+ ANDROID_TONEMAP_START = 1245184,
+ ANDROID_LED_START = 1310720,
+ ANDROID_INFO_START = 1376256,
+ ANDROID_BLACK_LEVEL_START = 1441792,
+ ANDROID_SYNC_START = 1507328,
+ ANDROID_REPROCESS_START = 1572864,
+ ANDROID_DEPTH_START = 1638400,
+ VENDOR_SECTION_START = -2147483648,
+ ANDROID_LOGICAL_MULTI_CAMERA_START = 1703936,
+ ANDROID_DISTORTION_CORRECTION_START = 1769472,
+ ANDROID_HEIC_START = 1835008,
+ ANDROID_HEIC_INFO_START = 1900544,
+ VENDOR_SECTION_START = -2147483648,
+}
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl
new file mode 100644
index 0000000..432c9fd
--- /dev/null
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl
@@ -0,0 +1,328 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.camera.metadata;
+@Backing(type="int") @VintfStability
+enum CameraMetadataTag {
+ ANDROID_COLOR_CORRECTION_MODE = 0,
+ ANDROID_COLOR_CORRECTION_TRANSFORM = 1,
+ ANDROID_COLOR_CORRECTION_GAINS = 2,
+ ANDROID_COLOR_CORRECTION_ABERRATION_MODE = 3,
+ ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES = 4,
+ ANDROID_CONTROL_AE_ANTIBANDING_MODE = 65536,
+ ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION = 65537,
+ ANDROID_CONTROL_AE_LOCK = 65538,
+ ANDROID_CONTROL_AE_MODE = 65539,
+ ANDROID_CONTROL_AE_REGIONS = 65540,
+ ANDROID_CONTROL_AE_TARGET_FPS_RANGE = 65541,
+ ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER = 65542,
+ ANDROID_CONTROL_AF_MODE = 65543,
+ ANDROID_CONTROL_AF_REGIONS = 65544,
+ ANDROID_CONTROL_AF_TRIGGER = 65545,
+ ANDROID_CONTROL_AWB_LOCK = 65546,
+ ANDROID_CONTROL_AWB_MODE = 65547,
+ ANDROID_CONTROL_AWB_REGIONS = 65548,
+ ANDROID_CONTROL_CAPTURE_INTENT = 65549,
+ ANDROID_CONTROL_EFFECT_MODE = 65550,
+ ANDROID_CONTROL_MODE = 65551,
+ ANDROID_CONTROL_SCENE_MODE = 65552,
+ ANDROID_CONTROL_VIDEO_STABILIZATION_MODE = 65553,
+ ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES = 65554,
+ ANDROID_CONTROL_AE_AVAILABLE_MODES = 65555,
+ ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES = 65556,
+ ANDROID_CONTROL_AE_COMPENSATION_RANGE = 65557,
+ ANDROID_CONTROL_AE_COMPENSATION_STEP = 65558,
+ ANDROID_CONTROL_AF_AVAILABLE_MODES = 65559,
+ ANDROID_CONTROL_AVAILABLE_EFFECTS = 65560,
+ ANDROID_CONTROL_AVAILABLE_SCENE_MODES = 65561,
+ ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES = 65562,
+ ANDROID_CONTROL_AWB_AVAILABLE_MODES = 65563,
+ ANDROID_CONTROL_MAX_REGIONS = 65564,
+ ANDROID_CONTROL_SCENE_MODE_OVERRIDES = 65565,
+ ANDROID_CONTROL_AE_PRECAPTURE_ID = 65566,
+ ANDROID_CONTROL_AE_STATE = 65567,
+ ANDROID_CONTROL_AF_STATE = 65568,
+ ANDROID_CONTROL_AF_TRIGGER_ID = 65569,
+ ANDROID_CONTROL_AWB_STATE = 65570,
+ ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS = 65571,
+ ANDROID_CONTROL_AE_LOCK_AVAILABLE = 65572,
+ ANDROID_CONTROL_AWB_LOCK_AVAILABLE = 65573,
+ ANDROID_CONTROL_AVAILABLE_MODES = 65574,
+ ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE = 65575,
+ ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST = 65576,
+ ANDROID_CONTROL_ENABLE_ZSL = 65577,
+ ANDROID_CONTROL_AF_SCENE_CHANGE = 65578,
+ ANDROID_CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_MAX_SIZES = 65579,
+ ANDROID_CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_ZOOM_RATIO_RANGES = 65580,
+ ANDROID_CONTROL_EXTENDED_SCENE_MODE = 65581,
+ ANDROID_CONTROL_ZOOM_RATIO_RANGE = 65582,
+ ANDROID_CONTROL_ZOOM_RATIO = 65583,
+ ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS_MAXIMUM_RESOLUTION = 65584,
+ ANDROID_DEMOSAIC_MODE = 131072,
+ ANDROID_EDGE_MODE = 196608,
+ ANDROID_EDGE_STRENGTH = 196609,
+ ANDROID_EDGE_AVAILABLE_EDGE_MODES = 196610,
+ ANDROID_FLASH_FIRING_POWER = 262144,
+ ANDROID_FLASH_FIRING_TIME = 262145,
+ ANDROID_FLASH_MODE = 262146,
+ ANDROID_FLASH_COLOR_TEMPERATURE = 262147,
+ ANDROID_FLASH_MAX_ENERGY = 262148,
+ ANDROID_FLASH_STATE = 262149,
+ ANDROID_FLASH_INFO_AVAILABLE = 327680,
+ ANDROID_FLASH_INFO_CHARGE_DURATION = 327681,
+ ANDROID_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL = 327682,
+ ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL = 327683,
+ ANDROID_HOT_PIXEL_MODE = 393216,
+ ANDROID_HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES = 393217,
+ ANDROID_JPEG_GPS_COORDINATES = 458752,
+ ANDROID_JPEG_GPS_PROCESSING_METHOD = 458753,
+ ANDROID_JPEG_GPS_TIMESTAMP = 458754,
+ ANDROID_JPEG_ORIENTATION = 458755,
+ ANDROID_JPEG_QUALITY = 458756,
+ ANDROID_JPEG_THUMBNAIL_QUALITY = 458757,
+ ANDROID_JPEG_THUMBNAIL_SIZE = 458758,
+ ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES = 458759,
+ ANDROID_JPEG_MAX_SIZE = 458760,
+ ANDROID_JPEG_SIZE = 458761,
+ ANDROID_LENS_APERTURE = 524288,
+ ANDROID_LENS_FILTER_DENSITY = 524289,
+ ANDROID_LENS_FOCAL_LENGTH = 524290,
+ ANDROID_LENS_FOCUS_DISTANCE = 524291,
+ ANDROID_LENS_OPTICAL_STABILIZATION_MODE = 524292,
+ ANDROID_LENS_FACING = 524293,
+ ANDROID_LENS_POSE_ROTATION = 524294,
+ ANDROID_LENS_POSE_TRANSLATION = 524295,
+ ANDROID_LENS_FOCUS_RANGE = 524296,
+ ANDROID_LENS_STATE = 524297,
+ ANDROID_LENS_INTRINSIC_CALIBRATION = 524298,
+ ANDROID_LENS_RADIAL_DISTORTION = 524299,
+ ANDROID_LENS_POSE_REFERENCE = 524300,
+ ANDROID_LENS_DISTORTION = 524301,
+ ANDROID_LENS_DISTORTION_MAXIMUM_RESOLUTION = 524302,
+ ANDROID_LENS_INTRINSIC_CALIBRATION_MAXIMUM_RESOLUTION = 524303,
+ ANDROID_LENS_INFO_AVAILABLE_APERTURES = 589824,
+ ANDROID_LENS_INFO_AVAILABLE_FILTER_DENSITIES = 589825,
+ ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS = 589826,
+ ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION = 589827,
+ ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE = 589828,
+ ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE = 589829,
+ ANDROID_LENS_INFO_SHADING_MAP_SIZE = 589830,
+ ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION = 589831,
+ ANDROID_NOISE_REDUCTION_MODE = 655360,
+ ANDROID_NOISE_REDUCTION_STRENGTH = 655361,
+ ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES = 655362,
+ ANDROID_QUIRKS_METERING_CROP_REGION = 720896,
+ ANDROID_QUIRKS_TRIGGER_AF_WITH_AUTO = 720897,
+ ANDROID_QUIRKS_USE_ZSL_FORMAT = 720898,
+ ANDROID_QUIRKS_USE_PARTIAL_RESULT = 720899,
+ ANDROID_QUIRKS_PARTIAL_RESULT = 720900,
+ ANDROID_REQUEST_FRAME_COUNT = 786432,
+ ANDROID_REQUEST_ID = 786433,
+ ANDROID_REQUEST_INPUT_STREAMS = 786434,
+ ANDROID_REQUEST_METADATA_MODE = 786435,
+ ANDROID_REQUEST_OUTPUT_STREAMS = 786436,
+ ANDROID_REQUEST_TYPE = 786437,
+ ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS = 786438,
+ ANDROID_REQUEST_MAX_NUM_REPROCESS_STREAMS = 786439,
+ ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS = 786440,
+ ANDROID_REQUEST_PIPELINE_DEPTH = 786441,
+ ANDROID_REQUEST_PIPELINE_MAX_DEPTH = 786442,
+ ANDROID_REQUEST_PARTIAL_RESULT_COUNT = 786443,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES = 786444,
+ ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS = 786445,
+ ANDROID_REQUEST_AVAILABLE_RESULT_KEYS = 786446,
+ ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS = 786447,
+ ANDROID_REQUEST_AVAILABLE_SESSION_KEYS = 786448,
+ ANDROID_REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS = 786449,
+ ANDROID_REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION = 786450,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP = 786451,
+ ANDROID_REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE = 786452,
+ ANDROID_SCALER_CROP_REGION = 851968,
+ ANDROID_SCALER_AVAILABLE_FORMATS = 851969,
+ ANDROID_SCALER_AVAILABLE_JPEG_MIN_DURATIONS = 851970,
+ ANDROID_SCALER_AVAILABLE_JPEG_SIZES = 851971,
+ ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM = 851972,
+ ANDROID_SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS = 851973,
+ ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES = 851974,
+ ANDROID_SCALER_AVAILABLE_RAW_MIN_DURATIONS = 851975,
+ ANDROID_SCALER_AVAILABLE_RAW_SIZES = 851976,
+ ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP = 851977,
+ ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS = 851978,
+ ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS = 851979,
+ ANDROID_SCALER_AVAILABLE_STALL_DURATIONS = 851980,
+ ANDROID_SCALER_CROPPING_TYPE = 851981,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS = 851982,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP = 851983,
+ ANDROID_SCALER_AVAILABLE_ROTATE_AND_CROP_MODES = 851984,
+ ANDROID_SCALER_DEFAULT_SECURE_IMAGE_SIZE = 851985,
+ ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS = 851986,
+ ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = 851987,
+ ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION = 851988,
+ ANDROID_SCALER_AVAILABLE_STALL_DURATIONS_MAXIMUM_RESOLUTION = 851989,
+ ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP_MAXIMUM_RESOLUTION = 851990,
+ ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED = 851991,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES = 851992,
+ ANDROID_SENSOR_EXPOSURE_TIME = 917504,
+ ANDROID_SENSOR_FRAME_DURATION = 917505,
+ ANDROID_SENSOR_SENSITIVITY = 917506,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1 = 917507,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT2 = 917508,
+ ANDROID_SENSOR_CALIBRATION_TRANSFORM1 = 917509,
+ ANDROID_SENSOR_CALIBRATION_TRANSFORM2 = 917510,
+ ANDROID_SENSOR_COLOR_TRANSFORM1 = 917511,
+ ANDROID_SENSOR_COLOR_TRANSFORM2 = 917512,
+ ANDROID_SENSOR_FORWARD_MATRIX1 = 917513,
+ ANDROID_SENSOR_FORWARD_MATRIX2 = 917514,
+ ANDROID_SENSOR_BASE_GAIN_FACTOR = 917515,
+ ANDROID_SENSOR_BLACK_LEVEL_PATTERN = 917516,
+ ANDROID_SENSOR_MAX_ANALOG_SENSITIVITY = 917517,
+ ANDROID_SENSOR_ORIENTATION = 917518,
+ ANDROID_SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS = 917519,
+ ANDROID_SENSOR_TIMESTAMP = 917520,
+ ANDROID_SENSOR_TEMPERATURE = 917521,
+ ANDROID_SENSOR_NEUTRAL_COLOR_POINT = 917522,
+ ANDROID_SENSOR_NOISE_PROFILE = 917523,
+ ANDROID_SENSOR_PROFILE_HUE_SAT_MAP = 917524,
+ ANDROID_SENSOR_PROFILE_TONE_CURVE = 917525,
+ ANDROID_SENSOR_GREEN_SPLIT = 917526,
+ ANDROID_SENSOR_TEST_PATTERN_DATA = 917527,
+ ANDROID_SENSOR_TEST_PATTERN_MODE = 917528,
+ ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES = 917529,
+ ANDROID_SENSOR_ROLLING_SHUTTER_SKEW = 917530,
+ ANDROID_SENSOR_OPTICAL_BLACK_REGIONS = 917531,
+ ANDROID_SENSOR_DYNAMIC_BLACK_LEVEL = 917532,
+ ANDROID_SENSOR_DYNAMIC_WHITE_LEVEL = 917533,
+ ANDROID_SENSOR_OPAQUE_RAW_SIZE = 917534,
+ ANDROID_SENSOR_OPAQUE_RAW_SIZE_MAXIMUM_RESOLUTION = 917535,
+ ANDROID_SENSOR_PIXEL_MODE = 917536,
+ ANDROID_SENSOR_RAW_BINNING_FACTOR_USED = 917537,
+ ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE = 983040,
+ ANDROID_SENSOR_INFO_SENSITIVITY_RANGE = 983041,
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT = 983042,
+ ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE = 983043,
+ ANDROID_SENSOR_INFO_MAX_FRAME_DURATION = 983044,
+ ANDROID_SENSOR_INFO_PHYSICAL_SIZE = 983045,
+ ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE = 983046,
+ ANDROID_SENSOR_INFO_WHITE_LEVEL = 983047,
+ ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE = 983048,
+ ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED = 983049,
+ ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE = 983050,
+ ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION = 983051,
+ ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE_MAXIMUM_RESOLUTION = 983052,
+ ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION = 983053,
+ ANDROID_SENSOR_INFO_BINNING_FACTOR = 983054,
+ ANDROID_SHADING_MODE = 1048576,
+ ANDROID_SHADING_STRENGTH = 1048577,
+ ANDROID_SHADING_AVAILABLE_MODES = 1048578,
+ ANDROID_STATISTICS_FACE_DETECT_MODE = 1114112,
+ ANDROID_STATISTICS_HISTOGRAM_MODE = 1114113,
+ ANDROID_STATISTICS_SHARPNESS_MAP_MODE = 1114114,
+ ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE = 1114115,
+ ANDROID_STATISTICS_FACE_IDS = 1114116,
+ ANDROID_STATISTICS_FACE_LANDMARKS = 1114117,
+ ANDROID_STATISTICS_FACE_RECTANGLES = 1114118,
+ ANDROID_STATISTICS_FACE_SCORES = 1114119,
+ ANDROID_STATISTICS_HISTOGRAM = 1114120,
+ ANDROID_STATISTICS_SHARPNESS_MAP = 1114121,
+ ANDROID_STATISTICS_LENS_SHADING_CORRECTION_MAP = 1114122,
+ ANDROID_STATISTICS_LENS_SHADING_MAP = 1114123,
+ ANDROID_STATISTICS_PREDICTED_COLOR_GAINS = 1114124,
+ ANDROID_STATISTICS_PREDICTED_COLOR_TRANSFORM = 1114125,
+ ANDROID_STATISTICS_SCENE_FLICKER = 1114126,
+ ANDROID_STATISTICS_HOT_PIXEL_MAP = 1114127,
+ ANDROID_STATISTICS_LENS_SHADING_MAP_MODE = 1114128,
+ ANDROID_STATISTICS_OIS_DATA_MODE = 1114129,
+ ANDROID_STATISTICS_OIS_TIMESTAMPS = 1114130,
+ ANDROID_STATISTICS_OIS_X_SHIFTS = 1114131,
+ ANDROID_STATISTICS_OIS_Y_SHIFTS = 1114132,
+ ANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES = 1179648,
+ ANDROID_STATISTICS_INFO_HISTOGRAM_BUCKET_COUNT = 1179649,
+ ANDROID_STATISTICS_INFO_MAX_FACE_COUNT = 1179650,
+ ANDROID_STATISTICS_INFO_MAX_HISTOGRAM_COUNT = 1179651,
+ ANDROID_STATISTICS_INFO_MAX_SHARPNESS_MAP_VALUE = 1179652,
+ ANDROID_STATISTICS_INFO_SHARPNESS_MAP_SIZE = 1179653,
+ ANDROID_STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES = 1179654,
+ ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES = 1179655,
+ ANDROID_STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES = 1179656,
+ ANDROID_TONEMAP_CURVE_BLUE = 1245184,
+ ANDROID_TONEMAP_CURVE_GREEN = 1245185,
+ ANDROID_TONEMAP_CURVE_RED = 1245186,
+ ANDROID_TONEMAP_MODE = 1245187,
+ ANDROID_TONEMAP_MAX_CURVE_POINTS = 1245188,
+ ANDROID_TONEMAP_AVAILABLE_TONE_MAP_MODES = 1245189,
+ ANDROID_TONEMAP_GAMMA = 1245190,
+ ANDROID_TONEMAP_PRESET_CURVE = 1245191,
+ ANDROID_LED_TRANSMIT = 1310720,
+ ANDROID_LED_AVAILABLE_LEDS = 1310721,
+ ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL = 1376256,
+ ANDROID_INFO_VERSION = 1376257,
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION = 1376258,
+ ANDROID_INFO_DEVICE_STATE_ORIENTATIONS = 1376259,
+ ANDROID_BLACK_LEVEL_LOCK = 1441792,
+ ANDROID_SYNC_FRAME_NUMBER = 1507328,
+ ANDROID_SYNC_MAX_LATENCY = 1507329,
+ ANDROID_REPROCESS_EFFECTIVE_EXPOSURE_FACTOR = 1572864,
+ ANDROID_REPROCESS_MAX_CAPTURE_STALL = 1572865,
+ ANDROID_DEPTH_MAX_DEPTH_SAMPLES = 1638400,
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS = 1638401,
+ ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS = 1638402,
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS = 1638403,
+ ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE = 1638404,
+ ANDROID_DEPTH_AVAILABLE_RECOMMENDED_DEPTH_STREAM_CONFIGURATIONS = 1638405,
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS = 1638406,
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS = 1638407,
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS = 1638408,
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = 1638409,
+ ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION = 1638410,
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS_MAXIMUM_RESOLUTION = 1638411,
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = 1638412,
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION = 1638413,
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS_MAXIMUM_RESOLUTION = 1638414,
+ ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS = 1703936,
+ ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE = 1703937,
+ ANDROID_LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID = 1703938,
+ ANDROID_DISTORTION_CORRECTION_MODE = 1769472,
+ ANDROID_DISTORTION_CORRECTION_AVAILABLE_MODES = 1769473,
+ ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS = 1835008,
+ ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS = 1835009,
+ ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS = 1835010,
+ ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = 1835011,
+ ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION = 1835012,
+ ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS_MAXIMUM_RESOLUTION = 1835013,
+ ANDROID_HEIC_INFO_SUPPORTED = 1900544,
+ ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT = 1900545,
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl
similarity index 78%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl
index 5395b11..d04ffe3 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ColorCorrectionAberrationMode {
+ ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF = 0,
+ ANDROID_COLOR_CORRECTION_ABERRATION_MODE_FAST = 1,
+ ANDROID_COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ColorCorrectionMode.aidl
similarity index 79%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ColorCorrectionMode.aidl
index 5395b11..219c802 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ColorCorrectionMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ColorCorrectionMode {
+ ANDROID_COLOR_CORRECTION_MODE_TRANSFORM_MATRIX = 0,
+ ANDROID_COLOR_CORRECTION_MODE_FAST = 1,
+ ANDROID_COLOR_CORRECTION_MODE_HIGH_QUALITY = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl
similarity index 77%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl
index 5395b11..84fd718 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlAeAntibandingMode {
+ ANDROID_CONTROL_AE_ANTIBANDING_MODE_OFF = 0,
+ ANDROID_CONTROL_AE_ANTIBANDING_MODE_50HZ = 1,
+ ANDROID_CONTROL_AE_ANTIBANDING_MODE_60HZ = 2,
+ ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO = 3,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeLock.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeLock.aidl
index 5395b11..f825f11 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeLock.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlAeLock {
+ ANDROID_CONTROL_AE_LOCK_OFF = 0,
+ ANDROID_CONTROL_AE_LOCK_ON = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeLockAvailable.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeLockAvailable.aidl
index 5395b11..df7924e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeLockAvailable.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlAeLockAvailable {
+ ANDROID_CONTROL_AE_LOCK_AVAILABLE_FALSE = 0,
+ ANDROID_CONTROL_AE_LOCK_AVAILABLE_TRUE = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeMode.aidl
similarity index 75%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeMode.aidl
index 5395b11..75a3486 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,13 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlAeMode {
+ ANDROID_CONTROL_AE_MODE_OFF = 0,
+ ANDROID_CONTROL_AE_MODE_ON = 1,
+ ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH = 2,
+ ANDROID_CONTROL_AE_MODE_ON_ALWAYS_FLASH = 3,
+ ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE = 4,
+ ANDROID_CONTROL_AE_MODE_ON_EXTERNAL_FLASH = 5,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl
similarity index 79%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl
index 5395b11..4678e01 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlAePrecaptureTrigger {
+ ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_IDLE = 0,
+ ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_START = 1,
+ ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeState.aidl
similarity index 75%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeState.aidl
index 5395b11..3be64ea 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeState.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,13 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlAeState {
+ ANDROID_CONTROL_AE_STATE_INACTIVE = 0,
+ ANDROID_CONTROL_AE_STATE_SEARCHING = 1,
+ ANDROID_CONTROL_AE_STATE_CONVERGED = 2,
+ ANDROID_CONTROL_AE_STATE_LOCKED = 3,
+ ANDROID_CONTROL_AE_STATE_FLASH_REQUIRED = 4,
+ ANDROID_CONTROL_AE_STATE_PRECAPTURE = 5,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfMode.aidl
similarity index 76%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfMode.aidl
index 5395b11..155d3c9 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,13 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlAfMode {
+ ANDROID_CONTROL_AF_MODE_OFF = 0,
+ ANDROID_CONTROL_AF_MODE_AUTO = 1,
+ ANDROID_CONTROL_AF_MODE_MACRO = 2,
+ ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO = 3,
+ ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE = 4,
+ ANDROID_CONTROL_AF_MODE_EDOF = 5,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfSceneChange.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfSceneChange.aidl
index 5395b11..4b31c84 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfSceneChange.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlAfSceneChange {
+ ANDROID_CONTROL_AF_SCENE_CHANGE_NOT_DETECTED = 0,
+ ANDROID_CONTROL_AF_SCENE_CHANGE_DETECTED = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfState.aidl
similarity index 73%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfState.aidl
index 5395b11..4aac8c8 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfState.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,14 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlAfState {
+ ANDROID_CONTROL_AF_STATE_INACTIVE = 0,
+ ANDROID_CONTROL_AF_STATE_PASSIVE_SCAN = 1,
+ ANDROID_CONTROL_AF_STATE_PASSIVE_FOCUSED = 2,
+ ANDROID_CONTROL_AF_STATE_ACTIVE_SCAN = 3,
+ ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED = 4,
+ ANDROID_CONTROL_AF_STATE_NOT_FOCUSED_LOCKED = 5,
+ ANDROID_CONTROL_AF_STATE_PASSIVE_UNFOCUSED = 6,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfTrigger.aidl
similarity index 80%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfTrigger.aidl
index 5395b11..3fbf94b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfTrigger.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlAfTrigger {
+ ANDROID_CONTROL_AF_TRIGGER_IDLE = 0,
+ ANDROID_CONTROL_AF_TRIGGER_START = 1,
+ ANDROID_CONTROL_AF_TRIGGER_CANCEL = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbLock.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbLock.aidl
index 5395b11..0e297a5 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbLock.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlAwbLock {
+ ANDROID_CONTROL_AWB_LOCK_OFF = 0,
+ ANDROID_CONTROL_AWB_LOCK_ON = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl
index 5395b11..d471d19 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlAwbLockAvailable {
+ ANDROID_CONTROL_AWB_LOCK_AVAILABLE_FALSE = 0,
+ ANDROID_CONTROL_AWB_LOCK_AVAILABLE_TRUE = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbMode.aidl
similarity index 71%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbMode.aidl
index 5395b11..a3463f8 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,16 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlAwbMode {
+ ANDROID_CONTROL_AWB_MODE_OFF = 0,
+ ANDROID_CONTROL_AWB_MODE_AUTO = 1,
+ ANDROID_CONTROL_AWB_MODE_INCANDESCENT = 2,
+ ANDROID_CONTROL_AWB_MODE_FLUORESCENT = 3,
+ ANDROID_CONTROL_AWB_MODE_WARM_FLUORESCENT = 4,
+ ANDROID_CONTROL_AWB_MODE_DAYLIGHT = 5,
+ ANDROID_CONTROL_AWB_MODE_CLOUDY_DAYLIGHT = 6,
+ ANDROID_CONTROL_AWB_MODE_TWILIGHT = 7,
+ ANDROID_CONTROL_AWB_MODE_SHADE = 8,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbState.aidl
similarity index 79%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbState.aidl
index 5395b11..f1b0e40 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbState.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlAwbState {
+ ANDROID_CONTROL_AWB_STATE_INACTIVE = 0,
+ ANDROID_CONTROL_AWB_STATE_SEARCHING = 1,
+ ANDROID_CONTROL_AWB_STATE_CONVERGED = 2,
+ ANDROID_CONTROL_AWB_STATE_LOCKED = 3,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlCaptureIntent.aidl
similarity index 71%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlCaptureIntent.aidl
index 5395b11..283bb1b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlCaptureIntent.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,15 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlCaptureIntent {
+ ANDROID_CONTROL_CAPTURE_INTENT_CUSTOM = 0,
+ ANDROID_CONTROL_CAPTURE_INTENT_PREVIEW = 1,
+ ANDROID_CONTROL_CAPTURE_INTENT_STILL_CAPTURE = 2,
+ ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_RECORD = 3,
+ ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4,
+ ANDROID_CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG = 5,
+ ANDROID_CONTROL_CAPTURE_INTENT_MANUAL = 6,
+ ANDROID_CONTROL_CAPTURE_INTENT_MOTION_TRACKING = 7,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlEffectMode.aidl
similarity index 71%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlEffectMode.aidl
index 5395b11..911223d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlEffectMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,16 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlEffectMode {
+ ANDROID_CONTROL_EFFECT_MODE_OFF = 0,
+ ANDROID_CONTROL_EFFECT_MODE_MONO = 1,
+ ANDROID_CONTROL_EFFECT_MODE_NEGATIVE = 2,
+ ANDROID_CONTROL_EFFECT_MODE_SOLARIZE = 3,
+ ANDROID_CONTROL_EFFECT_MODE_SEPIA = 4,
+ ANDROID_CONTROL_EFFECT_MODE_POSTERIZE = 5,
+ ANDROID_CONTROL_EFFECT_MODE_WHITEBOARD = 6,
+ ANDROID_CONTROL_EFFECT_MODE_BLACKBOARD = 7,
+ ANDROID_CONTROL_EFFECT_MODE_AQUA = 8,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlEnableZsl.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlEnableZsl.aidl
index 5395b11..920def7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlEnableZsl.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlEnableZsl {
+ ANDROID_CONTROL_ENABLE_ZSL_FALSE = 0,
+ ANDROID_CONTROL_ENABLE_ZSL_TRUE = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl
similarity index 76%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl
index 5395b11..2655d61 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlExtendedSceneMode {
+ ANDROID_CONTROL_EXTENDED_SCENE_MODE_DISABLED = 0,
+ ANDROID_CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE = 1,
+ ANDROID_CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS = 2,
+ ANDROID_CONTROL_EXTENDED_SCENE_MODE_VENDOR_START = 64,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlMode.aidl
similarity index 77%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlMode.aidl
index 5395b11..f58491e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,12 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlMode {
+ ANDROID_CONTROL_MODE_OFF = 0,
+ ANDROID_CONTROL_MODE_AUTO = 1,
+ ANDROID_CONTROL_MODE_USE_SCENE_MODE = 2,
+ ANDROID_CONTROL_MODE_OFF_KEEP_STATE = 3,
+ ANDROID_CONTROL_MODE_USE_EXTENDED_SCENE_MODE = 4,
}
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlSceneMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlSceneMode.aidl
new file mode 100644
index 0000000..994bbf3
--- /dev/null
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlSceneMode.aidl
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.camera.metadata;
+@Backing(type="int") @VintfStability
+enum ControlSceneMode {
+ ANDROID_CONTROL_SCENE_MODE_DISABLED = 0,
+ ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY = 1,
+ ANDROID_CONTROL_SCENE_MODE_ACTION = 2,
+ ANDROID_CONTROL_SCENE_MODE_PORTRAIT = 3,
+ ANDROID_CONTROL_SCENE_MODE_LANDSCAPE = 4,
+ ANDROID_CONTROL_SCENE_MODE_NIGHT = 5,
+ ANDROID_CONTROL_SCENE_MODE_NIGHT_PORTRAIT = 6,
+ ANDROID_CONTROL_SCENE_MODE_THEATRE = 7,
+ ANDROID_CONTROL_SCENE_MODE_BEACH = 8,
+ ANDROID_CONTROL_SCENE_MODE_SNOW = 9,
+ ANDROID_CONTROL_SCENE_MODE_SUNSET = 10,
+ ANDROID_CONTROL_SCENE_MODE_STEADYPHOTO = 11,
+ ANDROID_CONTROL_SCENE_MODE_FIREWORKS = 12,
+ ANDROID_CONTROL_SCENE_MODE_SPORTS = 13,
+ ANDROID_CONTROL_SCENE_MODE_PARTY = 14,
+ ANDROID_CONTROL_SCENE_MODE_CANDLELIGHT = 15,
+ ANDROID_CONTROL_SCENE_MODE_BARCODE = 16,
+ ANDROID_CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO = 17,
+ ANDROID_CONTROL_SCENE_MODE_HDR = 18,
+ ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY_LOW_LIGHT = 19,
+ ANDROID_CONTROL_SCENE_MODE_DEVICE_CUSTOM_START = 100,
+ ANDROID_CONTROL_SCENE_MODE_DEVICE_CUSTOM_END = 127,
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl
similarity index 78%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl
index 5395b11..b3b24f7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ControlVideoStabilizationMode {
+ ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF = 0,
+ ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_ON = 1,
+ ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DemosaicMode.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DemosaicMode.aidl
index 5395b11..26874a2 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DemosaicMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum DemosaicMode {
+ ANDROID_DEMOSAIC_MODE_FAST = 0,
+ ANDROID_DEMOSAIC_MODE_HIGH_QUALITY = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl
similarity index 79%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl
index 5395b11..6a154ca 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum DepthAvailableDepthStreamConfigurations {
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT = 0,
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_INPUT = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl
similarity index 77%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl
index 5395b11..23d6589 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum DepthAvailableDepthStreamConfigurationsMaximumResolution {
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT = 0,
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl
similarity index 78%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl
index 5395b11..f3ca039 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum DepthAvailableDynamicDepthStreamConfigurations {
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_OUTPUT = 0,
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_INPUT = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl
similarity index 76%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl
index 5395b11..46a4ce6 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution {
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT = 0,
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl
index 5395b11..f5fc218 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum DepthDepthIsExclusive {
+ ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE_FALSE = 0,
+ ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE_TRUE = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DistortionCorrectionMode.aidl
similarity index 79%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DistortionCorrectionMode.aidl
index 5395b11..46327e0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DistortionCorrectionMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum DistortionCorrectionMode {
+ ANDROID_DISTORTION_CORRECTION_MODE_OFF = 0,
+ ANDROID_DISTORTION_CORRECTION_MODE_FAST = 1,
+ ANDROID_DISTORTION_CORRECTION_MODE_HIGH_QUALITY = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/EdgeMode.aidl
similarity index 80%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/EdgeMode.aidl
index 5395b11..4b02e19 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/EdgeMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum EdgeMode {
+ ANDROID_EDGE_MODE_OFF = 0,
+ ANDROID_EDGE_MODE_FAST = 1,
+ ANDROID_EDGE_MODE_HIGH_QUALITY = 2,
+ ANDROID_EDGE_MODE_ZERO_SHUTTER_LAG = 3,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashInfoAvailable.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashInfoAvailable.aidl
index 5395b11..10d07a5 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashInfoAvailable.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum FlashInfoAvailable {
+ ANDROID_FLASH_INFO_AVAILABLE_FALSE = 0,
+ ANDROID_FLASH_INFO_AVAILABLE_TRUE = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashMode.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashMode.aidl
index 5395b11..1ab0560 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum FlashMode {
+ ANDROID_FLASH_MODE_OFF = 0,
+ ANDROID_FLASH_MODE_SINGLE = 1,
+ ANDROID_FLASH_MODE_TORCH = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashState.aidl
similarity index 78%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashState.aidl
index 5395b11..a571e66 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashState.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,12 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum FlashState {
+ ANDROID_FLASH_STATE_UNAVAILABLE = 0,
+ ANDROID_FLASH_STATE_CHARGING = 1,
+ ANDROID_FLASH_STATE_READY = 2,
+ ANDROID_FLASH_STATE_FIRED = 3,
+ ANDROID_FLASH_STATE_PARTIAL = 4,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl
similarity index 79%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl
index 5395b11..d92c2db 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum HeicAvailableHeicStreamConfigurations {
+ ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_OUTPUT = 0,
+ ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_INPUT = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl
similarity index 77%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl
index 5395b11..f02cf58 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum HeicAvailableHeicStreamConfigurationsMaximumResolution {
+ ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT = 0,
+ ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicInfoSupported.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicInfoSupported.aidl
index 5395b11..ae5a8e7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicInfoSupported.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum HeicInfoSupported {
+ ANDROID_HEIC_INFO_SUPPORTED_FALSE = 0,
+ ANDROID_HEIC_INFO_SUPPORTED_TRUE = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HotPixelMode.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HotPixelMode.aidl
index 5395b11..1248c60 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HotPixelMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum HotPixelMode {
+ ANDROID_HOT_PIXEL_MODE_OFF = 0,
+ ANDROID_HOT_PIXEL_MODE_FAST = 1,
+ ANDROID_HOT_PIXEL_MODE_HIGH_QUALITY = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl
index 5395b11..1272f27 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,8 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum InfoSupportedBufferManagementVersion {
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_AIDL_DEVICE = 0,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl
similarity index 75%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl
index 5395b11..8ae39b0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,12 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum InfoSupportedHardwareLevel {
+ ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0,
+ ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1,
+ ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY = 2,
+ ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_3 = 3,
+ ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL = 4,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LedAvailableLeds.aidl
similarity index 83%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LedAvailableLeds.aidl
index 5395b11..da558d2 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LedAvailableLeds.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,8 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum LedAvailableLeds {
+ ANDROID_LED_AVAILABLE_LEDS_TRANSMIT = 0,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LedTransmit.aidl
similarity index 83%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LedTransmit.aidl
index 5395b11..658b3cd 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LedTransmit.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum LedTransmit {
+ ANDROID_LED_TRANSMIT_OFF = 0,
+ ANDROID_LED_TRANSMIT_ON = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensFacing.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensFacing.aidl
index 5395b11..4db987b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensFacing.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum LensFacing {
+ ANDROID_LENS_FACING_FRONT = 0,
+ ANDROID_LENS_FACING_BACK = 1,
+ ANDROID_LENS_FACING_EXTERNAL = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl
similarity index 77%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl
index 5395b11..d83d67f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum LensInfoFocusDistanceCalibration {
+ ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED = 0,
+ ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE = 1,
+ ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl
index 5395b11..f2f039c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum LensOpticalStabilizationMode {
+ ANDROID_LENS_OPTICAL_STABILIZATION_MODE_OFF = 0,
+ ANDROID_LENS_OPTICAL_STABILIZATION_MODE_ON = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensPoseReference.aidl
similarity index 79%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensPoseReference.aidl
index 5395b11..275d77b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensPoseReference.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum LensPoseReference {
+ ANDROID_LENS_POSE_REFERENCE_PRIMARY_CAMERA = 0,
+ ANDROID_LENS_POSE_REFERENCE_GYROSCOPE = 1,
+ ANDROID_LENS_POSE_REFERENCE_UNDEFINED = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensState.aidl
similarity index 83%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensState.aidl
index 5395b11..4b15b0f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensState.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum LensState {
+ ANDROID_LENS_STATE_STATIONARY = 0,
+ ANDROID_LENS_STATE_MOVING = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl
similarity index 79%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl
index 5395b11..224a7fa 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum LogicalMultiCameraSensorSyncType {
+ ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE = 0,
+ ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/NoiseReductionMode.aidl
similarity index 76%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/NoiseReductionMode.aidl
index 5395b11..ed0ebc1 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/NoiseReductionMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,12 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum NoiseReductionMode {
+ ANDROID_NOISE_REDUCTION_MODE_OFF = 0,
+ ANDROID_NOISE_REDUCTION_MODE_FAST = 1,
+ ANDROID_NOISE_REDUCTION_MODE_HIGH_QUALITY = 2,
+ ANDROID_NOISE_REDUCTION_MODE_MINIMAL = 3,
+ ANDROID_NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG = 4,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/QuirksPartialResult.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/QuirksPartialResult.aidl
index 5395b11..d217fe8 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/QuirksPartialResult.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum QuirksPartialResult {
+ ANDROID_QUIRKS_PARTIAL_RESULT_FINAL = 0,
+ ANDROID_QUIRKS_PARTIAL_RESULT_PARTIAL = 1,
}
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl
new file mode 100644
index 0000000..4462936
--- /dev/null
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.camera.metadata;
+@Backing(type="int") @VintfStability
+enum RequestAvailableCapabilities {
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE = 0,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 1,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW = 3,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING = 4,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS = 5,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE = 6,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING = 7,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT = 8,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO = 9,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING = 10,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA = 11,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME = 12,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA = 13,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA = 14,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_OFFLINE_PROCESSING = 15,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR = 16,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_REMOSAIC_REPROCESSING = 17,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT = 18,
+}
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl
new file mode 100644
index 0000000..cec4ac1
--- /dev/null
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.camera.metadata;
+@Backing(type="int") @VintfStability
+enum RequestAvailableDynamicRangeProfilesMap {
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD = 1,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10 = 2,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10 = 4,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS = 8,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF = 16,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO = 32,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM = 64,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO = 128,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF = 256,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO = 512,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM = 1024,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO = 2048,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_MAX = 4096,
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestMetadataMode.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestMetadataMode.aidl
index 5395b11..90fba00 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestMetadataMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum RequestMetadataMode {
+ ANDROID_REQUEST_METADATA_MODE_NONE = 0,
+ ANDROID_REQUEST_METADATA_MODE_FULL = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestType.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestType.aidl
index 5395b11..4f38cfb 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestType.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum RequestType {
+ ANDROID_REQUEST_TYPE_CAPTURE = 0,
+ ANDROID_REQUEST_TYPE_REPROCESS = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableFormats.aidl
similarity index 67%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableFormats.aidl
index 5395b11..41fd2c2 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableFormats.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,17 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ScalerAvailableFormats {
+ ANDROID_SCALER_AVAILABLE_FORMATS_RAW16 = 32,
+ ANDROID_SCALER_AVAILABLE_FORMATS_RAW_OPAQUE = 36,
+ ANDROID_SCALER_AVAILABLE_FORMATS_YV12 = 842094169,
+ ANDROID_SCALER_AVAILABLE_FORMATS_YCrCb_420_SP = 17,
+ ANDROID_SCALER_AVAILABLE_FORMATS_IMPLEMENTATION_DEFINED = 34,
+ ANDROID_SCALER_AVAILABLE_FORMATS_YCbCr_420_888 = 35,
+ ANDROID_SCALER_AVAILABLE_FORMATS_BLOB = 33,
+ ANDROID_SCALER_AVAILABLE_FORMATS_RAW10 = 37,
+ ANDROID_SCALER_AVAILABLE_FORMATS_RAW12 = 38,
+ ANDROID_SCALER_AVAILABLE_FORMATS_Y8 = 538982489,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl
similarity index 62%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl
index 5395b11..85daa85 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,16 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ScalerAvailableRecommendedStreamConfigurations {
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PREVIEW = 0,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RECORD = 1,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VIDEO_SNAPSHOT = 2,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_SNAPSHOT = 3,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_ZSL = 4,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RAW = 5,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_LOW_LATENCY_SNAPSHOT = 6,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_10BIT_OUTPUT = 8,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VENDOR_START = 24,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl
similarity index 79%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl
index 5395b11..1515ad5 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ScalerAvailableStreamConfigurations {
+ ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT = 0,
+ ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl
similarity index 77%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl
index 5395b11..b9c3374 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ScalerAvailableStreamConfigurationsMaximumResolution {
+ ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT = 0,
+ ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl
similarity index 69%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl
index 5395b11..0ed55a3 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,14 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ScalerAvailableStreamUseCases {
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 1,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE = 2,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD = 3,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL = 4,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL = 5,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START = 65536,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerCroppingType.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerCroppingType.aidl
index 5395b11..0487196 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerCroppingType.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ScalerCroppingType {
+ ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY = 0,
+ ANDROID_SCALER_CROPPING_TYPE_FREEFORM = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl
similarity index 79%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl
index 5395b11..711243f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ScalerMultiResolutionStreamSupported {
+ ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED_FALSE = 0,
+ ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED_TRUE = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl
similarity index 77%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl
index 5395b11..50bc097 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ScalerPhysicalCameraMultiResolutionStreamConfigurations {
+ ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS_OUTPUT = 0,
+ ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS_INPUT = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl
similarity index 77%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl
index 5395b11..3b9c5b8 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,12 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ScalerRotateAndCrop {
+ ANDROID_SCALER_ROTATE_AND_CROP_NONE = 0,
+ ANDROID_SCALER_ROTATE_AND_CROP_90 = 1,
+ ANDROID_SCALER_ROTATE_AND_CROP_180 = 2,
+ ANDROID_SCALER_ROTATE_AND_CROP_270 = 3,
+ ANDROID_SCALER_ROTATE_AND_CROP_AUTO = 4,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl
similarity index 70%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl
index 5395b11..3400233 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,14 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum SensorInfoColorFilterArrangement {
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB = 0,
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG = 1,
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG = 2,
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR = 3,
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB = 4,
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO = 5,
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR = 6,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl
similarity index 80%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl
index 5395b11..c8faaee 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum SensorInfoLensShadingApplied {
+ ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED_FALSE = 0,
+ ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED_TRUE = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl
index 5395b11..2a4b3dd 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum SensorInfoTimestampSource {
+ ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN = 0,
+ ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorPixelMode.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorPixelMode.aidl
index 5395b11..e021434 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorPixelMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum SensorPixelMode {
+ ANDROID_SENSOR_PIXEL_MODE_DEFAULT = 0,
+ ANDROID_SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl
index 5395b11..a1f0c5f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum SensorRawBinningFactorUsed {
+ ANDROID_SENSOR_RAW_BINNING_FACTOR_USED_TRUE = 0,
+ ANDROID_SENSOR_RAW_BINNING_FACTOR_USED_FALSE = 1,
}
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl
new file mode 100644
index 0000000..cd22d2e
--- /dev/null
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.camera.metadata;
+@Backing(type="int") @VintfStability
+enum SensorReferenceIlluminant1 {
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT = 1,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT = 2,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN = 3,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FLASH = 4,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER = 9,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER = 10,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_SHADE = 11,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT = 12,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT = 13,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT = 14,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT = 15,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A = 17,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B = 18,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C = 19,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D55 = 20,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D65 = 21,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D75 = 22,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D50 = 23,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN = 24,
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorTestPatternMode.aidl
similarity index 72%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorTestPatternMode.aidl
index 5395b11..d013bf4 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorTestPatternMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,14 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum SensorTestPatternMode {
+ ANDROID_SENSOR_TEST_PATTERN_MODE_OFF = 0,
+ ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR = 1,
+ ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS = 2,
+ ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY = 3,
+ ANDROID_SENSOR_TEST_PATTERN_MODE_PN9 = 4,
+ ANDROID_SENSOR_TEST_PATTERN_MODE_CUSTOM1 = 256,
+ ANDROID_SENSOR_TEST_PATTERN_MODE_BLACK = 257,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ShadingMode.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ShadingMode.aidl
index 5395b11..a2d2a32 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ShadingMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum ShadingMode {
+ ANDROID_SHADING_MODE_OFF = 0,
+ ANDROID_SHADING_MODE_FAST = 1,
+ ANDROID_SHADING_MODE_HIGH_QUALITY = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl
similarity index 79%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl
index 5395b11..1c65f99 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum StatisticsFaceDetectMode {
+ ANDROID_STATISTICS_FACE_DETECT_MODE_OFF = 0,
+ ANDROID_STATISTICS_FACE_DETECT_MODE_SIMPLE = 1,
+ ANDROID_STATISTICS_FACE_DETECT_MODE_FULL = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsHistogramMode.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsHistogramMode.aidl
index 5395b11..39a013e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsHistogramMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum StatisticsHistogramMode {
+ ANDROID_STATISTICS_HISTOGRAM_MODE_OFF = 0,
+ ANDROID_STATISTICS_HISTOGRAM_MODE_ON = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl
index 5395b11..3a8c6c2 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum StatisticsHotPixelMapMode {
+ ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE_OFF = 0,
+ ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE_ON = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl
similarity index 80%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl
index 5395b11..cc280ca 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum StatisticsLensShadingMapMode {
+ ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF = 0,
+ ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_ON = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsOisDataMode.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsOisDataMode.aidl
index 5395b11..6607037 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsOisDataMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum StatisticsOisDataMode {
+ ANDROID_STATISTICS_OIS_DATA_MODE_OFF = 0,
+ ANDROID_STATISTICS_OIS_DATA_MODE_ON = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl
similarity index 79%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl
index 5395b11..bc286c3 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum StatisticsSceneFlicker {
+ ANDROID_STATISTICS_SCENE_FLICKER_NONE = 0,
+ ANDROID_STATISTICS_SCENE_FLICKER_50HZ = 1,
+ ANDROID_STATISTICS_SCENE_FLICKER_60HZ = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl
similarity index 81%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl
index 5395b11..774a43a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum StatisticsSharpnessMapMode {
+ ANDROID_STATISTICS_SHARPNESS_MAP_MODE_OFF = 0,
+ ANDROID_STATISTICS_SHARPNESS_MAP_MODE_ON = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SyncFrameNumber.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SyncFrameNumber.aidl
index 5395b11..12ccbb9 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SyncFrameNumber.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum SyncFrameNumber {
+ ANDROID_SYNC_FRAME_NUMBER_CONVERGING = -1,
+ ANDROID_SYNC_FRAME_NUMBER_UNKNOWN = -2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SyncMaxLatency.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SyncMaxLatency.aidl
index 5395b11..e0116e7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SyncMaxLatency.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum SyncMaxLatency {
+ ANDROID_SYNC_MAX_LATENCY_PER_FRAME_CONTROL = 0,
+ ANDROID_SYNC_MAX_LATENCY_UNKNOWN = -1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/TonemapMode.aidl
similarity index 78%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/TonemapMode.aidl
index 5395b11..728b298 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/TonemapMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,12 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum TonemapMode {
+ ANDROID_TONEMAP_MODE_CONTRAST_CURVE = 0,
+ ANDROID_TONEMAP_MODE_FAST = 1,
+ ANDROID_TONEMAP_MODE_HIGH_QUALITY = 2,
+ ANDROID_TONEMAP_MODE_GAMMA_VALUE = 3,
+ ANDROID_TONEMAP_MODE_PRESET_CURVE = 4,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/TonemapPresetCurve.aidl
similarity index 82%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/TonemapPresetCurve.aidl
index 5395b11..fc2e39b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/TonemapPresetCurve.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -12,6 +12,10 @@
* 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
@@ -31,13 +35,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.camera.metadata;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum TonemapPresetCurve {
+ ANDROID_TONEMAP_PRESET_CURVE_SRGB = 0,
+ ANDROID_TONEMAP_PRESET_CURVE_REC709 = 1,
}
diff --git a/audio/7.1/IStreamIn.hal b/camera/metadata/aidl/android/hardware/camera/metadata/BlackLevelLock.aidl
similarity index 60%
copy from audio/7.1/IStreamIn.hal
copy to camera/metadata/aidl/android/hardware/camera/metadata/BlackLevelLock.aidl
index abebe6a..4746cf3 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/BlackLevelLock.aidl
@@ -14,9 +14,21 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
-import @7.0::IStreamIn;
+package android.hardware.camera.metadata;
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * android.blackLevel.lock enumeration values
+ * @see ANDROID_BLACK_LEVEL_LOCK
+ */
+@VintfStability
+@Backing(type="int")
+enum BlackLevelLock {
+ ANDROID_BLACK_LEVEL_LOCK_OFF,
+ ANDROID_BLACK_LEVEL_LOCK_ON,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl
new file mode 100644
index 0000000..cc3d3b3
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * Top level hierarchy definitions for camera metadata. *_INFO sections are for
+ * the static metadata that can be retrieved without opening the camera device.
+ */
+@VintfStability
+@Backing(type="int")
+enum CameraMetadataSection {
+ ANDROID_COLOR_CORRECTION,
+ ANDROID_CONTROL,
+ ANDROID_DEMOSAIC,
+ ANDROID_EDGE,
+ ANDROID_FLASH,
+ ANDROID_FLASH_INFO,
+ ANDROID_HOT_PIXEL,
+ ANDROID_JPEG,
+ ANDROID_LENS,
+ ANDROID_LENS_INFO,
+ ANDROID_NOISE_REDUCTION,
+ ANDROID_QUIRKS,
+ ANDROID_REQUEST,
+ ANDROID_SCALER,
+ ANDROID_SENSOR,
+ ANDROID_SENSOR_INFO,
+ ANDROID_SHADING,
+ ANDROID_STATISTICS,
+ ANDROID_STATISTICS_INFO,
+ ANDROID_TONEMAP,
+ ANDROID_LED,
+ ANDROID_INFO,
+ ANDROID_BLACK_LEVEL,
+ ANDROID_SYNC,
+ ANDROID_REPROCESS,
+ ANDROID_DEPTH,
+ ANDROID_LOGICAL_MULTI_CAMERA,
+ ANDROID_DISTORTION_CORRECTION,
+ ANDROID_HEIC,
+ ANDROID_HEIC_INFO,
+ VENDOR_SECTION = 0x8000,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
new file mode 100644
index 0000000..d5cd0b4
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+import android.hardware.camera.metadata.CameraMetadataSection;
+
+/**
+ * Hierarchy positions in enum space. All vendor extension sections must be
+ * defined with tag >= VENDOR_SECTION_START
+ */
+@VintfStability
+@Backing(type="int")
+enum CameraMetadataSectionStart {
+ ANDROID_COLOR_CORRECTION_START = CameraMetadataSection.ANDROID_COLOR_CORRECTION << 16,
+ ANDROID_CONTROL_START = CameraMetadataSection.ANDROID_CONTROL << 16,
+ ANDROID_DEMOSAIC_START = CameraMetadataSection.ANDROID_DEMOSAIC << 16,
+ ANDROID_EDGE_START = CameraMetadataSection.ANDROID_EDGE << 16,
+ ANDROID_FLASH_START = CameraMetadataSection.ANDROID_FLASH << 16,
+ ANDROID_FLASH_INFO_START = CameraMetadataSection.ANDROID_FLASH_INFO << 16,
+ ANDROID_HOT_PIXEL_START = CameraMetadataSection.ANDROID_HOT_PIXEL << 16,
+ ANDROID_JPEG_START = CameraMetadataSection.ANDROID_JPEG << 16,
+ ANDROID_LENS_START = CameraMetadataSection.ANDROID_LENS << 16,
+ ANDROID_LENS_INFO_START = CameraMetadataSection.ANDROID_LENS_INFO << 16,
+ ANDROID_NOISE_REDUCTION_START = CameraMetadataSection.ANDROID_NOISE_REDUCTION << 16,
+ ANDROID_QUIRKS_START = CameraMetadataSection.ANDROID_QUIRKS << 16,
+ ANDROID_REQUEST_START = CameraMetadataSection.ANDROID_REQUEST << 16,
+ ANDROID_SCALER_START = CameraMetadataSection.ANDROID_SCALER << 16,
+ ANDROID_SENSOR_START = CameraMetadataSection.ANDROID_SENSOR << 16,
+ ANDROID_SENSOR_INFO_START = CameraMetadataSection.ANDROID_SENSOR_INFO << 16,
+ ANDROID_SHADING_START = CameraMetadataSection.ANDROID_SHADING << 16,
+ ANDROID_STATISTICS_START = CameraMetadataSection.ANDROID_STATISTICS << 16,
+ ANDROID_STATISTICS_INFO_START = CameraMetadataSection.ANDROID_STATISTICS_INFO << 16,
+ ANDROID_TONEMAP_START = CameraMetadataSection.ANDROID_TONEMAP << 16,
+ ANDROID_LED_START = CameraMetadataSection.ANDROID_LED << 16,
+ ANDROID_INFO_START = CameraMetadataSection.ANDROID_INFO << 16,
+ ANDROID_BLACK_LEVEL_START = CameraMetadataSection.ANDROID_BLACK_LEVEL << 16,
+ ANDROID_SYNC_START = CameraMetadataSection.ANDROID_SYNC << 16,
+ ANDROID_REPROCESS_START = CameraMetadataSection.ANDROID_REPROCESS << 16,
+ ANDROID_DEPTH_START = CameraMetadataSection.ANDROID_DEPTH << 16,
+ VENDOR_SECTION_START = CameraMetadataSection.VENDOR_SECTION << 16,
+ ANDROID_LOGICAL_MULTI_CAMERA_START = CameraMetadataSection.ANDROID_LOGICAL_MULTI_CAMERA << 16,
+ ANDROID_DISTORTION_CORRECTION_START = CameraMetadataSection.ANDROID_DISTORTION_CORRECTION << 16,
+ ANDROID_HEIC_START = CameraMetadataSection.ANDROID_HEIC << 16,
+ ANDROID_HEIC_INFO_START = CameraMetadataSection.ANDROID_HEIC_INFO << 16,
+ VENDOR_SECTION_START = CameraMetadataSection.VENDOR_SECTION << 16,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl
new file mode 100644
index 0000000..1f388d9
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl
@@ -0,0 +1,2235 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+import android.hardware.camera.metadata.CameraMetadataSectionStart;
+
+/**
+ * Main enumeration for defining camera metadata tags added in this revision
+ *
+ * <p>Partial documentation is included for each tag; for complete documentation, reference
+ * '/system/media/camera/docs/docs.html' in the corresponding Android source tree.</p>
+ */
+@VintfStability
+@Backing(type="int")
+enum CameraMetadataTag {
+ /**
+ * android.colorCorrection.mode [dynamic, enum, public]
+ *
+ * <p>The mode control selects how the image data is converted from the
+ * sensor's native color into linear sRGB color.</p>
+ */
+ ANDROID_COLOR_CORRECTION_MODE = CameraMetadataSectionStart.ANDROID_COLOR_CORRECTION_START,
+ /**
+ * android.colorCorrection.transform [dynamic, rational[], public]
+ *
+ * <p>A color transform matrix to use to transform
+ * from sensor RGB color space to output linear sRGB color space.</p>
+ */
+ ANDROID_COLOR_CORRECTION_TRANSFORM,
+ /**
+ * android.colorCorrection.gains [dynamic, float[], public]
+ *
+ * <p>Gains applying to Bayer raw color channels for
+ * white-balance.</p>
+ */
+ ANDROID_COLOR_CORRECTION_GAINS,
+ /**
+ * android.colorCorrection.aberrationMode [dynamic, enum, public]
+ *
+ * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
+ */
+ ANDROID_COLOR_CORRECTION_ABERRATION_MODE,
+ /**
+ * android.colorCorrection.availableAberrationModes [static, byte[], public]
+ *
+ * <p>List of aberration correction modes for ANDROID_COLOR_CORRECTION_ABERRATION_MODE that are
+ * supported by this camera device.</p>
+ *
+ * @see ANDROID_COLOR_CORRECTION_ABERRATION_MODE
+ */
+ ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES,
+ /**
+ * android.control.aeAntibandingMode [dynamic, enum, public]
+ *
+ * <p>The desired setting for the camera device's auto-exposure
+ * algorithm's antibanding compensation.</p>
+ */
+ ANDROID_CONTROL_AE_ANTIBANDING_MODE = CameraMetadataSectionStart.ANDROID_CONTROL_START,
+ /**
+ * android.control.aeExposureCompensation [dynamic, int32, public]
+ *
+ * <p>Adjustment to auto-exposure (AE) target image
+ * brightness.</p>
+ */
+ ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION,
+ /**
+ * android.control.aeLock [dynamic, enum, public]
+ *
+ * <p>Whether auto-exposure (AE) is currently locked to its latest
+ * calculated values.</p>
+ */
+ ANDROID_CONTROL_AE_LOCK,
+ /**
+ * android.control.aeMode [dynamic, enum, public]
+ *
+ * <p>The desired mode for the camera device's
+ * auto-exposure routine.</p>
+ */
+ ANDROID_CONTROL_AE_MODE,
+ /**
+ * android.control.aeRegions [dynamic, int32[], public]
+ *
+ * <p>List of metering areas to use for auto-exposure adjustment.</p>
+ */
+ ANDROID_CONTROL_AE_REGIONS,
+ /**
+ * android.control.aeTargetFpsRange [dynamic, int32[], public]
+ *
+ * <p>Range over which the auto-exposure routine can
+ * adjust the capture frame rate to maintain good
+ * exposure.</p>
+ */
+ ANDROID_CONTROL_AE_TARGET_FPS_RANGE,
+ /**
+ * android.control.aePrecaptureTrigger [dynamic, enum, public]
+ *
+ * <p>Whether the camera device will trigger a precapture
+ * metering sequence when it processes this request.</p>
+ */
+ ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER,
+ /**
+ * android.control.afMode [dynamic, enum, public]
+ *
+ * <p>Whether auto-focus (AF) is currently enabled, and what
+ * mode it is set to.</p>
+ */
+ ANDROID_CONTROL_AF_MODE,
+ /**
+ * android.control.afRegions [dynamic, int32[], public]
+ *
+ * <p>List of metering areas to use for auto-focus.</p>
+ */
+ ANDROID_CONTROL_AF_REGIONS,
+ /**
+ * android.control.afTrigger [dynamic, enum, public]
+ *
+ * <p>Whether the camera device will trigger autofocus for this request.</p>
+ */
+ ANDROID_CONTROL_AF_TRIGGER,
+ /**
+ * android.control.awbLock [dynamic, enum, public]
+ *
+ * <p>Whether auto-white balance (AWB) is currently locked to its
+ * latest calculated values.</p>
+ */
+ ANDROID_CONTROL_AWB_LOCK,
+ /**
+ * android.control.awbMode [dynamic, enum, public]
+ *
+ * <p>Whether auto-white balance (AWB) is currently setting the color
+ * transform fields, and what its illumination target
+ * is.</p>
+ */
+ ANDROID_CONTROL_AWB_MODE,
+ /**
+ * android.control.awbRegions [dynamic, int32[], public]
+ *
+ * <p>List of metering areas to use for auto-white-balance illuminant
+ * estimation.</p>
+ */
+ ANDROID_CONTROL_AWB_REGIONS,
+ /**
+ * android.control.captureIntent [dynamic, enum, public]
+ *
+ * <p>Information to the camera device 3A (auto-exposure,
+ * auto-focus, auto-white balance) routines about the purpose
+ * of this capture, to help the camera device to decide optimal 3A
+ * strategy.</p>
+ */
+ ANDROID_CONTROL_CAPTURE_INTENT,
+ /**
+ * android.control.effectMode [dynamic, enum, public]
+ *
+ * <p>A special color effect to apply.</p>
+ */
+ ANDROID_CONTROL_EFFECT_MODE,
+ /**
+ * android.control.mode [dynamic, enum, public]
+ *
+ * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
+ * routines.</p>
+ */
+ ANDROID_CONTROL_MODE,
+ /**
+ * android.control.sceneMode [dynamic, enum, public]
+ *
+ * <p>Control for which scene mode is currently active.</p>
+ */
+ ANDROID_CONTROL_SCENE_MODE,
+ /**
+ * android.control.videoStabilizationMode [dynamic, enum, public]
+ *
+ * <p>Whether video stabilization is
+ * active.</p>
+ */
+ ANDROID_CONTROL_VIDEO_STABILIZATION_MODE,
+ /**
+ * android.control.aeAvailableAntibandingModes [static, byte[], public]
+ *
+ * <p>List of auto-exposure antibanding modes for ANDROID_CONTROL_AE_ANTIBANDING_MODE that are
+ * supported by this camera device.</p>
+ *
+ * @see ANDROID_CONTROL_AE_ANTIBANDING_MODE
+ */
+ ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES,
+ /**
+ * android.control.aeAvailableModes [static, byte[], public]
+ *
+ * <p>List of auto-exposure modes for ANDROID_CONTROL_AE_MODE that are supported by this camera
+ * device.</p>
+ *
+ * @see ANDROID_CONTROL_AE_MODE
+ */
+ ANDROID_CONTROL_AE_AVAILABLE_MODES,
+ /**
+ * android.control.aeAvailableTargetFpsRanges [static, int32[], public]
+ *
+ * <p>List of frame rate ranges for ANDROID_CONTROL_AE_TARGET_FPS_RANGE supported by
+ * this camera device.</p>
+ *
+ * @see ANDROID_CONTROL_AE_TARGET_FPS_RANGE
+ */
+ ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,
+ /**
+ * android.control.aeCompensationRange [static, int32[], public]
+ *
+ * <p>Maximum and minimum exposure compensation values for
+ * ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION, in counts of ANDROID_CONTROL_AE_COMPENSATION_STEP,
+ * that are supported by this camera device.</p>
+ *
+ * @see ANDROID_CONTROL_AE_COMPENSATION_STEP
+ * @see ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION
+ */
+ ANDROID_CONTROL_AE_COMPENSATION_RANGE,
+ /**
+ * android.control.aeCompensationStep [static, rational, public]
+ *
+ * <p>Smallest step by which the exposure compensation
+ * can be changed.</p>
+ */
+ ANDROID_CONTROL_AE_COMPENSATION_STEP,
+ /**
+ * android.control.afAvailableModes [static, byte[], public]
+ *
+ * <p>List of auto-focus (AF) modes for ANDROID_CONTROL_AF_MODE that are
+ * supported by this camera device.</p>
+ *
+ * @see ANDROID_CONTROL_AF_MODE
+ */
+ ANDROID_CONTROL_AF_AVAILABLE_MODES,
+ /**
+ * android.control.availableEffects [static, byte[], public]
+ *
+ * <p>List of color effects for ANDROID_CONTROL_EFFECT_MODE that are supported by this camera
+ * device.</p>
+ *
+ * @see ANDROID_CONTROL_EFFECT_MODE
+ */
+ ANDROID_CONTROL_AVAILABLE_EFFECTS,
+ /**
+ * android.control.availableSceneModes [static, byte[], public]
+ *
+ * <p>List of scene modes for ANDROID_CONTROL_SCENE_MODE that are supported by this camera
+ * device.</p>
+ *
+ * @see ANDROID_CONTROL_SCENE_MODE
+ */
+ ANDROID_CONTROL_AVAILABLE_SCENE_MODES,
+ /**
+ * android.control.availableVideoStabilizationModes [static, byte[], public]
+ *
+ * <p>List of video stabilization modes for ANDROID_CONTROL_VIDEO_STABILIZATION_MODE
+ * that are supported by this camera device.</p>
+ *
+ * @see ANDROID_CONTROL_VIDEO_STABILIZATION_MODE
+ */
+ ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES,
+ /**
+ * android.control.awbAvailableModes [static, byte[], public]
+ *
+ * <p>List of auto-white-balance modes for ANDROID_CONTROL_AWB_MODE that are supported by this
+ * camera device.</p>
+ *
+ * @see ANDROID_CONTROL_AWB_MODE
+ */
+ ANDROID_CONTROL_AWB_AVAILABLE_MODES,
+ /**
+ * android.control.maxRegions [static, int32[], ndk_public]
+ *
+ * <p>List of the maximum number of regions that can be used for metering in
+ * auto-exposure (AE), auto-white balance (AWB), and auto-focus (AF);
+ * this corresponds to the maximum number of elements in
+ * ANDROID_CONTROL_AE_REGIONS, ANDROID_CONTROL_AWB_REGIONS,
+ * and ANDROID_CONTROL_AF_REGIONS.</p>
+ *
+ * @see ANDROID_CONTROL_AE_REGIONS
+ * @see ANDROID_CONTROL_AF_REGIONS
+ * @see ANDROID_CONTROL_AWB_REGIONS
+ */
+ ANDROID_CONTROL_MAX_REGIONS,
+ /**
+ * android.control.sceneModeOverrides [static, byte[], system]
+ *
+ * <p>Ordered list of auto-exposure, auto-white balance, and auto-focus
+ * settings to use with each available scene mode.</p>
+ */
+ ANDROID_CONTROL_SCENE_MODE_OVERRIDES,
+ /**
+ * android.control.aePrecaptureId [dynamic, int32, system]
+ *
+ * <p>The ID sent with the latest
+ * CAMERA2_TRIGGER_PRECAPTURE_METERING call</p>
+ */
+ ANDROID_CONTROL_AE_PRECAPTURE_ID,
+ /**
+ * android.control.aeState [dynamic, enum, public]
+ *
+ * <p>Current state of the auto-exposure (AE) algorithm.</p>
+ */
+ ANDROID_CONTROL_AE_STATE,
+ /**
+ * android.control.afState [dynamic, enum, public]
+ *
+ * <p>Current state of auto-focus (AF) algorithm.</p>
+ */
+ ANDROID_CONTROL_AF_STATE,
+ /**
+ * android.control.afTriggerId [dynamic, int32, system]
+ *
+ * <p>The ID sent with the latest
+ * CAMERA2_TRIGGER_AUTOFOCUS call</p>
+ */
+ ANDROID_CONTROL_AF_TRIGGER_ID,
+ /**
+ * android.control.awbState [dynamic, enum, public]
+ *
+ * <p>Current state of auto-white balance (AWB) algorithm.</p>
+ */
+ ANDROID_CONTROL_AWB_STATE,
+ /**
+ * android.control.availableHighSpeedVideoConfigurations [static, int32[], hidden]
+ *
+ * <p>List of available high speed video size, fps range and max batch size configurations
+ * supported by the camera device, in the format of (width, height, fps_min, fps_max, batch_size_max).</p>
+ */
+ ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS,
+ /**
+ * android.control.aeLockAvailable [static, enum, public]
+ *
+ * <p>Whether the camera device supports ANDROID_CONTROL_AE_LOCK</p>
+ *
+ * @see ANDROID_CONTROL_AE_LOCK
+ */
+ ANDROID_CONTROL_AE_LOCK_AVAILABLE,
+ /**
+ * android.control.awbLockAvailable [static, enum, public]
+ *
+ * <p>Whether the camera device supports ANDROID_CONTROL_AWB_LOCK</p>
+ *
+ * @see ANDROID_CONTROL_AWB_LOCK
+ */
+ ANDROID_CONTROL_AWB_LOCK_AVAILABLE,
+ /**
+ * android.control.availableModes [static, byte[], public]
+ *
+ * <p>List of control modes for ANDROID_CONTROL_MODE that are supported by this camera
+ * device.</p>
+ *
+ * @see ANDROID_CONTROL_MODE
+ */
+ ANDROID_CONTROL_AVAILABLE_MODES,
+ /**
+ * android.control.postRawSensitivityBoostRange [static, int32[], public]
+ *
+ * <p>Range of boosts for ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST supported
+ * by this camera device.</p>
+ *
+ * @see ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST
+ */
+ ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE,
+ /**
+ * android.control.postRawSensitivityBoost [dynamic, int32, public]
+ *
+ * <p>The amount of additional sensitivity boost applied to output images
+ * after RAW sensor data is captured.</p>
+ */
+ ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST,
+ /**
+ * android.control.enableZsl [dynamic, enum, public]
+ *
+ * <p>Allow camera device to enable zero-shutter-lag mode for requests with
+ * ANDROID_CONTROL_CAPTURE_INTENT == STILL_CAPTURE.</p>
+ *
+ * @see ANDROID_CONTROL_CAPTURE_INTENT
+ */
+ ANDROID_CONTROL_ENABLE_ZSL,
+ /**
+ * android.control.afSceneChange [dynamic, enum, public]
+ *
+ * <p>Whether a significant scene change is detected within the currently-set AF
+ * region(s).</p>
+ */
+ ANDROID_CONTROL_AF_SCENE_CHANGE,
+ /**
+ * android.control.availableExtendedSceneModeMaxSizes [static, int32[], ndk_public]
+ *
+ * <p>The list of extended scene modes for ANDROID_CONTROL_EXTENDED_SCENE_MODE that are supported
+ * by this camera device, and each extended scene mode's maximum streaming (non-stall) size
+ * with effect.</p>
+ *
+ * @see ANDROID_CONTROL_EXTENDED_SCENE_MODE
+ */
+ ANDROID_CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_MAX_SIZES,
+ /**
+ * android.control.availableExtendedSceneModeZoomRatioRanges [static, float[], ndk_public]
+ *
+ * <p>The ranges of supported zoom ratio for non-DISABLED ANDROID_CONTROL_EXTENDED_SCENE_MODE.</p>
+ *
+ * @see ANDROID_CONTROL_EXTENDED_SCENE_MODE
+ */
+ ANDROID_CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_ZOOM_RATIO_RANGES,
+ /**
+ * android.control.extendedSceneMode [dynamic, enum, public]
+ *
+ * <p>Whether extended scene mode is enabled for a particular capture request.</p>
+ */
+ ANDROID_CONTROL_EXTENDED_SCENE_MODE,
+ /**
+ * android.control.zoomRatioRange [static, float[], public]
+ *
+ * <p>Minimum and maximum zoom ratios supported by this camera device.</p>
+ */
+ ANDROID_CONTROL_ZOOM_RATIO_RANGE,
+ /**
+ * android.control.zoomRatio [dynamic, float, public]
+ *
+ * <p>The desired zoom ratio</p>
+ */
+ ANDROID_CONTROL_ZOOM_RATIO,
+ /**
+ * android.control.availableHighSpeedVideoConfigurationsMaximumResolution [static, int32[], hidden]
+ *
+ * <p>List of available high speed video size, fps range and max batch size configurations
+ * supported by the camera device, in the format of
+ * (width, height, fps_min, fps_max, batch_size_max),
+ * when ANDROID_SENSOR_PIXEL_MODE is set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS_MAXIMUM_RESOLUTION,
+ /**
+ * android.demosaic.mode [controls, enum, system]
+ *
+ * <p>Controls the quality of the demosaicing
+ * processing.</p>
+ */
+ ANDROID_DEMOSAIC_MODE = CameraMetadataSectionStart.ANDROID_DEMOSAIC_START,
+ /**
+ * android.edge.mode [dynamic, enum, public]
+ *
+ * <p>Operation mode for edge
+ * enhancement.</p>
+ */
+ ANDROID_EDGE_MODE = CameraMetadataSectionStart.ANDROID_EDGE_START,
+ /**
+ * android.edge.strength [controls, byte, system]
+ *
+ * <p>Control the amount of edge enhancement
+ * applied to the images</p>
+ */
+ ANDROID_EDGE_STRENGTH,
+ /**
+ * android.edge.availableEdgeModes [static, byte[], public]
+ *
+ * <p>List of edge enhancement modes for ANDROID_EDGE_MODE that are supported by this camera
+ * device.</p>
+ *
+ * @see ANDROID_EDGE_MODE
+ */
+ ANDROID_EDGE_AVAILABLE_EDGE_MODES,
+ /**
+ * android.flash.firingPower [dynamic, byte, system]
+ *
+ * <p>Power for flash firing/torch</p>
+ */
+ ANDROID_FLASH_FIRING_POWER = CameraMetadataSectionStart.ANDROID_FLASH_START,
+ /**
+ * android.flash.firingTime [dynamic, int64, system]
+ *
+ * <p>Firing time of flash relative to start of
+ * exposure</p>
+ */
+ ANDROID_FLASH_FIRING_TIME,
+ /**
+ * android.flash.mode [dynamic, enum, public]
+ *
+ * <p>The desired mode for for the camera device's flash control.</p>
+ */
+ ANDROID_FLASH_MODE,
+ /**
+ * android.flash.colorTemperature [static, byte, system]
+ *
+ * <p>The x,y whitepoint of the
+ * flash</p>
+ */
+ ANDROID_FLASH_COLOR_TEMPERATURE,
+ /**
+ * android.flash.maxEnergy [static, byte, system]
+ *
+ * <p>Max energy output of the flash for a full
+ * power single flash</p>
+ */
+ ANDROID_FLASH_MAX_ENERGY,
+ /**
+ * android.flash.state [dynamic, enum, public]
+ *
+ * <p>Current state of the flash
+ * unit.</p>
+ */
+ ANDROID_FLASH_STATE,
+ /**
+ * android.flash.info.available [static, enum, public]
+ *
+ * <p>Whether this camera device has a
+ * flash unit.</p>
+ */
+ ANDROID_FLASH_INFO_AVAILABLE = CameraMetadataSectionStart.ANDROID_FLASH_INFO_START,
+ /**
+ * android.flash.info.chargeDuration [static, int64, system]
+ *
+ * <p>Time taken before flash can fire
+ * again</p>
+ */
+ ANDROID_FLASH_INFO_CHARGE_DURATION,
+ /**
+ * android.flash.info.strengthMaximumLevel [static, int32, public]
+ *
+ * <p>Maximum flashlight brightness level.</p>
+ */
+ ANDROID_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL,
+ /**
+ * android.flash.info.strengthDefaultLevel [static, int32, public]
+ *
+ * <p>Default flashlight brightness level to be set via
+ * {android.hardware.camera2.CameraManager#turnOnTorchWithStrengthLevel}.</p>
+ */
+ ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL,
+ /**
+ * android.hotPixel.mode [dynamic, enum, public]
+ *
+ * <p>Operational mode for hot pixel correction.</p>
+ */
+ ANDROID_HOT_PIXEL_MODE = CameraMetadataSectionStart.ANDROID_HOT_PIXEL_START,
+ /**
+ * android.hotPixel.availableHotPixelModes [static, byte[], public]
+ *
+ * <p>List of hot pixel correction modes for ANDROID_HOT_PIXEL_MODE that are supported by this
+ * camera device.</p>
+ *
+ * @see ANDROID_HOT_PIXEL_MODE
+ */
+ ANDROID_HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES,
+ /**
+ * android.jpeg.gpsCoordinates [dynamic, double[], ndk_public]
+ *
+ * <p>GPS coordinates to include in output JPEG
+ * EXIF.</p>
+ */
+ ANDROID_JPEG_GPS_COORDINATES = CameraMetadataSectionStart.ANDROID_JPEG_START,
+ /**
+ * android.jpeg.gpsProcessingMethod [dynamic, byte, ndk_public]
+ *
+ * <p>32 characters describing GPS algorithm to
+ * include in EXIF.</p>
+ */
+ ANDROID_JPEG_GPS_PROCESSING_METHOD,
+ /**
+ * android.jpeg.gpsTimestamp [dynamic, int64, ndk_public]
+ *
+ * <p>Time GPS fix was made to include in
+ * EXIF.</p>
+ */
+ ANDROID_JPEG_GPS_TIMESTAMP,
+ /**
+ * android.jpeg.orientation [dynamic, int32, public]
+ *
+ * <p>The orientation for a JPEG image.</p>
+ */
+ ANDROID_JPEG_ORIENTATION,
+ /**
+ * android.jpeg.quality [dynamic, byte, public]
+ *
+ * <p>Compression quality of the final JPEG
+ * image.</p>
+ */
+ ANDROID_JPEG_QUALITY,
+ /**
+ * android.jpeg.thumbnailQuality [dynamic, byte, public]
+ *
+ * <p>Compression quality of JPEG
+ * thumbnail.</p>
+ */
+ ANDROID_JPEG_THUMBNAIL_QUALITY,
+ /**
+ * android.jpeg.thumbnailSize [dynamic, int32[], public]
+ *
+ * <p>Resolution of embedded JPEG thumbnail.</p>
+ */
+ ANDROID_JPEG_THUMBNAIL_SIZE,
+ /**
+ * android.jpeg.availableThumbnailSizes [static, int32[], public]
+ *
+ * <p>List of JPEG thumbnail sizes for ANDROID_JPEG_THUMBNAIL_SIZE supported by this
+ * camera device.</p>
+ *
+ * @see ANDROID_JPEG_THUMBNAIL_SIZE
+ */
+ ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES,
+ /**
+ * android.jpeg.maxSize [static, int32, system]
+ *
+ * <p>Maximum size in bytes for the compressed
+ * JPEG buffer, in default sensor pixel mode (see ANDROID_SENSOR_PIXEL_MODE)</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_JPEG_MAX_SIZE,
+ /**
+ * android.jpeg.size [dynamic, int32, system]
+ *
+ * <p>The size of the compressed JPEG image, in
+ * bytes</p>
+ */
+ ANDROID_JPEG_SIZE,
+ /**
+ * android.lens.aperture [dynamic, float, public]
+ *
+ * <p>The desired lens aperture size, as a ratio of lens focal length to the
+ * effective aperture diameter.</p>
+ */
+ ANDROID_LENS_APERTURE = CameraMetadataSectionStart.ANDROID_LENS_START,
+ /**
+ * android.lens.filterDensity [dynamic, float, public]
+ *
+ * <p>The desired setting for the lens neutral density filter(s).</p>
+ */
+ ANDROID_LENS_FILTER_DENSITY,
+ /**
+ * android.lens.focalLength [dynamic, float, public]
+ *
+ * <p>The desired lens focal length; used for optical zoom.</p>
+ */
+ ANDROID_LENS_FOCAL_LENGTH,
+ /**
+ * android.lens.focusDistance [dynamic, float, public]
+ *
+ * <p>Desired distance to plane of sharpest focus,
+ * measured from frontmost surface of the lens.</p>
+ */
+ ANDROID_LENS_FOCUS_DISTANCE,
+ /**
+ * android.lens.opticalStabilizationMode [dynamic, enum, public]
+ *
+ * <p>Sets whether the camera device uses optical image stabilization (OIS)
+ * when capturing images.</p>
+ */
+ ANDROID_LENS_OPTICAL_STABILIZATION_MODE,
+ /**
+ * android.lens.facing [static, enum, public]
+ *
+ * <p>Direction the camera faces relative to
+ * device screen.</p>
+ */
+ ANDROID_LENS_FACING,
+ /**
+ * android.lens.poseRotation [dynamic, float[], public]
+ *
+ * <p>The orientation of the camera relative to the sensor
+ * coordinate system.</p>
+ */
+ ANDROID_LENS_POSE_ROTATION,
+ /**
+ * android.lens.poseTranslation [dynamic, float[], public]
+ *
+ * <p>Position of the camera optical center.</p>
+ */
+ ANDROID_LENS_POSE_TRANSLATION,
+ /**
+ * android.lens.focusRange [dynamic, float[], public]
+ *
+ * <p>The range of scene distances that are in
+ * sharp focus (depth of field).</p>
+ */
+ ANDROID_LENS_FOCUS_RANGE,
+ /**
+ * android.lens.state [dynamic, enum, public]
+ *
+ * <p>Current lens status.</p>
+ */
+ ANDROID_LENS_STATE,
+ /**
+ * android.lens.intrinsicCalibration [dynamic, float[], public]
+ *
+ * <p>The parameters for this camera device's intrinsic
+ * calibration.</p>
+ */
+ ANDROID_LENS_INTRINSIC_CALIBRATION,
+ /**
+ * android.lens.radialDistortion [dynamic, float[], public]
+ *
+ * <p>The correction coefficients to correct for this camera device's
+ * radial and tangential lens distortion.</p>
+ */
+ ANDROID_LENS_RADIAL_DISTORTION,
+ /**
+ * android.lens.poseReference [static, enum, public]
+ *
+ * <p>The origin for ANDROID_LENS_POSE_TRANSLATION, and the accuracy of
+ * ANDROID_LENS_POSE_TRANSLATION and ANDROID_LENS_POSE_ROTATION.</p>
+ *
+ * @see ANDROID_LENS_POSE_ROTATION
+ * @see ANDROID_LENS_POSE_TRANSLATION
+ */
+ ANDROID_LENS_POSE_REFERENCE,
+ /**
+ * android.lens.distortion [dynamic, float[], public]
+ *
+ * <p>The correction coefficients to correct for this camera device's
+ * radial and tangential lens distortion.</p>
+ * <p>Replaces the deprecated ANDROID_LENS_RADIAL_DISTORTION field, which was
+ * inconsistently defined.</p>
+ *
+ * @see ANDROID_LENS_RADIAL_DISTORTION
+ */
+ ANDROID_LENS_DISTORTION,
+ /**
+ * android.lens.distortionMaximumResolution [static, float[], public]
+ *
+ * <p>The correction coefficients to correct for this camera device's
+ * radial and tangential lens distortion for a
+ * CaptureRequest with ANDROID_SENSOR_PIXEL_MODE set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_LENS_DISTORTION_MAXIMUM_RESOLUTION,
+ /**
+ * android.lens.intrinsicCalibrationMaximumResolution [static, float[], public]
+ *
+ * <p>The parameters for this camera device's intrinsic
+ * calibration when ANDROID_SENSOR_PIXEL_MODE is set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_LENS_INTRINSIC_CALIBRATION_MAXIMUM_RESOLUTION,
+ /**
+ * android.lens.info.availableApertures [static, float[], public]
+ *
+ * <p>List of aperture size values for ANDROID_LENS_APERTURE that are
+ * supported by this camera device.</p>
+ *
+ * @see ANDROID_LENS_APERTURE
+ */
+ ANDROID_LENS_INFO_AVAILABLE_APERTURES = CameraMetadataSectionStart.ANDROID_LENS_INFO_START,
+ /**
+ * android.lens.info.availableFilterDensities [static, float[], public]
+ *
+ * <p>List of neutral density filter values for
+ * ANDROID_LENS_FILTER_DENSITY that are supported by this camera device.</p>
+ *
+ * @see ANDROID_LENS_FILTER_DENSITY
+ */
+ ANDROID_LENS_INFO_AVAILABLE_FILTER_DENSITIES,
+ /**
+ * android.lens.info.availableFocalLengths [static, float[], public]
+ *
+ * <p>List of focal lengths for ANDROID_LENS_FOCAL_LENGTH that are supported by this camera
+ * device.</p>
+ *
+ * @see ANDROID_LENS_FOCAL_LENGTH
+ */
+ ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS,
+ /**
+ * android.lens.info.availableOpticalStabilization [static, byte[], public]
+ *
+ * <p>List of optical image stabilization (OIS) modes for
+ * ANDROID_LENS_OPTICAL_STABILIZATION_MODE that are supported by this camera device.</p>
+ *
+ * @see ANDROID_LENS_OPTICAL_STABILIZATION_MODE
+ */
+ ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION,
+ /**
+ * android.lens.info.hyperfocalDistance [static, float, public]
+ *
+ * <p>Hyperfocal distance for this lens.</p>
+ */
+ ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE,
+ /**
+ * android.lens.info.minimumFocusDistance [static, float, public]
+ *
+ * <p>Shortest distance from frontmost surface
+ * of the lens that can be brought into sharp focus.</p>
+ */
+ ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE,
+ /**
+ * android.lens.info.shadingMapSize [static, int32[], ndk_public]
+ *
+ * <p>Dimensions of lens shading map.</p>
+ */
+ ANDROID_LENS_INFO_SHADING_MAP_SIZE,
+ /**
+ * android.lens.info.focusDistanceCalibration [static, enum, public]
+ *
+ * <p>The lens focus distance calibration quality.</p>
+ */
+ ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION,
+ /**
+ * android.noiseReduction.mode [dynamic, enum, public]
+ *
+ * <p>Mode of operation for the noise reduction algorithm.</p>
+ */
+ ANDROID_NOISE_REDUCTION_MODE = CameraMetadataSectionStart.ANDROID_NOISE_REDUCTION_START,
+ /**
+ * android.noiseReduction.strength [controls, byte, system]
+ *
+ * <p>Control the amount of noise reduction
+ * applied to the images</p>
+ */
+ ANDROID_NOISE_REDUCTION_STRENGTH,
+ /**
+ * android.noiseReduction.availableNoiseReductionModes [static, byte[], public]
+ *
+ * <p>List of noise reduction modes for ANDROID_NOISE_REDUCTION_MODE that are supported
+ * by this camera device.</p>
+ *
+ * @see ANDROID_NOISE_REDUCTION_MODE
+ */
+ ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES,
+ /**
+ * android.quirks.meteringCropRegion [static, byte, system]
+ *
+ * <p>If set to 1, the camera service does not
+ * scale 'normalized' coordinates with respect to the crop
+ * region. This applies to metering input (a{e,f,wb}Region
+ * and output (face rectangles).</p>
+ */
+ ANDROID_QUIRKS_METERING_CROP_REGION = CameraMetadataSectionStart.ANDROID_QUIRKS_START,
+ /**
+ * android.quirks.triggerAfWithAuto [static, byte, system]
+ *
+ * <p>If set to 1, then the camera service always
+ * switches to FOCUS_MODE_AUTO before issuing a AF
+ * trigger.</p>
+ */
+ ANDROID_QUIRKS_TRIGGER_AF_WITH_AUTO,
+ /**
+ * android.quirks.useZslFormat [static, byte, system]
+ *
+ * <p>If set to 1, the camera service uses
+ * CAMERA2_PIXEL_FORMAT_ZSL instead of
+ * HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED for the zero
+ * shutter lag stream</p>
+ */
+ ANDROID_QUIRKS_USE_ZSL_FORMAT,
+ /**
+ * android.quirks.usePartialResult [static, byte, hidden]
+ *
+ * <p>If set to 1, the HAL will always split result
+ * metadata for a single capture into multiple buffers,
+ * returned using multiple process_capture_result calls.</p>
+ */
+ ANDROID_QUIRKS_USE_PARTIAL_RESULT,
+ /**
+ * android.quirks.partialResult [dynamic, enum, hidden]
+ *
+ * <p>Whether a result given to the framework is the
+ * final one for the capture, or only a partial that contains a
+ * subset of the full set of dynamic metadata
+ * values.</p>
+ */
+ ANDROID_QUIRKS_PARTIAL_RESULT,
+ /**
+ * android.request.frameCount [dynamic, int32, hidden]
+ *
+ * <p>A frame counter set by the framework. This value monotonically
+ * increases with every new result (that is, each new result has a unique
+ * frameCount value).</p>
+ */
+ ANDROID_REQUEST_FRAME_COUNT = CameraMetadataSectionStart.ANDROID_REQUEST_START,
+ /**
+ * android.request.id [dynamic, int32, hidden]
+ *
+ * <p>An application-specified ID for the current
+ * request. Must be maintained unchanged in output
+ * frame</p>
+ */
+ ANDROID_REQUEST_ID,
+ /**
+ * android.request.inputStreams [controls, int32[], system]
+ *
+ * <p>List which camera reprocess stream is used
+ * for the source of reprocessing data.</p>
+ */
+ ANDROID_REQUEST_INPUT_STREAMS,
+ /**
+ * android.request.metadataMode [dynamic, enum, system]
+ *
+ * <p>How much metadata to produce on
+ * output</p>
+ */
+ ANDROID_REQUEST_METADATA_MODE,
+ /**
+ * android.request.outputStreams [dynamic, int32[], system]
+ *
+ * <p>Lists which camera output streams image data
+ * from this capture must be sent to</p>
+ */
+ ANDROID_REQUEST_OUTPUT_STREAMS,
+ /**
+ * android.request.type [controls, enum, system]
+ *
+ * <p>The type of the request; either CAPTURE or
+ * REPROCESS. For legacy HAL3, this tag is redundant.</p>
+ */
+ ANDROID_REQUEST_TYPE,
+ /**
+ * android.request.maxNumOutputStreams [static, int32[], ndk_public]
+ *
+ * <p>The maximum numbers of different types of output streams
+ * that can be configured and used simultaneously by a camera device.</p>
+ */
+ ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS,
+ /**
+ * android.request.maxNumReprocessStreams [static, int32[], system]
+ *
+ * <p>How many reprocessing streams of any type
+ * can be allocated at the same time.</p>
+ */
+ ANDROID_REQUEST_MAX_NUM_REPROCESS_STREAMS,
+ /**
+ * android.request.maxNumInputStreams [static, int32, java_public]
+ *
+ * <p>The maximum numbers of any type of input streams
+ * that can be configured and used simultaneously by a camera device.</p>
+ */
+ ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS,
+ /**
+ * android.request.pipelineDepth [dynamic, byte, public]
+ *
+ * <p>Specifies the number of pipeline stages the frame went
+ * through from when it was exposed to when the final completed result
+ * was available to the framework.</p>
+ */
+ ANDROID_REQUEST_PIPELINE_DEPTH,
+ /**
+ * android.request.pipelineMaxDepth [static, byte, public]
+ *
+ * <p>Specifies the number of maximum pipeline stages a frame
+ * has to go through from when it's exposed to when it's available
+ * to the framework.</p>
+ */
+ ANDROID_REQUEST_PIPELINE_MAX_DEPTH,
+ /**
+ * android.request.partialResultCount [static, int32, public]
+ *
+ * <p>Defines how many sub-components
+ * a result will be composed of.</p>
+ */
+ ANDROID_REQUEST_PARTIAL_RESULT_COUNT,
+ /**
+ * android.request.availableCapabilities [static, enum[], public]
+ *
+ * <p>List of capabilities that this camera device
+ * advertises as fully supporting.</p>
+ */
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES,
+ /**
+ * android.request.availableRequestKeys [static, int32[], ndk_public]
+ *
+ * <p>A list of all keys that the camera device has available
+ * to use with {@link ACaptureRequest }.</p>
+ */
+ ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS,
+ /**
+ * android.request.availableResultKeys [static, int32[], ndk_public]
+ *
+ * <p>A list of all keys that the camera device has available to use with {@link ACameraCaptureSession_captureCallback_result }.</p>
+ */
+ ANDROID_REQUEST_AVAILABLE_RESULT_KEYS,
+ /**
+ * android.request.availableCharacteristicsKeys [static, int32[], ndk_public]
+ *
+ * <p>A list of all keys that the camera device has available to use with {@link ACameraManager_getCameraCharacteristics }.</p>
+ */
+ ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS,
+ /**
+ * android.request.availableSessionKeys [static, int32[], ndk_public]
+ *
+ * <p>A subset of the available request keys that the camera device
+ * can pass as part of the capture session initialization.</p>
+ */
+ ANDROID_REQUEST_AVAILABLE_SESSION_KEYS,
+ /**
+ * android.request.availablePhysicalCameraRequestKeys [static, int32[], ndk_public]
+ *
+ * <p>A subset of the available request keys that can be overridden for
+ * physical devices backing a logical multi-camera.</p>
+ */
+ ANDROID_REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS,
+ /**
+ * android.request.characteristicKeysNeedingPermission [static, int32[], hidden]
+ *
+ * <p>A list of camera characteristics keys that are only available
+ * in case the camera client has camera permission.</p>
+ */
+ ANDROID_REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION,
+ /**
+ * android.request.availableDynamicRangeProfilesMap [static, enum[], ndk_public]
+ *
+ * <p>A map of all available 10-bit dynamic range profiles along with their
+ * capture request constraints.</p>
+ */
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP,
+ /**
+ * android.request.recommendedTenBitDynamicRangeProfile [static, int32, java_public]
+ *
+ * <p>Recommended 10-bit dynamic range profile.</p>
+ */
+ ANDROID_REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE,
+ /**
+ * android.scaler.cropRegion [dynamic, int32[], public]
+ *
+ * <p>The desired region of the sensor to read out for this capture.</p>
+ */
+ ANDROID_SCALER_CROP_REGION = CameraMetadataSectionStart.ANDROID_SCALER_START,
+ /**
+ * android.scaler.availableFormats [static, enum[], hidden]
+ *
+ * <p>The list of image formats that are supported by this
+ * camera device for output streams.</p>
+ */
+ ANDROID_SCALER_AVAILABLE_FORMATS,
+ /**
+ * android.scaler.availableJpegMinDurations [static, int64[], hidden]
+ *
+ * <p>The minimum frame duration that is supported
+ * for each resolution in ANDROID_SCALER_AVAILABLE_JPEG_SIZES.</p>
+ *
+ * @see ANDROID_SCALER_AVAILABLE_JPEG_SIZES
+ */
+ ANDROID_SCALER_AVAILABLE_JPEG_MIN_DURATIONS,
+ /**
+ * android.scaler.availableJpegSizes [static, int32[], hidden]
+ *
+ * <p>The JPEG resolutions that are supported by this camera device.</p>
+ */
+ ANDROID_SCALER_AVAILABLE_JPEG_SIZES,
+ /**
+ * android.scaler.availableMaxDigitalZoom [static, float, public]
+ *
+ * <p>The maximum ratio between both active area width
+ * and crop region width, and active area height and
+ * crop region height, for ANDROID_SCALER_CROP_REGION.</p>
+ *
+ * @see ANDROID_SCALER_CROP_REGION
+ */
+ ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM,
+ /**
+ * android.scaler.availableProcessedMinDurations [static, int64[], hidden]
+ *
+ * <p>For each available processed output size (defined in
+ * ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES), this property lists the
+ * minimum supportable frame duration for that size.</p>
+ *
+ * @see ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES
+ */
+ ANDROID_SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS,
+ /**
+ * android.scaler.availableProcessedSizes [static, int32[], hidden]
+ *
+ * <p>The resolutions available for use with
+ * processed output streams, such as YV12, NV12, and
+ * platform opaque YUV/RGB streams to the GPU or video
+ * encoders.</p>
+ */
+ ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES,
+ /**
+ * android.scaler.availableRawMinDurations [static, int64[], system]
+ *
+ * <p>For each available raw output size (defined in
+ * ANDROID_SCALER_AVAILABLE_RAW_SIZES), this property lists the minimum
+ * supportable frame duration for that size.</p>
+ *
+ * @see ANDROID_SCALER_AVAILABLE_RAW_SIZES
+ */
+ ANDROID_SCALER_AVAILABLE_RAW_MIN_DURATIONS,
+ /**
+ * android.scaler.availableRawSizes [static, int32[], system]
+ *
+ * <p>The resolutions available for use with raw
+ * sensor output streams, listed as width,
+ * height</p>
+ */
+ ANDROID_SCALER_AVAILABLE_RAW_SIZES,
+ /**
+ * android.scaler.availableInputOutputFormatsMap [static, int32, hidden]
+ *
+ * <p>The mapping of image formats that are supported by this
+ * camera device for input streams, to their corresponding output formats.</p>
+ */
+ ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP,
+ /**
+ * android.scaler.availableStreamConfigurations [static, enum[], ndk_public]
+ *
+ * <p>The available stream configurations that this
+ * camera device supports
+ * (i.e. format, width, height, output/input stream).</p>
+ */
+ ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS,
+ /**
+ * android.scaler.availableMinFrameDurations [static, int64[], ndk_public]
+ *
+ * <p>This lists the minimum frame duration for each
+ * format/size combination.</p>
+ */
+ ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,
+ /**
+ * android.scaler.availableStallDurations [static, int64[], ndk_public]
+ *
+ * <p>This lists the maximum stall duration for each
+ * output format/size combination.</p>
+ */
+ ANDROID_SCALER_AVAILABLE_STALL_DURATIONS,
+ /**
+ * android.scaler.croppingType [static, enum, public]
+ *
+ * <p>The crop type that this camera device supports.</p>
+ */
+ ANDROID_SCALER_CROPPING_TYPE,
+ /**
+ * android.scaler.availableRecommendedStreamConfigurations [static, enum[], ndk_public]
+ *
+ * <p>Recommended stream configurations for common client use cases.</p>
+ */
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS,
+ /**
+ * android.scaler.availableRecommendedInputOutputFormatsMap [static, int32, ndk_public]
+ *
+ * <p>Recommended mappings of image formats that are supported by this
+ * camera device for input streams, to their corresponding output formats.</p>
+ */
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP,
+ /**
+ * android.scaler.availableRotateAndCropModes [static, byte[], public]
+ *
+ * <p>List of rotate-and-crop modes for ANDROID_SCALER_ROTATE_AND_CROP that are supported by this camera device.</p>
+ *
+ * @see ANDROID_SCALER_ROTATE_AND_CROP
+ */
+ ANDROID_SCALER_AVAILABLE_ROTATE_AND_CROP_MODES,
+ /**
+ * android.scaler.defaultSecureImageSize [static, int32[], public]
+ *
+ * <p>Default YUV/PRIVATE size to use for requesting secure image buffers.</p>
+ */
+ ANDROID_SCALER_DEFAULT_SECURE_IMAGE_SIZE,
+ /**
+ * android.scaler.physicalCameraMultiResolutionStreamConfigurations [static, enum[], ndk_public]
+ *
+ * <p>The available multi-resolution stream configurations that this
+ * physical camera device supports
+ * (i.e. format, width, height, output/input stream).</p>
+ */
+ ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS,
+ /**
+ * android.scaler.availableStreamConfigurationsMaximumResolution [static, enum[], ndk_public]
+ *
+ * <p>The available stream configurations that this
+ * camera device supports (i.e. format, width, height, output/input stream) for a
+ * CaptureRequest with ANDROID_SENSOR_PIXEL_MODE set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION,
+ /**
+ * android.scaler.availableMinFrameDurationsMaximumResolution [static, int64[], ndk_public]
+ *
+ * <p>This lists the minimum frame duration for each
+ * format/size combination when the camera device is sent a CaptureRequest with
+ * ANDROID_SENSOR_PIXEL_MODE set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION,
+ /**
+ * android.scaler.availableStallDurationsMaximumResolution [static, int64[], ndk_public]
+ *
+ * <p>This lists the maximum stall duration for each
+ * output format/size combination when CaptureRequests are submitted with
+ * ANDROID_SENSOR_PIXEL_MODE set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a></p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_SCALER_AVAILABLE_STALL_DURATIONS_MAXIMUM_RESOLUTION,
+ /**
+ * android.scaler.availableInputOutputFormatsMapMaximumResolution [static, int32, hidden]
+ *
+ * <p>The mapping of image formats that are supported by this
+ * camera device for input streams, to their corresponding output formats, when
+ * ANDROID_SENSOR_PIXEL_MODE is set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP_MAXIMUM_RESOLUTION,
+ /**
+ * android.scaler.multiResolutionStreamSupported [static, enum, ndk_public]
+ *
+ * <p>Whether the camera device supports multi-resolution input or output streams</p>
+ */
+ ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED,
+ /**
+ * android.scaler.availableStreamUseCases [static, enum[], public]
+ *
+ * <p>The stream use cases supported by this camera device.</p>
+ */
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES,
+ /**
+ * android.sensor.exposureTime [dynamic, int64, public]
+ *
+ * <p>Duration each pixel is exposed to
+ * light.</p>
+ */
+ ANDROID_SENSOR_EXPOSURE_TIME = CameraMetadataSectionStart.ANDROID_SENSOR_START,
+ /**
+ * android.sensor.frameDuration [dynamic, int64, public]
+ *
+ * <p>Duration from start of frame exposure to
+ * start of next frame exposure.</p>
+ */
+ ANDROID_SENSOR_FRAME_DURATION,
+ /**
+ * android.sensor.sensitivity [dynamic, int32, public]
+ *
+ * <p>The amount of gain applied to sensor data
+ * before processing.</p>
+ */
+ ANDROID_SENSOR_SENSITIVITY,
+ /**
+ * android.sensor.referenceIlluminant1 [static, enum, public]
+ *
+ * <p>The standard reference illuminant used as the scene light source when
+ * calculating the ANDROID_SENSOR_COLOR_TRANSFORM1,
+ * ANDROID_SENSOR_CALIBRATION_TRANSFORM1, and
+ * ANDROID_SENSOR_FORWARD_MATRIX1 matrices.</p>
+ *
+ * @see ANDROID_SENSOR_CALIBRATION_TRANSFORM1
+ * @see ANDROID_SENSOR_COLOR_TRANSFORM1
+ * @see ANDROID_SENSOR_FORWARD_MATRIX1
+ */
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1,
+ /**
+ * android.sensor.referenceIlluminant2 [static, byte, public]
+ *
+ * <p>The standard reference illuminant used as the scene light source when
+ * calculating the ANDROID_SENSOR_COLOR_TRANSFORM2,
+ * ANDROID_SENSOR_CALIBRATION_TRANSFORM2, and
+ * ANDROID_SENSOR_FORWARD_MATRIX2 matrices.</p>
+ *
+ * @see ANDROID_SENSOR_CALIBRATION_TRANSFORM2
+ * @see ANDROID_SENSOR_COLOR_TRANSFORM2
+ * @see ANDROID_SENSOR_FORWARD_MATRIX2
+ */
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT2,
+ /**
+ * android.sensor.calibrationTransform1 [static, rational[], public]
+ *
+ * <p>A per-device calibration transform matrix that maps from the
+ * reference sensor colorspace to the actual device sensor colorspace.</p>
+ */
+ ANDROID_SENSOR_CALIBRATION_TRANSFORM1,
+ /**
+ * android.sensor.calibrationTransform2 [static, rational[], public]
+ *
+ * <p>A per-device calibration transform matrix that maps from the
+ * reference sensor colorspace to the actual device sensor colorspace
+ * (this is the colorspace of the raw buffer data).</p>
+ */
+ ANDROID_SENSOR_CALIBRATION_TRANSFORM2,
+ /**
+ * android.sensor.colorTransform1 [static, rational[], public]
+ *
+ * <p>A matrix that transforms color values from CIE XYZ color space to
+ * reference sensor color space.</p>
+ */
+ ANDROID_SENSOR_COLOR_TRANSFORM1,
+ /**
+ * android.sensor.colorTransform2 [static, rational[], public]
+ *
+ * <p>A matrix that transforms color values from CIE XYZ color space to
+ * reference sensor color space.</p>
+ */
+ ANDROID_SENSOR_COLOR_TRANSFORM2,
+ /**
+ * android.sensor.forwardMatrix1 [static, rational[], public]
+ *
+ * <p>A matrix that transforms white balanced camera colors from the reference
+ * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
+ */
+ ANDROID_SENSOR_FORWARD_MATRIX1,
+ /**
+ * android.sensor.forwardMatrix2 [static, rational[], public]
+ *
+ * <p>A matrix that transforms white balanced camera colors from the reference
+ * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
+ */
+ ANDROID_SENSOR_FORWARD_MATRIX2,
+ /**
+ * android.sensor.baseGainFactor [static, rational, system]
+ *
+ * <p>Gain factor from electrons to raw units when
+ * ISO=100</p>
+ */
+ ANDROID_SENSOR_BASE_GAIN_FACTOR,
+ /**
+ * android.sensor.blackLevelPattern [static, int32[], public]
+ *
+ * <p>A fixed black level offset for each of the color filter arrangement
+ * (CFA) mosaic channels.</p>
+ */
+ ANDROID_SENSOR_BLACK_LEVEL_PATTERN,
+ /**
+ * android.sensor.maxAnalogSensitivity [static, int32, public]
+ *
+ * <p>Maximum sensitivity that is implemented
+ * purely through analog gain.</p>
+ */
+ ANDROID_SENSOR_MAX_ANALOG_SENSITIVITY,
+ /**
+ * android.sensor.orientation [static, int32, public]
+ *
+ * <p>Clockwise angle through which the output image needs to be rotated to be
+ * upright on the device screen in its native orientation.</p>
+ */
+ ANDROID_SENSOR_ORIENTATION,
+ /**
+ * android.sensor.profileHueSatMapDimensions [static, int32[], system]
+ *
+ * <p>The number of input samples for each dimension of
+ * ANDROID_SENSOR_PROFILE_HUE_SAT_MAP.</p>
+ *
+ * @see ANDROID_SENSOR_PROFILE_HUE_SAT_MAP
+ */
+ ANDROID_SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS,
+ /**
+ * android.sensor.timestamp [dynamic, int64, public]
+ *
+ * <p>Time at start of exposure of first
+ * row of the image sensor active array, in nanoseconds.</p>
+ */
+ ANDROID_SENSOR_TIMESTAMP,
+ /**
+ * android.sensor.temperature [dynamic, float, system]
+ *
+ * <p>The temperature of the sensor, sampled at the time
+ * exposure began for this frame.</p>
+ * <p>The thermal diode being queried should be inside the sensor PCB, or
+ * somewhere close to it.</p>
+ */
+ ANDROID_SENSOR_TEMPERATURE,
+ /**
+ * android.sensor.neutralColorPoint [dynamic, rational[], public]
+ *
+ * <p>The estimated camera neutral color in the native sensor colorspace at
+ * the time of capture.</p>
+ */
+ ANDROID_SENSOR_NEUTRAL_COLOR_POINT,
+ /**
+ * android.sensor.noiseProfile [dynamic, double[], public]
+ *
+ * <p>Noise model coefficients for each CFA mosaic channel.</p>
+ */
+ ANDROID_SENSOR_NOISE_PROFILE,
+ /**
+ * android.sensor.profileHueSatMap [dynamic, float[], system]
+ *
+ * <p>A mapping containing a hue shift, saturation scale, and value scale
+ * for each pixel.</p>
+ */
+ ANDROID_SENSOR_PROFILE_HUE_SAT_MAP,
+ /**
+ * android.sensor.profileToneCurve [dynamic, float[], system]
+ *
+ * <p>A list of x,y samples defining a tone-mapping curve for gamma adjustment.</p>
+ */
+ ANDROID_SENSOR_PROFILE_TONE_CURVE,
+ /**
+ * android.sensor.greenSplit [dynamic, float, public]
+ *
+ * <p>The worst-case divergence between Bayer green channels.</p>
+ */
+ ANDROID_SENSOR_GREEN_SPLIT,
+ /**
+ * android.sensor.testPatternData [dynamic, int32[], public]
+ *
+ * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
+ * when ANDROID_SENSOR_TEST_PATTERN_MODE is SOLID_COLOR.</p>
+ *
+ * @see ANDROID_SENSOR_TEST_PATTERN_MODE
+ */
+ ANDROID_SENSOR_TEST_PATTERN_DATA,
+ /**
+ * android.sensor.testPatternMode [dynamic, enum, public]
+ *
+ * <p>When enabled, the sensor sends a test pattern instead of
+ * doing a real exposure from the camera.</p>
+ */
+ ANDROID_SENSOR_TEST_PATTERN_MODE,
+ /**
+ * android.sensor.availableTestPatternModes [static, int32[], public]
+ *
+ * <p>List of sensor test pattern modes for ANDROID_SENSOR_TEST_PATTERN_MODE
+ * supported by this camera device.</p>
+ *
+ * @see ANDROID_SENSOR_TEST_PATTERN_MODE
+ */
+ ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES,
+ /**
+ * android.sensor.rollingShutterSkew [dynamic, int64, public]
+ *
+ * <p>Duration between the start of exposure for the first row of the image sensor,
+ * and the start of exposure for one past the last row of the image sensor.</p>
+ */
+ ANDROID_SENSOR_ROLLING_SHUTTER_SKEW,
+ /**
+ * android.sensor.opticalBlackRegions [static, int32[], public]
+ *
+ * <p>List of disjoint rectangles indicating the sensor
+ * optically shielded black pixel regions.</p>
+ */
+ ANDROID_SENSOR_OPTICAL_BLACK_REGIONS,
+ /**
+ * android.sensor.dynamicBlackLevel [dynamic, float[], public]
+ *
+ * <p>A per-frame dynamic black level offset for each of the color filter
+ * arrangement (CFA) mosaic channels.</p>
+ */
+ ANDROID_SENSOR_DYNAMIC_BLACK_LEVEL,
+ /**
+ * android.sensor.dynamicWhiteLevel [dynamic, int32, public]
+ *
+ * <p>Maximum raw value output by sensor for this frame.</p>
+ */
+ ANDROID_SENSOR_DYNAMIC_WHITE_LEVEL,
+ /**
+ * android.sensor.opaqueRawSize [static, int32[], system]
+ *
+ * <p>Size in bytes for all the listed opaque RAW buffer sizes</p>
+ */
+ ANDROID_SENSOR_OPAQUE_RAW_SIZE,
+ /**
+ * android.sensor.opaqueRawSizeMaximumResolution [static, int32[], system]
+ *
+ * <p>Size in bytes for all the listed opaque RAW buffer sizes when
+ * ANDROID_SENSOR_PIXEL_MODE is set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_SENSOR_OPAQUE_RAW_SIZE_MAXIMUM_RESOLUTION,
+ /**
+ * android.sensor.pixelMode [dynamic, enum, public]
+ *
+ * <p>Switches sensor pixel mode between maximum resolution mode and default mode.</p>
+ */
+ ANDROID_SENSOR_PIXEL_MODE,
+ /**
+ * android.sensor.rawBinningFactorUsed [dynamic, enum, public]
+ *
+ * <p>Whether <code>RAW</code> images requested have their bayer pattern as described by
+ * ANDROID_SENSOR_INFO_BINNING_FACTOR.</p>
+ *
+ * @see ANDROID_SENSOR_INFO_BINNING_FACTOR
+ */
+ ANDROID_SENSOR_RAW_BINNING_FACTOR_USED,
+ /**
+ * android.sensor.info.activeArraySize [static, int32[], public]
+ *
+ * <p>The area of the image sensor which corresponds to active pixels after any geometric
+ * distortion correction has been applied.</p>
+ */
+ ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE = CameraMetadataSectionStart.ANDROID_SENSOR_INFO_START,
+ /**
+ * android.sensor.info.sensitivityRange [static, int32[], public]
+ *
+ * <p>Range of sensitivities for ANDROID_SENSOR_SENSITIVITY supported by this
+ * camera device.</p>
+ *
+ * @see ANDROID_SENSOR_SENSITIVITY
+ */
+ ANDROID_SENSOR_INFO_SENSITIVITY_RANGE,
+ /**
+ * android.sensor.info.colorFilterArrangement [static, enum, public]
+ *
+ * <p>The arrangement of color filters on sensor;
+ * represents the colors in the top-left 2x2 section of
+ * the sensor, in reading order, for a Bayer camera, or the
+ * light spectrum it captures for MONOCHROME camera.</p>
+ */
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT,
+ /**
+ * android.sensor.info.exposureTimeRange [static, int64[], public]
+ *
+ * <p>The range of image exposure times for ANDROID_SENSOR_EXPOSURE_TIME supported
+ * by this camera device.</p>
+ *
+ * @see ANDROID_SENSOR_EXPOSURE_TIME
+ */
+ ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE,
+ /**
+ * android.sensor.info.maxFrameDuration [static, int64, public]
+ *
+ * <p>The maximum possible frame duration (minimum frame rate) for
+ * ANDROID_SENSOR_FRAME_DURATION that is supported this camera device.</p>
+ *
+ * @see ANDROID_SENSOR_FRAME_DURATION
+ */
+ ANDROID_SENSOR_INFO_MAX_FRAME_DURATION,
+ /**
+ * android.sensor.info.physicalSize [static, float[], public]
+ *
+ * <p>The physical dimensions of the full pixel
+ * array.</p>
+ */
+ ANDROID_SENSOR_INFO_PHYSICAL_SIZE,
+ /**
+ * android.sensor.info.pixelArraySize [static, int32[], public]
+ *
+ * <p>Dimensions of the full pixel array, possibly
+ * including black calibration pixels.</p>
+ */
+ ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE,
+ /**
+ * android.sensor.info.whiteLevel [static, int32, public]
+ *
+ * <p>Maximum raw value output by sensor.</p>
+ */
+ ANDROID_SENSOR_INFO_WHITE_LEVEL,
+ /**
+ * android.sensor.info.timestampSource [static, enum, public]
+ *
+ * <p>The time base source for sensor capture start timestamps.</p>
+ */
+ ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE,
+ /**
+ * android.sensor.info.lensShadingApplied [static, enum, public]
+ *
+ * <p>Whether the RAW images output from this camera device are subject to
+ * lens shading correction.</p>
+ */
+ ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED,
+ /**
+ * android.sensor.info.preCorrectionActiveArraySize [static, int32[], public]
+ *
+ * <p>The area of the image sensor which corresponds to active pixels prior to the
+ * application of any geometric distortion correction.</p>
+ */
+ ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE,
+ /**
+ * android.sensor.info.activeArraySizeMaximumResolution [static, int32[], public]
+ *
+ * <p>The area of the image sensor which corresponds to active pixels after any geometric
+ * distortion correction has been applied, when the sensor runs in maximum resolution mode.</p>
+ */
+ ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION,
+ /**
+ * android.sensor.info.pixelArraySizeMaximumResolution [static, int32[], public]
+ *
+ * <p>Dimensions of the full pixel array, possibly
+ * including black calibration pixels, when the sensor runs in maximum resolution mode.
+ * Analogous to ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, when ANDROID_SENSOR_PIXEL_MODE is
+ * set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE_MAXIMUM_RESOLUTION,
+ /**
+ * android.sensor.info.preCorrectionActiveArraySizeMaximumResolution [static, int32[], public]
+ *
+ * <p>The area of the image sensor which corresponds to active pixels prior to the
+ * application of any geometric distortion correction, when the sensor runs in maximum
+ * resolution mode. This key must be used for crop / metering regions, only when
+ * ANDROID_SENSOR_PIXEL_MODE is set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION,
+ /**
+ * android.sensor.info.binningFactor [static, int32[], public]
+ *
+ * <p>Dimensions of the group of pixels which are under the same color filter.
+ * This specifies the width and height (pair of integers) of the group of pixels which fall
+ * under the same color filter for ULTRA_HIGH_RESOLUTION sensors.</p>
+ */
+ ANDROID_SENSOR_INFO_BINNING_FACTOR,
+ /**
+ * android.shading.mode [dynamic, enum, public]
+ *
+ * <p>Quality of lens shading correction applied
+ * to the image data.</p>
+ */
+ ANDROID_SHADING_MODE = CameraMetadataSectionStart.ANDROID_SHADING_START,
+ /**
+ * android.shading.strength [controls, byte, system]
+ *
+ * <p>Control the amount of shading correction
+ * applied to the images</p>
+ */
+ ANDROID_SHADING_STRENGTH,
+ /**
+ * android.shading.availableModes [static, byte[], public]
+ *
+ * <p>List of lens shading modes for ANDROID_SHADING_MODE that are supported by this camera device.</p>
+ *
+ * @see ANDROID_SHADING_MODE
+ */
+ ANDROID_SHADING_AVAILABLE_MODES,
+ /**
+ * android.statistics.faceDetectMode [dynamic, enum, public]
+ *
+ * <p>Operating mode for the face detector
+ * unit.</p>
+ */
+ ANDROID_STATISTICS_FACE_DETECT_MODE = CameraMetadataSectionStart.ANDROID_STATISTICS_START,
+ /**
+ * android.statistics.histogramMode [dynamic, enum, system]
+ *
+ * <p>Operating mode for histogram
+ * generation</p>
+ */
+ ANDROID_STATISTICS_HISTOGRAM_MODE,
+ /**
+ * android.statistics.sharpnessMapMode [dynamic, enum, system]
+ *
+ * <p>Operating mode for sharpness map
+ * generation</p>
+ */
+ ANDROID_STATISTICS_SHARPNESS_MAP_MODE,
+ /**
+ * android.statistics.hotPixelMapMode [dynamic, enum, public]
+ *
+ * <p>Operating mode for hot pixel map generation.</p>
+ */
+ ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE,
+ /**
+ * android.statistics.faceIds [dynamic, int32[], ndk_public]
+ *
+ * <p>List of unique IDs for detected faces.</p>
+ */
+ ANDROID_STATISTICS_FACE_IDS,
+ /**
+ * android.statistics.faceLandmarks [dynamic, int32[], ndk_public]
+ *
+ * <p>List of landmarks for detected
+ * faces.</p>
+ */
+ ANDROID_STATISTICS_FACE_LANDMARKS,
+ /**
+ * android.statistics.faceRectangles [dynamic, int32[], ndk_public]
+ *
+ * <p>List of the bounding rectangles for detected
+ * faces.</p>
+ */
+ ANDROID_STATISTICS_FACE_RECTANGLES,
+ /**
+ * android.statistics.faceScores [dynamic, byte[], ndk_public]
+ *
+ * <p>List of the face confidence scores for
+ * detected faces</p>
+ */
+ ANDROID_STATISTICS_FACE_SCORES,
+ /**
+ * android.statistics.histogram [dynamic, int32[], system]
+ *
+ * <p>A 3-channel histogram based on the raw
+ * sensor data</p>
+ */
+ ANDROID_STATISTICS_HISTOGRAM,
+ /**
+ * android.statistics.sharpnessMap [dynamic, int32[], system]
+ *
+ * <p>A 3-channel sharpness map, based on the raw
+ * sensor data</p>
+ */
+ ANDROID_STATISTICS_SHARPNESS_MAP,
+ /**
+ * android.statistics.lensShadingCorrectionMap [dynamic, byte, java_public]
+ *
+ * <p>The shading map is a low-resolution floating-point map
+ * that lists the coefficients used to correct for vignetting, for each
+ * Bayer color channel.</p>
+ */
+ ANDROID_STATISTICS_LENS_SHADING_CORRECTION_MAP,
+ /**
+ * android.statistics.lensShadingMap [dynamic, float[], ndk_public]
+ *
+ * <p>The shading map is a low-resolution floating-point map
+ * that lists the coefficients used to correct for vignetting and color shading,
+ * for each Bayer color channel of RAW image data.</p>
+ */
+ ANDROID_STATISTICS_LENS_SHADING_MAP,
+ /**
+ * android.statistics.predictedColorGains [dynamic, float[], hidden]
+ *
+ * <p>The best-fit color channel gains calculated
+ * by the camera device's statistics units for the current output frame.</p>
+ */
+ ANDROID_STATISTICS_PREDICTED_COLOR_GAINS,
+ /**
+ * android.statistics.predictedColorTransform [dynamic, rational[], hidden]
+ *
+ * <p>The best-fit color transform matrix estimate
+ * calculated by the camera device's statistics units for the current
+ * output frame.</p>
+ */
+ ANDROID_STATISTICS_PREDICTED_COLOR_TRANSFORM,
+ /**
+ * android.statistics.sceneFlicker [dynamic, enum, public]
+ *
+ * <p>The camera device estimated scene illumination lighting
+ * frequency.</p>
+ */
+ ANDROID_STATISTICS_SCENE_FLICKER,
+ /**
+ * android.statistics.hotPixelMap [dynamic, int32[], public]
+ *
+ * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
+ */
+ ANDROID_STATISTICS_HOT_PIXEL_MAP,
+ /**
+ * android.statistics.lensShadingMapMode [dynamic, enum, public]
+ *
+ * <p>Whether the camera device will output the lens
+ * shading map in output result metadata.</p>
+ */
+ ANDROID_STATISTICS_LENS_SHADING_MAP_MODE,
+ /**
+ * android.statistics.oisDataMode [dynamic, enum, public]
+ *
+ * <p>A control for selecting whether optical stabilization (OIS) position
+ * information is included in output result metadata.</p>
+ */
+ ANDROID_STATISTICS_OIS_DATA_MODE,
+ /**
+ * android.statistics.oisTimestamps [dynamic, int64[], ndk_public]
+ *
+ * <p>An array of timestamps of OIS samples, in nanoseconds.</p>
+ */
+ ANDROID_STATISTICS_OIS_TIMESTAMPS,
+ /**
+ * android.statistics.oisXShifts [dynamic, float[], ndk_public]
+ *
+ * <p>An array of shifts of OIS samples, in x direction.</p>
+ */
+ ANDROID_STATISTICS_OIS_X_SHIFTS,
+ /**
+ * android.statistics.oisYShifts [dynamic, float[], ndk_public]
+ *
+ * <p>An array of shifts of OIS samples, in y direction.</p>
+ */
+ ANDROID_STATISTICS_OIS_Y_SHIFTS,
+ /**
+ * android.statistics.info.availableFaceDetectModes [static, byte[], public]
+ *
+ * <p>List of face detection modes for ANDROID_STATISTICS_FACE_DETECT_MODE that are
+ * supported by this camera device.</p>
+ *
+ * @see ANDROID_STATISTICS_FACE_DETECT_MODE
+ */
+ ANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES = CameraMetadataSectionStart.ANDROID_STATISTICS_INFO_START,
+ /**
+ * android.statistics.info.histogramBucketCount [static, int32, system]
+ *
+ * <p>Number of histogram buckets
+ * supported</p>
+ */
+ ANDROID_STATISTICS_INFO_HISTOGRAM_BUCKET_COUNT,
+ /**
+ * android.statistics.info.maxFaceCount [static, int32, public]
+ *
+ * <p>The maximum number of simultaneously detectable
+ * faces.</p>
+ */
+ ANDROID_STATISTICS_INFO_MAX_FACE_COUNT,
+ /**
+ * android.statistics.info.maxHistogramCount [static, int32, system]
+ *
+ * <p>Maximum value possible for a histogram
+ * bucket</p>
+ */
+ ANDROID_STATISTICS_INFO_MAX_HISTOGRAM_COUNT,
+ /**
+ * android.statistics.info.maxSharpnessMapValue [static, int32, system]
+ *
+ * <p>Maximum value possible for a sharpness map
+ * region.</p>
+ */
+ ANDROID_STATISTICS_INFO_MAX_SHARPNESS_MAP_VALUE,
+ /**
+ * android.statistics.info.sharpnessMapSize [static, int32[], system]
+ *
+ * <p>Dimensions of the sharpness
+ * map</p>
+ */
+ ANDROID_STATISTICS_INFO_SHARPNESS_MAP_SIZE,
+ /**
+ * android.statistics.info.availableHotPixelMapModes [static, byte[], public]
+ *
+ * <p>List of hot pixel map output modes for ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE that are
+ * supported by this camera device.</p>
+ *
+ * @see ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE
+ */
+ ANDROID_STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES,
+ /**
+ * android.statistics.info.availableLensShadingMapModes [static, byte[], public]
+ *
+ * <p>List of lens shading map output modes for ANDROID_STATISTICS_LENS_SHADING_MAP_MODE that
+ * are supported by this camera device.</p>
+ *
+ * @see ANDROID_STATISTICS_LENS_SHADING_MAP_MODE
+ */
+ ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES,
+ /**
+ * android.statistics.info.availableOisDataModes [static, byte[], public]
+ *
+ * <p>List of OIS data output modes for ANDROID_STATISTICS_OIS_DATA_MODE that
+ * are supported by this camera device.</p>
+ *
+ * @see ANDROID_STATISTICS_OIS_DATA_MODE
+ */
+ ANDROID_STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES,
+ /**
+ * android.tonemap.curveBlue [dynamic, float[], ndk_public]
+ *
+ * <p>Tonemapping / contrast / gamma curve for the blue
+ * channel, to use when ANDROID_TONEMAP_MODE is
+ * CONTRAST_CURVE.</p>
+ *
+ * @see ANDROID_TONEMAP_MODE
+ */
+ ANDROID_TONEMAP_CURVE_BLUE = CameraMetadataSectionStart.ANDROID_TONEMAP_START,
+ /**
+ * android.tonemap.curveGreen [dynamic, float[], ndk_public]
+ *
+ * <p>Tonemapping / contrast / gamma curve for the green
+ * channel, to use when ANDROID_TONEMAP_MODE is
+ * CONTRAST_CURVE.</p>
+ *
+ * @see ANDROID_TONEMAP_MODE
+ */
+ ANDROID_TONEMAP_CURVE_GREEN,
+ /**
+ * android.tonemap.curveRed [dynamic, float[], ndk_public]
+ *
+ * <p>Tonemapping / contrast / gamma curve for the red
+ * channel, to use when ANDROID_TONEMAP_MODE is
+ * CONTRAST_CURVE.</p>
+ *
+ * @see ANDROID_TONEMAP_MODE
+ */
+ ANDROID_TONEMAP_CURVE_RED,
+ /**
+ * android.tonemap.mode [dynamic, enum, public]
+ *
+ * <p>High-level global contrast/gamma/tonemapping control.</p>
+ */
+ ANDROID_TONEMAP_MODE,
+ /**
+ * android.tonemap.maxCurvePoints [static, int32, public]
+ *
+ * <p>Maximum number of supported points in the
+ * tonemap curve that can be used for ANDROID_TONEMAP_CURVE.</p>
+ *
+ * @see ANDROID_TONEMAP_CURVE
+ */
+ ANDROID_TONEMAP_MAX_CURVE_POINTS,
+ /**
+ * android.tonemap.availableToneMapModes [static, byte[], public]
+ *
+ * <p>List of tonemapping modes for ANDROID_TONEMAP_MODE that are supported by this camera
+ * device.</p>
+ *
+ * @see ANDROID_TONEMAP_MODE
+ */
+ ANDROID_TONEMAP_AVAILABLE_TONE_MAP_MODES,
+ /**
+ * android.tonemap.gamma [dynamic, float, public]
+ *
+ * <p>Tonemapping curve to use when ANDROID_TONEMAP_MODE is
+ * GAMMA_VALUE</p>
+ *
+ * @see ANDROID_TONEMAP_MODE
+ */
+ ANDROID_TONEMAP_GAMMA,
+ /**
+ * android.tonemap.presetCurve [dynamic, enum, public]
+ *
+ * <p>Tonemapping curve to use when ANDROID_TONEMAP_MODE is
+ * PRESET_CURVE</p>
+ *
+ * @see ANDROID_TONEMAP_MODE
+ */
+ ANDROID_TONEMAP_PRESET_CURVE,
+ /**
+ * android.led.transmit [dynamic, enum, hidden]
+ *
+ * <p>This LED is nominally used to indicate to the user
+ * that the camera is powered on and may be streaming images back to the
+ * Application Processor. In certain rare circumstances, the OS may
+ * disable this when video is processed locally and not transmitted to
+ * any untrusted applications.</p>
+ * <p>In particular, the LED <em>must</em> always be on when the data could be
+ * transmitted off the device. The LED <em>should</em> always be on whenever
+ * data is stored locally on the device.</p>
+ * <p>The LED <em>may</em> be off if a trusted application is using the data that
+ * doesn't violate the above rules.</p>
+ */
+ ANDROID_LED_TRANSMIT = CameraMetadataSectionStart.ANDROID_LED_START,
+ /**
+ * android.led.availableLeds [static, enum[], hidden]
+ *
+ * <p>A list of camera LEDs that are available on this system.</p>
+ */
+ ANDROID_LED_AVAILABLE_LEDS,
+ /**
+ * android.info.supportedHardwareLevel [static, enum, public]
+ *
+ * <p>Generally classifies the overall set of the camera device functionality.</p>
+ */
+ ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL = CameraMetadataSectionStart.ANDROID_INFO_START,
+ /**
+ * android.info.version [static, byte, public]
+ *
+ * <p>A short string for manufacturer version information about the camera device, such as
+ * ISP hardware, sensors, etc.</p>
+ */
+ ANDROID_INFO_VERSION,
+ /**
+ * android.info.supportedBufferManagementVersion [static, enum, system]
+ *
+ * <p>The version of buffer management API this camera device supports and opts into.</p>
+ */
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION,
+ /**
+ * android.info.deviceStateOrientations [static, int64[], ndk_public]
+ */
+ ANDROID_INFO_DEVICE_STATE_ORIENTATIONS,
+ /**
+ * android.blackLevel.lock [dynamic, enum, public]
+ *
+ * <p>Whether black-level compensation is locked
+ * to its current values, or is free to vary.</p>
+ */
+ ANDROID_BLACK_LEVEL_LOCK = CameraMetadataSectionStart.ANDROID_BLACK_LEVEL_START,
+ /**
+ * android.sync.frameNumber [dynamic, enum, ndk_public]
+ *
+ * <p>The frame number corresponding to the last request
+ * with which the output result (metadata + buffers) has been fully
+ * synchronized.</p>
+ */
+ ANDROID_SYNC_FRAME_NUMBER = CameraMetadataSectionStart.ANDROID_SYNC_START,
+ /**
+ * android.sync.maxLatency [static, enum, public]
+ *
+ * <p>The maximum number of frames that can occur after a request
+ * (different than the previous) has been submitted, and before the
+ * result's state becomes synchronized.</p>
+ */
+ ANDROID_SYNC_MAX_LATENCY,
+ /**
+ * android.reprocess.effectiveExposureFactor [dynamic, float, java_public]
+ *
+ * <p>The amount of exposure time increase factor applied to the original output
+ * frame by the application processing before sending for reprocessing.</p>
+ */
+ ANDROID_REPROCESS_EFFECTIVE_EXPOSURE_FACTOR = CameraMetadataSectionStart.ANDROID_REPROCESS_START,
+ /**
+ * android.reprocess.maxCaptureStall [static, int32, java_public]
+ *
+ * <p>The maximal camera capture pipeline stall (in unit of frame count) introduced by a
+ * reprocess capture request.</p>
+ */
+ ANDROID_REPROCESS_MAX_CAPTURE_STALL,
+ /**
+ * android.depth.maxDepthSamples [static, int32, system]
+ *
+ * <p>Maximum number of points that a depth point cloud may contain.</p>
+ */
+ ANDROID_DEPTH_MAX_DEPTH_SAMPLES = CameraMetadataSectionStart.ANDROID_DEPTH_START,
+ /**
+ * android.depth.availableDepthStreamConfigurations [static, enum[], ndk_public]
+ *
+ * <p>The available depth dataspace stream
+ * configurations that this camera device supports
+ * (i.e. format, width, height, output/input stream).</p>
+ */
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS,
+ /**
+ * android.depth.availableDepthMinFrameDurations [static, int64[], ndk_public]
+ *
+ * <p>This lists the minimum frame duration for each
+ * format/size combination for depth output formats.</p>
+ */
+ ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS,
+ /**
+ * android.depth.availableDepthStallDurations [static, int64[], ndk_public]
+ *
+ * <p>This lists the maximum stall duration for each
+ * output format/size combination for depth streams.</p>
+ */
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS,
+ /**
+ * android.depth.depthIsExclusive [static, enum, public]
+ *
+ * <p>Indicates whether a capture request may target both a
+ * DEPTH16 / DEPTH_POINT_CLOUD output, and normal color outputs (such as
+ * YUV_420_888, JPEG, or RAW) simultaneously.</p>
+ */
+ ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE,
+ /**
+ * android.depth.availableRecommendedDepthStreamConfigurations [static, int32[], ndk_public]
+ *
+ * <p>Recommended depth stream configurations for common client use cases.</p>
+ */
+ ANDROID_DEPTH_AVAILABLE_RECOMMENDED_DEPTH_STREAM_CONFIGURATIONS,
+ /**
+ * android.depth.availableDynamicDepthStreamConfigurations [static, enum[], ndk_public]
+ *
+ * <p>The available dynamic depth dataspace stream
+ * configurations that this camera device supports
+ * (i.e. format, width, height, output/input stream).</p>
+ */
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS,
+ /**
+ * android.depth.availableDynamicDepthMinFrameDurations [static, int64[], ndk_public]
+ *
+ * <p>This lists the minimum frame duration for each
+ * format/size combination for dynamic depth output streams.</p>
+ */
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS,
+ /**
+ * android.depth.availableDynamicDepthStallDurations [static, int64[], ndk_public]
+ *
+ * <p>This lists the maximum stall duration for each
+ * output format/size combination for dynamic depth streams.</p>
+ */
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS,
+ /**
+ * android.depth.availableDepthStreamConfigurationsMaximumResolution [static, enum[], ndk_public]
+ *
+ * <p>The available depth dataspace stream
+ * configurations that this camera device supports
+ * (i.e. format, width, height, output/input stream) when a CaptureRequest is submitted with
+ * ANDROID_SENSOR_PIXEL_MODE set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION,
+ /**
+ * android.depth.availableDepthMinFrameDurationsMaximumResolution [static, int64[], ndk_public]
+ *
+ * <p>This lists the minimum frame duration for each
+ * format/size combination for depth output formats when a CaptureRequest is submitted with
+ * ANDROID_SENSOR_PIXEL_MODE set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION,
+ /**
+ * android.depth.availableDepthStallDurationsMaximumResolution [static, int64[], ndk_public]
+ *
+ * <p>This lists the maximum stall duration for each
+ * output format/size combination for depth streams for CaptureRequests where
+ * ANDROID_SENSOR_PIXEL_MODE is set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS_MAXIMUM_RESOLUTION,
+ /**
+ * android.depth.availableDynamicDepthStreamConfigurationsMaximumResolution [static, enum[], ndk_public]
+ *
+ * <p>The available dynamic depth dataspace stream
+ * configurations that this camera device supports (i.e. format, width, height,
+ * output/input stream) for CaptureRequests where ANDROID_SENSOR_PIXEL_MODE is set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION,
+ /**
+ * android.depth.availableDynamicDepthMinFrameDurationsMaximumResolution [static, int64[], ndk_public]
+ *
+ * <p>This lists the minimum frame duration for each
+ * format/size combination for dynamic depth output streams for CaptureRequests where
+ * ANDROID_SENSOR_PIXEL_MODE is set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION,
+ /**
+ * android.depth.availableDynamicDepthStallDurationsMaximumResolution [static, int64[], ndk_public]
+ *
+ * <p>This lists the maximum stall duration for each
+ * output format/size combination for dynamic depth streams for CaptureRequests where
+ * ANDROID_SENSOR_PIXEL_MODE is set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS_MAXIMUM_RESOLUTION,
+ /**
+ * android.logicalMultiCamera.physicalIds [static, byte[], ndk_public]
+ *
+ * <p>String containing the ids of the underlying physical cameras.</p>
+ */
+ ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS = CameraMetadataSectionStart.ANDROID_LOGICAL_MULTI_CAMERA_START,
+ /**
+ * android.logicalMultiCamera.sensorSyncType [static, enum, public]
+ *
+ * <p>The accuracy of frame timestamp synchronization between physical cameras</p>
+ */
+ ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE,
+ /**
+ * android.logicalMultiCamera.activePhysicalId [dynamic, byte, public]
+ *
+ * <p>String containing the ID of the underlying active physical camera.</p>
+ */
+ ANDROID_LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID,
+ /**
+ * android.distortionCorrection.mode [dynamic, enum, public]
+ *
+ * <p>Mode of operation for the lens distortion correction block.</p>
+ */
+ ANDROID_DISTORTION_CORRECTION_MODE = CameraMetadataSectionStart.ANDROID_DISTORTION_CORRECTION_START,
+ /**
+ * android.distortionCorrection.availableModes [static, byte[], public]
+ *
+ * <p>List of distortion correction modes for ANDROID_DISTORTION_CORRECTION_MODE that are
+ * supported by this camera device.</p>
+ *
+ * @see ANDROID_DISTORTION_CORRECTION_MODE
+ */
+ ANDROID_DISTORTION_CORRECTION_AVAILABLE_MODES,
+ /**
+ * android.heic.availableHeicStreamConfigurations [static, enum[], ndk_public]
+ *
+ * <p>The available HEIC (ISO/IEC 23008-12) stream
+ * configurations that this camera device supports
+ * (i.e. format, width, height, output/input stream).</p>
+ */
+ ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS = CameraMetadataSectionStart.ANDROID_HEIC_START,
+ /**
+ * android.heic.availableHeicMinFrameDurations [static, int64[], ndk_public]
+ *
+ * <p>This lists the minimum frame duration for each
+ * format/size combination for HEIC output formats.</p>
+ */
+ ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS,
+ /**
+ * android.heic.availableHeicStallDurations [static, int64[], ndk_public]
+ *
+ * <p>This lists the maximum stall duration for each
+ * output format/size combination for HEIC streams.</p>
+ */
+ ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS,
+ /**
+ * android.heic.availableHeicStreamConfigurationsMaximumResolution [static, enum[], ndk_public]
+ *
+ * <p>The available HEIC (ISO/IEC 23008-12) stream
+ * configurations that this camera device supports
+ * (i.e. format, width, height, output/input stream).</p>
+ */
+ ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION,
+ /**
+ * android.heic.availableHeicMinFrameDurationsMaximumResolution [static, int64[], ndk_public]
+ *
+ * <p>This lists the minimum frame duration for each
+ * format/size combination for HEIC output formats for CaptureRequests where
+ * ANDROID_SENSOR_PIXEL_MODE is set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION,
+ /**
+ * android.heic.availableHeicStallDurationsMaximumResolution [static, int64[], ndk_public]
+ *
+ * <p>This lists the maximum stall duration for each
+ * output format/size combination for HEIC streams for CaptureRequests where
+ * ANDROID_SENSOR_PIXEL_MODE is set to
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
+ *
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+ ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS_MAXIMUM_RESOLUTION,
+ /**
+ * android.heic.info.supported [static, enum, system]
+ *
+ * <p>Whether this camera device can support identical set of stream combinations
+ * involving HEIC image format, compared to the
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice.html#createCaptureSession">table of combinations</a>
+ * involving JPEG image format required for the device's hardware level and capabilities.</p>
+ */
+ ANDROID_HEIC_INFO_SUPPORTED = CameraMetadataSectionStart.ANDROID_HEIC_INFO_START,
+ /**
+ * android.heic.info.maxJpegAppSegmentsCount [static, byte, system]
+ *
+ * <p>The maximum number of Jpeg APP segments supported by the camera HAL device.</p>
+ */
+ ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl
new file mode 100644
index 0000000..890ac0e
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.colorCorrection.aberrationMode enumeration values
+ * @see ANDROID_COLOR_CORRECTION_ABERRATION_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum ColorCorrectionAberrationMode {
+ ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF,
+ ANDROID_COLOR_CORRECTION_ABERRATION_MODE_FAST,
+ ANDROID_COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.aidl
new file mode 100644
index 0000000..33a0879
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/*
+ * Enumeration definitions for the various entries that need them
+ *
+ *
+ * android.colorCorrection.mode enumeration values
+ * @see ANDROID_COLOR_CORRECTION_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum ColorCorrectionMode {
+ ANDROID_COLOR_CORRECTION_MODE_TRANSFORM_MATRIX,
+ ANDROID_COLOR_CORRECTION_MODE_FAST,
+ ANDROID_COLOR_CORRECTION_MODE_HIGH_QUALITY,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl
new file mode 100644
index 0000000..8a2f501
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.aeAntibandingMode enumeration values
+ * @see ANDROID_CONTROL_AE_ANTIBANDING_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlAeAntibandingMode {
+ ANDROID_CONTROL_AE_ANTIBANDING_MODE_OFF,
+ ANDROID_CONTROL_AE_ANTIBANDING_MODE_50HZ,
+ ANDROID_CONTROL_AE_ANTIBANDING_MODE_60HZ,
+ ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO,
+}
diff --git a/audio/7.1/IStreamIn.hal b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLock.aidl
similarity index 60%
copy from audio/7.1/IStreamIn.hal
copy to camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLock.aidl
index abebe6a..ab56fdc 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLock.aidl
@@ -14,9 +14,21 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
-import @7.0::IStreamIn;
+package android.hardware.camera.metadata;
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * android.control.aeLock enumeration values
+ * @see ANDROID_CONTROL_AE_LOCK
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlAeLock {
+ ANDROID_CONTROL_AE_LOCK_OFF,
+ ANDROID_CONTROL_AE_LOCK_ON,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLockAvailable.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLockAvailable.aidl
new file mode 100644
index 0000000..b846fc1
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLockAvailable.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.aeLockAvailable enumeration values
+ * @see ANDROID_CONTROL_AE_LOCK_AVAILABLE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlAeLockAvailable {
+ ANDROID_CONTROL_AE_LOCK_AVAILABLE_FALSE,
+ ANDROID_CONTROL_AE_LOCK_AVAILABLE_TRUE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl
new file mode 100644
index 0000000..9a9d5bc
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/*
+ * Enumeration definitions for the various entries that need them
+ *
+ *
+ * android.control.aeMode enumeration values added
+ * @see ANDROID_CONTROL_AE_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlAeMode {
+ ANDROID_CONTROL_AE_MODE_OFF,
+ ANDROID_CONTROL_AE_MODE_ON,
+ ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH,
+ ANDROID_CONTROL_AE_MODE_ON_ALWAYS_FLASH,
+ ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE,
+ ANDROID_CONTROL_AE_MODE_ON_EXTERNAL_FLASH,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl
new file mode 100644
index 0000000..2229712
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.aePrecaptureTrigger enumeration values
+ * @see ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlAePrecaptureTrigger {
+ ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_IDLE,
+ ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_START,
+ ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeState.aidl
new file mode 100644
index 0000000..af8c2cf
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeState.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.aeState enumeration values
+ * @see ANDROID_CONTROL_AE_STATE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlAeState {
+ ANDROID_CONTROL_AE_STATE_INACTIVE,
+ ANDROID_CONTROL_AE_STATE_SEARCHING,
+ ANDROID_CONTROL_AE_STATE_CONVERGED,
+ ANDROID_CONTROL_AE_STATE_LOCKED,
+ ANDROID_CONTROL_AE_STATE_FLASH_REQUIRED,
+ ANDROID_CONTROL_AE_STATE_PRECAPTURE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfMode.aidl
new file mode 100644
index 0000000..344f2de
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfMode.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.afMode enumeration values
+ * @see ANDROID_CONTROL_AF_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlAfMode {
+ ANDROID_CONTROL_AF_MODE_OFF,
+ ANDROID_CONTROL_AF_MODE_AUTO,
+ ANDROID_CONTROL_AF_MODE_MACRO,
+ ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO,
+ ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE,
+ ANDROID_CONTROL_AF_MODE_EDOF,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfSceneChange.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfSceneChange.aidl
new file mode 100644
index 0000000..153611a
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfSceneChange.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.afSceneChange enumeration values
+ * @see ANDROID_CONTROL_AF_SCENE_CHANGE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlAfSceneChange {
+ ANDROID_CONTROL_AF_SCENE_CHANGE_NOT_DETECTED,
+ ANDROID_CONTROL_AF_SCENE_CHANGE_DETECTED,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfState.aidl
new file mode 100644
index 0000000..2c8d602
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfState.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.afState enumeration values
+ * @see ANDROID_CONTROL_AF_STATE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlAfState {
+ ANDROID_CONTROL_AF_STATE_INACTIVE,
+ ANDROID_CONTROL_AF_STATE_PASSIVE_SCAN,
+ ANDROID_CONTROL_AF_STATE_PASSIVE_FOCUSED,
+ ANDROID_CONTROL_AF_STATE_ACTIVE_SCAN,
+ ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED,
+ ANDROID_CONTROL_AF_STATE_NOT_FOCUSED_LOCKED,
+ ANDROID_CONTROL_AF_STATE_PASSIVE_UNFOCUSED,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfTrigger.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfTrigger.aidl
new file mode 100644
index 0000000..b68d4c7
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfTrigger.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.afTrigger enumeration values
+ * @see ANDROID_CONTROL_AF_TRIGGER
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlAfTrigger {
+ ANDROID_CONTROL_AF_TRIGGER_IDLE,
+ ANDROID_CONTROL_AF_TRIGGER_START,
+ ANDROID_CONTROL_AF_TRIGGER_CANCEL,
+}
diff --git a/audio/7.1/IStreamIn.hal b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLock.aidl
similarity index 60%
copy from audio/7.1/IStreamIn.hal
copy to camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLock.aidl
index abebe6a..f7229f2 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLock.aidl
@@ -14,9 +14,21 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
-import @7.0::IStreamIn;
+package android.hardware.camera.metadata;
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * android.control.awbLock enumeration values
+ * @see ANDROID_CONTROL_AWB_LOCK
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlAwbLock {
+ ANDROID_CONTROL_AWB_LOCK_OFF,
+ ANDROID_CONTROL_AWB_LOCK_ON,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl
new file mode 100644
index 0000000..0cb6ebe
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.awbLockAvailable enumeration values
+ * @see ANDROID_CONTROL_AWB_LOCK_AVAILABLE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlAwbLockAvailable {
+ ANDROID_CONTROL_AWB_LOCK_AVAILABLE_FALSE,
+ ANDROID_CONTROL_AWB_LOCK_AVAILABLE_TRUE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbMode.aidl
new file mode 100644
index 0000000..2f9b801
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbMode.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.awbMode enumeration values
+ * @see ANDROID_CONTROL_AWB_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlAwbMode {
+ ANDROID_CONTROL_AWB_MODE_OFF,
+ ANDROID_CONTROL_AWB_MODE_AUTO,
+ ANDROID_CONTROL_AWB_MODE_INCANDESCENT,
+ ANDROID_CONTROL_AWB_MODE_FLUORESCENT,
+ ANDROID_CONTROL_AWB_MODE_WARM_FLUORESCENT,
+ ANDROID_CONTROL_AWB_MODE_DAYLIGHT,
+ ANDROID_CONTROL_AWB_MODE_CLOUDY_DAYLIGHT,
+ ANDROID_CONTROL_AWB_MODE_TWILIGHT,
+ ANDROID_CONTROL_AWB_MODE_SHADE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbState.aidl
new file mode 100644
index 0000000..1a93191
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbState.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.awbState enumeration values
+ * @see ANDROID_CONTROL_AWB_STATE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlAwbState {
+ ANDROID_CONTROL_AWB_STATE_INACTIVE,
+ ANDROID_CONTROL_AWB_STATE_SEARCHING,
+ ANDROID_CONTROL_AWB_STATE_CONVERGED,
+ ANDROID_CONTROL_AWB_STATE_LOCKED,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlCaptureIntent.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlCaptureIntent.aidl
new file mode 100644
index 0000000..132d98c
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlCaptureIntent.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.captureIntent enumeration values
+ * @see ANDROID_CONTROL_CAPTURE_INTENT
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlCaptureIntent {
+ ANDROID_CONTROL_CAPTURE_INTENT_CUSTOM,
+ ANDROID_CONTROL_CAPTURE_INTENT_PREVIEW,
+ ANDROID_CONTROL_CAPTURE_INTENT_STILL_CAPTURE,
+ ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_RECORD,
+ ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT,
+ ANDROID_CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG,
+ ANDROID_CONTROL_CAPTURE_INTENT_MANUAL,
+ ANDROID_CONTROL_CAPTURE_INTENT_MOTION_TRACKING,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlEffectMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlEffectMode.aidl
new file mode 100644
index 0000000..1668cb3
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlEffectMode.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.effectMode enumeration values
+ * @see ANDROID_CONTROL_EFFECT_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlEffectMode {
+ ANDROID_CONTROL_EFFECT_MODE_OFF,
+ ANDROID_CONTROL_EFFECT_MODE_MONO,
+ ANDROID_CONTROL_EFFECT_MODE_NEGATIVE,
+ ANDROID_CONTROL_EFFECT_MODE_SOLARIZE,
+ ANDROID_CONTROL_EFFECT_MODE_SEPIA,
+ ANDROID_CONTROL_EFFECT_MODE_POSTERIZE,
+ ANDROID_CONTROL_EFFECT_MODE_WHITEBOARD,
+ ANDROID_CONTROL_EFFECT_MODE_BLACKBOARD,
+ ANDROID_CONTROL_EFFECT_MODE_AQUA,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlEnableZsl.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlEnableZsl.aidl
new file mode 100644
index 0000000..a83c051
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlEnableZsl.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.enableZsl enumeration values
+ * @see ANDROID_CONTROL_ENABLE_ZSL
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlEnableZsl {
+ ANDROID_CONTROL_ENABLE_ZSL_FALSE,
+ ANDROID_CONTROL_ENABLE_ZSL_TRUE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl
new file mode 100644
index 0000000..2fe66cf
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.extendedSceneMode enumeration values
+ * @see ANDROID_CONTROL_EXTENDED_SCENE_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlExtendedSceneMode {
+ ANDROID_CONTROL_EXTENDED_SCENE_MODE_DISABLED = 0,
+ ANDROID_CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE,
+ ANDROID_CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS,
+ ANDROID_CONTROL_EXTENDED_SCENE_MODE_VENDOR_START = 0x40,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.aidl
new file mode 100644
index 0000000..047556d
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/*
+ * Enumeration definitions for the various entries that need them
+ *
+ *
+ * android.control.mode enumeration values
+ * @see ANDROID_CONTROL_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlMode {
+ ANDROID_CONTROL_MODE_OFF,
+ ANDROID_CONTROL_MODE_AUTO,
+ ANDROID_CONTROL_MODE_USE_SCENE_MODE,
+ ANDROID_CONTROL_MODE_OFF_KEEP_STATE,
+ ANDROID_CONTROL_MODE_USE_EXTENDED_SCENE_MODE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlSceneMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlSceneMode.aidl
new file mode 100644
index 0000000..0f90aaa
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlSceneMode.aidl
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.sceneMode enumeration values
+ * @see ANDROID_CONTROL_SCENE_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlSceneMode {
+ ANDROID_CONTROL_SCENE_MODE_DISABLED = 0,
+ ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY,
+ ANDROID_CONTROL_SCENE_MODE_ACTION,
+ ANDROID_CONTROL_SCENE_MODE_PORTRAIT,
+ ANDROID_CONTROL_SCENE_MODE_LANDSCAPE,
+ ANDROID_CONTROL_SCENE_MODE_NIGHT,
+ ANDROID_CONTROL_SCENE_MODE_NIGHT_PORTRAIT,
+ ANDROID_CONTROL_SCENE_MODE_THEATRE,
+ ANDROID_CONTROL_SCENE_MODE_BEACH,
+ ANDROID_CONTROL_SCENE_MODE_SNOW,
+ ANDROID_CONTROL_SCENE_MODE_SUNSET,
+ ANDROID_CONTROL_SCENE_MODE_STEADYPHOTO,
+ ANDROID_CONTROL_SCENE_MODE_FIREWORKS,
+ ANDROID_CONTROL_SCENE_MODE_SPORTS,
+ ANDROID_CONTROL_SCENE_MODE_PARTY,
+ ANDROID_CONTROL_SCENE_MODE_CANDLELIGHT,
+ ANDROID_CONTROL_SCENE_MODE_BARCODE,
+ ANDROID_CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO,
+ ANDROID_CONTROL_SCENE_MODE_HDR,
+ ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY_LOW_LIGHT,
+ ANDROID_CONTROL_SCENE_MODE_DEVICE_CUSTOM_START = 100,
+ ANDROID_CONTROL_SCENE_MODE_DEVICE_CUSTOM_END = 127,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl
new file mode 100644
index 0000000..4046c4e
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/*
+ * Enumeration definitions for the various entries that need them
+ *
+ *
+ * android.control.videoStabilizationMode enumeration values
+ * @see ANDROID_CONTROL_VIDEO_STABILIZATION_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlVideoStabilizationMode {
+ ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF,
+ ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_ON,
+ ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION,
+}
diff --git a/audio/7.1/IStreamIn.hal b/camera/metadata/aidl/android/hardware/camera/metadata/DemosaicMode.aidl
similarity index 60%
copy from audio/7.1/IStreamIn.hal
copy to camera/metadata/aidl/android/hardware/camera/metadata/DemosaicMode.aidl
index abebe6a..7d8cdcf 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DemosaicMode.aidl
@@ -14,9 +14,21 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
-import @7.0::IStreamIn;
+package android.hardware.camera.metadata;
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * android.demosaic.mode enumeration values
+ * @see ANDROID_DEMOSAIC_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum DemosaicMode {
+ ANDROID_DEMOSAIC_MODE_FAST,
+ ANDROID_DEMOSAIC_MODE_HIGH_QUALITY,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl
new file mode 100644
index 0000000..7deb350
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.depth.availableDepthStreamConfigurations enumeration values
+ * @see ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS
+ */
+@VintfStability
+@Backing(type="int")
+enum DepthAvailableDepthStreamConfigurations {
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT,
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_INPUT,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl
new file mode 100644
index 0000000..5d06be1
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.depth.availableDepthStreamConfigurationsMaximumResolution enumeration values
+ * @see ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION
+ */
+@VintfStability
+@Backing(type="int")
+enum DepthAvailableDepthStreamConfigurationsMaximumResolution {
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT,
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl
new file mode 100644
index 0000000..39a99b9
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.depth.availableDynamicDepthStreamConfigurations enumeration values
+ * @see ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS
+ */
+@VintfStability
+@Backing(type="int")
+enum DepthAvailableDynamicDepthStreamConfigurations {
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_OUTPUT,
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_INPUT,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl
new file mode 100644
index 0000000..30ea9b7
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.depth.availableDynamicDepthStreamConfigurationsMaximumResolution enumeration values
+ * @see ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION
+ */
+@VintfStability
+@Backing(type="int")
+enum DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution {
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT,
+ ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl
new file mode 100644
index 0000000..4af81d9
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.depth.depthIsExclusive enumeration values
+ * @see ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE
+ */
+@VintfStability
+@Backing(type="int")
+enum DepthDepthIsExclusive {
+ ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE_FALSE,
+ ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE_TRUE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DistortionCorrectionMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DistortionCorrectionMode.aidl
new file mode 100644
index 0000000..3456207
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DistortionCorrectionMode.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.distortionCorrection.mode enumeration values
+ * @see ANDROID_DISTORTION_CORRECTION_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum DistortionCorrectionMode {
+ ANDROID_DISTORTION_CORRECTION_MODE_OFF,
+ ANDROID_DISTORTION_CORRECTION_MODE_FAST,
+ ANDROID_DISTORTION_CORRECTION_MODE_HIGH_QUALITY,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/EdgeMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/EdgeMode.aidl
new file mode 100644
index 0000000..1e15523
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/EdgeMode.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.edge.mode enumeration values
+ * @see ANDROID_EDGE_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum EdgeMode {
+ ANDROID_EDGE_MODE_OFF,
+ ANDROID_EDGE_MODE_FAST,
+ ANDROID_EDGE_MODE_HIGH_QUALITY,
+ ANDROID_EDGE_MODE_ZERO_SHUTTER_LAG,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/FlashInfoAvailable.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/FlashInfoAvailable.aidl
new file mode 100644
index 0000000..0528037
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/FlashInfoAvailable.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.flash.info.available enumeration values
+ * @see ANDROID_FLASH_INFO_AVAILABLE
+ */
+@VintfStability
+@Backing(type="int")
+enum FlashInfoAvailable {
+ ANDROID_FLASH_INFO_AVAILABLE_FALSE,
+ ANDROID_FLASH_INFO_AVAILABLE_TRUE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/FlashMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/FlashMode.aidl
new file mode 100644
index 0000000..e175596
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/FlashMode.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.flash.mode enumeration values
+ * @see ANDROID_FLASH_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum FlashMode {
+ ANDROID_FLASH_MODE_OFF,
+ ANDROID_FLASH_MODE_SINGLE,
+ ANDROID_FLASH_MODE_TORCH,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/FlashState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/FlashState.aidl
new file mode 100644
index 0000000..fc398f8
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/FlashState.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.flash.state enumeration values
+ * @see ANDROID_FLASH_STATE
+ */
+@VintfStability
+@Backing(type="int")
+enum FlashState {
+ ANDROID_FLASH_STATE_UNAVAILABLE,
+ ANDROID_FLASH_STATE_CHARGING,
+ ANDROID_FLASH_STATE_READY,
+ ANDROID_FLASH_STATE_FIRED,
+ ANDROID_FLASH_STATE_PARTIAL,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl
new file mode 100644
index 0000000..fc9b6ec
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.heic.availableHeicStreamConfigurations enumeration values
+ * @see ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS
+ */
+@VintfStability
+@Backing(type="int")
+enum HeicAvailableHeicStreamConfigurations {
+ ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_OUTPUT,
+ ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_INPUT,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl
new file mode 100644
index 0000000..13b50ab
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.heic.availableHeicStreamConfigurationsMaximumResolution enumeration values
+ * @see ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION
+ */
+@VintfStability
+@Backing(type="int")
+enum HeicAvailableHeicStreamConfigurationsMaximumResolution {
+ ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT,
+ ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/HeicInfoSupported.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/HeicInfoSupported.aidl
new file mode 100644
index 0000000..c4e04f1
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/HeicInfoSupported.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.heic.info.supported enumeration values
+ * @see ANDROID_HEIC_INFO_SUPPORTED
+ */
+@VintfStability
+@Backing(type="int")
+enum HeicInfoSupported {
+ ANDROID_HEIC_INFO_SUPPORTED_FALSE,
+ ANDROID_HEIC_INFO_SUPPORTED_TRUE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/HotPixelMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/HotPixelMode.aidl
new file mode 100644
index 0000000..7b7aa21
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/HotPixelMode.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.hotPixel.mode enumeration values
+ * @see ANDROID_HOT_PIXEL_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum HotPixelMode {
+ ANDROID_HOT_PIXEL_MODE_OFF,
+ ANDROID_HOT_PIXEL_MODE_FAST,
+ ANDROID_HOT_PIXEL_MODE_HIGH_QUALITY,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl
new file mode 100644
index 0000000..9522377
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.info.supportedBufferManagementVersion enumeration values
+ * @see ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION
+ */
+@VintfStability
+@Backing(type="int")
+enum InfoSupportedBufferManagementVersion {
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_AIDL_DEVICE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl
new file mode 100644
index 0000000..f242009
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.info.supportedHardwareLevel enumeration values
+ * @see ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL
+ */
+@VintfStability
+@Backing(type="int")
+enum InfoSupportedHardwareLevel {
+ ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED,
+ ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL,
+ ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY,
+ ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_3,
+ ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL,
+}
diff --git a/audio/7.1/IStreamIn.hal b/camera/metadata/aidl/android/hardware/camera/metadata/LedAvailableLeds.aidl
similarity index 61%
copy from audio/7.1/IStreamIn.hal
copy to camera/metadata/aidl/android/hardware/camera/metadata/LedAvailableLeds.aidl
index abebe6a..f26fcde 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LedAvailableLeds.aidl
@@ -14,9 +14,20 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
-import @7.0::IStreamIn;
+package android.hardware.camera.metadata;
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * android.led.availableLeds enumeration values
+ * @see ANDROID_LED_AVAILABLE_LEDS
+ */
+@VintfStability
+@Backing(type="int")
+enum LedAvailableLeds {
+ ANDROID_LED_AVAILABLE_LEDS_TRANSMIT,
+}
diff --git a/audio/7.1/IStreamIn.hal b/camera/metadata/aidl/android/hardware/camera/metadata/LedTransmit.aidl
similarity index 61%
copy from audio/7.1/IStreamIn.hal
copy to camera/metadata/aidl/android/hardware/camera/metadata/LedTransmit.aidl
index abebe6a..62c9bd7 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LedTransmit.aidl
@@ -14,9 +14,21 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
-import @7.0::IStreamIn;
+package android.hardware.camera.metadata;
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * android.led.transmit enumeration values
+ * @see ANDROID_LED_TRANSMIT
+ */
+@VintfStability
+@Backing(type="int")
+enum LedTransmit {
+ ANDROID_LED_TRANSMIT_OFF,
+ ANDROID_LED_TRANSMIT_ON,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensFacing.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensFacing.aidl
new file mode 100644
index 0000000..0677ea9
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensFacing.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.lens.facing enumeration values
+ * @see ANDROID_LENS_FACING
+ */
+@VintfStability
+@Backing(type="int")
+enum LensFacing {
+ ANDROID_LENS_FACING_FRONT,
+ ANDROID_LENS_FACING_BACK,
+ ANDROID_LENS_FACING_EXTERNAL,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl
new file mode 100644
index 0000000..1c82bb0
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.lens.info.focusDistanceCalibration enumeration values
+ * @see ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION
+ */
+@VintfStability
+@Backing(type="int")
+enum LensInfoFocusDistanceCalibration {
+ ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED,
+ ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE,
+ ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl
new file mode 100644
index 0000000..e350e15
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.lens.opticalStabilizationMode enumeration values
+ * @see ANDROID_LENS_OPTICAL_STABILIZATION_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum LensOpticalStabilizationMode {
+ ANDROID_LENS_OPTICAL_STABILIZATION_MODE_OFF,
+ ANDROID_LENS_OPTICAL_STABILIZATION_MODE_ON,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl
new file mode 100644
index 0000000..ca18676
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.lens.poseReference enumeration values
+ * @see ANDROID_LENS_POSE_REFERENCE
+ */
+@VintfStability
+@Backing(type="int")
+enum LensPoseReference {
+ ANDROID_LENS_POSE_REFERENCE_PRIMARY_CAMERA,
+ ANDROID_LENS_POSE_REFERENCE_GYROSCOPE,
+ ANDROID_LENS_POSE_REFERENCE_UNDEFINED,
+}
diff --git a/audio/7.1/IStreamIn.hal b/camera/metadata/aidl/android/hardware/camera/metadata/LensState.aidl
similarity index 61%
copy from audio/7.1/IStreamIn.hal
copy to camera/metadata/aidl/android/hardware/camera/metadata/LensState.aidl
index abebe6a..0e5a04c 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensState.aidl
@@ -14,9 +14,21 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
-import @7.0::IStreamIn;
+package android.hardware.camera.metadata;
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * android.lens.state enumeration values
+ * @see ANDROID_LENS_STATE
+ */
+@VintfStability
+@Backing(type="int")
+enum LensState {
+ ANDROID_LENS_STATE_STATIONARY,
+ ANDROID_LENS_STATE_MOVING,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl
new file mode 100644
index 0000000..623a15c
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.logicalMultiCamera.sensorSyncType enumeration values
+ * @see ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE
+ */
+@VintfStability
+@Backing(type="int")
+enum LogicalMultiCameraSensorSyncType {
+ ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE,
+ ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/NoiseReductionMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/NoiseReductionMode.aidl
new file mode 100644
index 0000000..947361d
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/NoiseReductionMode.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.noiseReduction.mode enumeration values
+ * @see ANDROID_NOISE_REDUCTION_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum NoiseReductionMode {
+ ANDROID_NOISE_REDUCTION_MODE_OFF,
+ ANDROID_NOISE_REDUCTION_MODE_FAST,
+ ANDROID_NOISE_REDUCTION_MODE_HIGH_QUALITY,
+ ANDROID_NOISE_REDUCTION_MODE_MINIMAL,
+ ANDROID_NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/QuirksPartialResult.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/QuirksPartialResult.aidl
new file mode 100644
index 0000000..15a79b0
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/QuirksPartialResult.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.quirks.partialResult enumeration values
+ * @see ANDROID_QUIRKS_PARTIAL_RESULT
+ */
+@VintfStability
+@Backing(type="int")
+enum QuirksPartialResult {
+ ANDROID_QUIRKS_PARTIAL_RESULT_FINAL,
+ ANDROID_QUIRKS_PARTIAL_RESULT_PARTIAL,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl
new file mode 100644
index 0000000..89f14ad
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.request.availableCapabilities enumeration values
+ * @see ANDROID_REQUEST_AVAILABLE_CAPABILITIES
+ */
+@VintfStability
+@Backing(type="int")
+enum RequestAvailableCapabilities {
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_OFFLINE_PROCESSING,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_REMOSAIC_REPROCESSING,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl
new file mode 100644
index 0000000..c0ef8c6
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.request.availableDynamicRangeProfilesMap enumeration values
+ * @see ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP
+ */
+@VintfStability
+@Backing(type="int")
+enum RequestAvailableDynamicRangeProfilesMap {
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD = 0x1,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10 = 0x2,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10 = 0x4,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS = 0x8,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF = 0x10,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO = 0x20,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM = 0x40,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO = 0x80,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF = 0x100,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO = 0x200,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM = 0x400,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO = 0x800,
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_MAX = 0x1000,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestMetadataMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestMetadataMode.aidl
new file mode 100644
index 0000000..37d4095
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestMetadataMode.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.request.metadataMode enumeration values
+ * @see ANDROID_REQUEST_METADATA_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum RequestMetadataMode {
+ ANDROID_REQUEST_METADATA_MODE_NONE,
+ ANDROID_REQUEST_METADATA_MODE_FULL,
+}
diff --git a/audio/7.1/IStreamIn.hal b/camera/metadata/aidl/android/hardware/camera/metadata/RequestType.aidl
similarity index 60%
copy from audio/7.1/IStreamIn.hal
copy to camera/metadata/aidl/android/hardware/camera/metadata/RequestType.aidl
index abebe6a..5010a37 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestType.aidl
@@ -14,9 +14,21 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
-import @7.0::IStreamIn;
+package android.hardware.camera.metadata;
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * android.request.type enumeration values
+ * @see ANDROID_REQUEST_TYPE
+ */
+@VintfStability
+@Backing(type="int")
+enum RequestType {
+ ANDROID_REQUEST_TYPE_CAPTURE,
+ ANDROID_REQUEST_TYPE_REPROCESS,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableFormats.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableFormats.aidl
new file mode 100644
index 0000000..a8e67bb
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableFormats.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.scaler.availableFormats enumeration values
+ * @see ANDROID_SCALER_AVAILABLE_FORMATS
+ */
+@VintfStability
+@Backing(type="int")
+enum ScalerAvailableFormats {
+ ANDROID_SCALER_AVAILABLE_FORMATS_RAW16 = 0x20,
+ ANDROID_SCALER_AVAILABLE_FORMATS_RAW_OPAQUE = 0x24,
+ ANDROID_SCALER_AVAILABLE_FORMATS_YV12 = 0x32315659,
+ ANDROID_SCALER_AVAILABLE_FORMATS_YCrCb_420_SP = 0x11,
+ ANDROID_SCALER_AVAILABLE_FORMATS_IMPLEMENTATION_DEFINED = 0x22,
+ ANDROID_SCALER_AVAILABLE_FORMATS_YCbCr_420_888 = 0x23,
+ ANDROID_SCALER_AVAILABLE_FORMATS_BLOB = 0x21,
+ ANDROID_SCALER_AVAILABLE_FORMATS_RAW10 = 0x25,
+ ANDROID_SCALER_AVAILABLE_FORMATS_RAW12 = 0x26,
+ ANDROID_SCALER_AVAILABLE_FORMATS_Y8 = 0x20203859,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl
new file mode 100644
index 0000000..57c3989
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.scaler.availableRecommendedStreamConfigurations enumeration values
+ * @see ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS
+ */
+@VintfStability
+@Backing(type="int")
+enum ScalerAvailableRecommendedStreamConfigurations {
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PREVIEW = 0x0,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RECORD = 0x1,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VIDEO_SNAPSHOT = 0x2,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_SNAPSHOT = 0x3,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_ZSL = 0x4,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RAW = 0x5,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_LOW_LATENCY_SNAPSHOT = 0x6,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_10BIT_OUTPUT = 0x8,
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VENDOR_START = 0x18,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl
new file mode 100644
index 0000000..2b493ae
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.scaler.availableStreamConfigurations enumeration values
+ * @see ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS
+ */
+@VintfStability
+@Backing(type="int")
+enum ScalerAvailableStreamConfigurations {
+ ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT,
+ ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl
new file mode 100644
index 0000000..4f6cb5e
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.scaler.availableStreamConfigurationsMaximumResolution enumeration values
+ * @see ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION
+ */
+@VintfStability
+@Backing(type="int")
+enum ScalerAvailableStreamConfigurationsMaximumResolution {
+ ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT,
+ ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl
new file mode 100644
index 0000000..19ebab5
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.scaler.availableStreamUseCases enumeration values
+ * @see ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES
+ */
+@VintfStability
+@Backing(type="int")
+enum ScalerAvailableStreamUseCases {
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0x0,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 0x1,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE = 0x2,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD = 0x3,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL = 0x4,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL = 0x5,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START = 0x10000,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerCroppingType.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerCroppingType.aidl
new file mode 100644
index 0000000..e44eff1
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerCroppingType.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.scaler.croppingType enumeration values
+ * @see ANDROID_SCALER_CROPPING_TYPE
+ */
+@VintfStability
+@Backing(type="int")
+enum ScalerCroppingType {
+ ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY,
+ ANDROID_SCALER_CROPPING_TYPE_FREEFORM,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl
new file mode 100644
index 0000000..f7cbc0f
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.scaler.multiResolutionStreamSupported enumeration values
+ * @see ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED
+ */
+@VintfStability
+@Backing(type="int")
+enum ScalerMultiResolutionStreamSupported {
+ ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED_FALSE,
+ ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED_TRUE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl
new file mode 100644
index 0000000..9427854
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.scaler.physicalCameraMultiResolutionStreamConfigurations enumeration values
+ * @see ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS
+ */
+@VintfStability
+@Backing(type="int")
+enum ScalerPhysicalCameraMultiResolutionStreamConfigurations {
+ ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS_OUTPUT,
+ ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS_INPUT,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl
new file mode 100644
index 0000000..9050153
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.scaler.rotateAndCrop enumeration values
+ * @see ANDROID_SCALER_ROTATE_AND_CROP
+ */
+@VintfStability
+@Backing(type="int")
+enum ScalerRotateAndCrop {
+ ANDROID_SCALER_ROTATE_AND_CROP_NONE,
+ ANDROID_SCALER_ROTATE_AND_CROP_90,
+ ANDROID_SCALER_ROTATE_AND_CROP_180,
+ ANDROID_SCALER_ROTATE_AND_CROP_270,
+ ANDROID_SCALER_ROTATE_AND_CROP_AUTO,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl
new file mode 100644
index 0000000..59a4038
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.sensor.info.colorFilterArrangement enumeration values
+ * @see ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
+ */
+@VintfStability
+@Backing(type="int")
+enum SensorInfoColorFilterArrangement {
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB,
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG,
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG,
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR,
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB,
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO,
+ ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl
new file mode 100644
index 0000000..8892ad3
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.sensor.info.lensShadingApplied enumeration values
+ * @see ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED
+ */
+@VintfStability
+@Backing(type="int")
+enum SensorInfoLensShadingApplied {
+ ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED_FALSE,
+ ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED_TRUE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl
new file mode 100644
index 0000000..2a5860b
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.sensor.info.timestampSource enumeration values
+ * @see ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE
+ */
+@VintfStability
+@Backing(type="int")
+enum SensorInfoTimestampSource {
+ ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN,
+ ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorPixelMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorPixelMode.aidl
new file mode 100644
index 0000000..3dda07b
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorPixelMode.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.sensor.pixelMode enumeration values
+ * @see ANDROID_SENSOR_PIXEL_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum SensorPixelMode {
+ ANDROID_SENSOR_PIXEL_MODE_DEFAULT,
+ ANDROID_SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl
new file mode 100644
index 0000000..20e92e4
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.sensor.rawBinningFactorUsed enumeration values
+ * @see ANDROID_SENSOR_RAW_BINNING_FACTOR_USED
+ */
+@VintfStability
+@Backing(type="int")
+enum SensorRawBinningFactorUsed {
+ ANDROID_SENSOR_RAW_BINNING_FACTOR_USED_TRUE,
+ ANDROID_SENSOR_RAW_BINNING_FACTOR_USED_FALSE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl
new file mode 100644
index 0000000..c8c9216
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.sensor.referenceIlluminant1 enumeration values
+ * @see ANDROID_SENSOR_REFERENCE_ILLUMINANT1
+ */
+@VintfStability
+@Backing(type="int")
+enum SensorReferenceIlluminant1 {
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT = 1,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT = 2,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN = 3,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FLASH = 4,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER = 9,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER = 10,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_SHADE = 11,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT = 12,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT = 13,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT = 14,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT = 15,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A = 17,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B = 18,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C = 19,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D55 = 20,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D65 = 21,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D75 = 22,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D50 = 23,
+ ANDROID_SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN = 24,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.aidl
new file mode 100644
index 0000000..c9ca70a
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.sensor.testPatternMode enumeration values
+ * @see ANDROID_SENSOR_TEST_PATTERN_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum SensorTestPatternMode {
+ ANDROID_SENSOR_TEST_PATTERN_MODE_OFF,
+ ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR,
+ ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS,
+ ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY,
+ ANDROID_SENSOR_TEST_PATTERN_MODE_PN9,
+ ANDROID_SENSOR_TEST_PATTERN_MODE_CUSTOM1 = 256,
+ ANDROID_SENSOR_TEST_PATTERN_MODE_BLACK,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ShadingMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ShadingMode.aidl
new file mode 100644
index 0000000..6939b72
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ShadingMode.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.shading.mode enumeration values
+ * @see ANDROID_SHADING_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum ShadingMode {
+ ANDROID_SHADING_MODE_OFF,
+ ANDROID_SHADING_MODE_FAST,
+ ANDROID_SHADING_MODE_HIGH_QUALITY,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl
new file mode 100644
index 0000000..0d17791
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.statistics.faceDetectMode enumeration values
+ * @see ANDROID_STATISTICS_FACE_DETECT_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum StatisticsFaceDetectMode {
+ ANDROID_STATISTICS_FACE_DETECT_MODE_OFF,
+ ANDROID_STATISTICS_FACE_DETECT_MODE_SIMPLE,
+ ANDROID_STATISTICS_FACE_DETECT_MODE_FULL,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHistogramMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHistogramMode.aidl
new file mode 100644
index 0000000..a9b6f68
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHistogramMode.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.statistics.histogramMode enumeration values
+ * @see ANDROID_STATISTICS_HISTOGRAM_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum StatisticsHistogramMode {
+ ANDROID_STATISTICS_HISTOGRAM_MODE_OFF,
+ ANDROID_STATISTICS_HISTOGRAM_MODE_ON,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl
new file mode 100644
index 0000000..286291a
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.statistics.hotPixelMapMode enumeration values
+ * @see ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum StatisticsHotPixelMapMode {
+ ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE_OFF,
+ ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE_ON,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl
new file mode 100644
index 0000000..d21b222
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.statistics.lensShadingMapMode enumeration values
+ * @see ANDROID_STATISTICS_LENS_SHADING_MAP_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum StatisticsLensShadingMapMode {
+ ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF,
+ ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_ON,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsOisDataMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsOisDataMode.aidl
new file mode 100644
index 0000000..afb281f
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsOisDataMode.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.statistics.oisDataMode enumeration values
+ * @see ANDROID_STATISTICS_OIS_DATA_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum StatisticsOisDataMode {
+ ANDROID_STATISTICS_OIS_DATA_MODE_OFF,
+ ANDROID_STATISTICS_OIS_DATA_MODE_ON,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl
new file mode 100644
index 0000000..da2402af
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.statistics.sceneFlicker enumeration values
+ * @see ANDROID_STATISTICS_SCENE_FLICKER
+ */
+@VintfStability
+@Backing(type="int")
+enum StatisticsSceneFlicker {
+ ANDROID_STATISTICS_SCENE_FLICKER_NONE,
+ ANDROID_STATISTICS_SCENE_FLICKER_50HZ,
+ ANDROID_STATISTICS_SCENE_FLICKER_60HZ,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl
new file mode 100644
index 0000000..ed6c65c
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.statistics.sharpnessMapMode enumeration values
+ * @see ANDROID_STATISTICS_SHARPNESS_MAP_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum StatisticsSharpnessMapMode {
+ ANDROID_STATISTICS_SHARPNESS_MAP_MODE_OFF,
+ ANDROID_STATISTICS_SHARPNESS_MAP_MODE_ON,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SyncFrameNumber.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SyncFrameNumber.aidl
new file mode 100644
index 0000000..e33319e
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SyncFrameNumber.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.sync.frameNumber enumeration values
+ * @see ANDROID_SYNC_FRAME_NUMBER
+ */
+@VintfStability
+@Backing(type="int")
+enum SyncFrameNumber {
+ ANDROID_SYNC_FRAME_NUMBER_CONVERGING = -1,
+ ANDROID_SYNC_FRAME_NUMBER_UNKNOWN = -2,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SyncMaxLatency.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SyncMaxLatency.aidl
new file mode 100644
index 0000000..cb0668f
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SyncMaxLatency.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.sync.maxLatency enumeration values
+ * @see ANDROID_SYNC_MAX_LATENCY
+ */
+@VintfStability
+@Backing(type="int")
+enum SyncMaxLatency {
+ ANDROID_SYNC_MAX_LATENCY_PER_FRAME_CONTROL = 0,
+ ANDROID_SYNC_MAX_LATENCY_UNKNOWN = -1,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/TonemapMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/TonemapMode.aidl
new file mode 100644
index 0000000..d4b7e0eb
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/TonemapMode.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.tonemap.mode enumeration values
+ * @see ANDROID_TONEMAP_MODE
+ */
+@VintfStability
+@Backing(type="int")
+enum TonemapMode {
+ ANDROID_TONEMAP_MODE_CONTRAST_CURVE,
+ ANDROID_TONEMAP_MODE_FAST,
+ ANDROID_TONEMAP_MODE_HIGH_QUALITY,
+ ANDROID_TONEMAP_MODE_GAMMA_VALUE,
+ ANDROID_TONEMAP_MODE_PRESET_CURVE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/TonemapPresetCurve.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/TonemapPresetCurve.aidl
new file mode 100644
index 0000000..2da3704
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/TonemapPresetCurve.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.tonemap.presetCurve enumeration values
+ * @see ANDROID_TONEMAP_PRESET_CURVE
+ */
+@VintfStability
+@Backing(type="int")
+enum TonemapPresetCurve {
+ ANDROID_TONEMAP_PRESET_CURVE_SRGB,
+ ANDROID_TONEMAP_PRESET_CURVE_REC709,
+}
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index 8c44010..3254cf2 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -44,6 +44,7 @@
#include <android/hardware/camera/device/3.7/ICameraDevice.h>
#include <android/hardware/camera/device/3.8/ICameraDevice.h>
#include <android/hardware/camera/device/3.7/ICameraDeviceSession.h>
+#include <android/hardware/camera/device/3.8/ICameraDeviceSession.h>
#include <android/hardware/camera/device/3.7/ICameraInjectionSession.h>
#include <android/hardware/camera/device/3.8/ICameraDeviceCallback.h>
#include <android/hardware/camera/device/3.8/ICameraDeviceSession.h>
@@ -135,6 +136,8 @@
using ::android::hardware::camera::metadata::V3_6::CameraMetadataEnumAndroidSensorPixelMode;
using ::android::hardware::camera::metadata::V3_8::
CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap;
+using ::android::hardware::camera::metadata::V3_8::
+ CameraMetadataEnumAndroidScalerAvailableStreamUseCases;
using ::android::hardware::camera::provider::V2_4::ICameraProvider;
using ::android::hardware::camera::provider::V2_4::ICameraProviderCallback;
using ::android::hardware::camera::provider::V2_6::CameraIdAndStreamCombination;
@@ -198,6 +201,15 @@
HIDDEN_SECURE_CAMERA
};
+const static std::vector<int32_t> kMandatoryUseCases = {
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL
+};
+
namespace {
// "device@<version>/legacy/<id>"
const char *kDeviceNameRE = "device@([0-9]+\\.[0-9]+)/%s/(.+)";
@@ -879,6 +891,7 @@
void verifyCameraCharacteristics(Status status, const CameraMetadata& chars);
void verifyExtendedSceneModeCharacteristics(const camera_metadata_t* metadata);
void verifyZoomCharacteristics(const camera_metadata_t* metadata);
+ void verifyStreamUseCaseCharacteristics(const camera_metadata_t* metadata);
void verifyRecommendedConfigs(const CameraMetadata& metadata);
void verifyMonochromeCharacteristics(const CameraMetadata& chars, int deviceVersion);
void verifyMonochromeCameraResult(
@@ -6879,6 +6892,134 @@
}
}
+// Verify that valid stream use cases can be configured successfully, and invalid use cases
+// fail stream configuration.
+TEST_P(CameraHidlTest, configureStreamsUseCases) {
+ hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+
+ for (const auto& name : cameraDeviceNames) {
+ int deviceVersion = getCameraDeviceVersion(name, mProviderType);
+ if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_8) {
+ continue;
+ }
+
+ camera_metadata_t* staticMeta;
+ Return<void> ret;
+ sp<ICameraDeviceSession> session;
+ sp<device::V3_3::ICameraDeviceSession> session3_3;
+ sp<device::V3_4::ICameraDeviceSession> session3_4;
+ sp<device::V3_5::ICameraDeviceSession> session3_5;
+ sp<device::V3_6::ICameraDeviceSession> session3_6;
+ sp<device::V3_7::ICameraDeviceSession> session3_7;
+ sp<device::V3_8::ICameraDeviceSession> session3_8;
+ sp<device::V3_2::ICameraDevice> cameraDevice;
+ sp<device::V3_5::ICameraDevice> cameraDevice3_5;
+ sp<device::V3_7::ICameraDevice> cameraDevice3_7;
+ sp<device::V3_8::ICameraDevice> cameraDevice3_8;
+ openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/,
+ &cameraDevice /*out*/);
+ castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5,
+ &session3_6, &session3_7, &session3_8);
+ ASSERT_NE(nullptr, session3_8);
+ castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7,
+ &cameraDevice3_8);
+ ASSERT_NE(nullptr, cameraDevice3_8);
+
+ // Check if camera support depth only
+ if (isDepthOnly(staticMeta)) {
+ free_camera_metadata(staticMeta);
+ ret = session->close();
+ ASSERT_TRUE(ret.isOk());
+ continue;
+ }
+
+ std::vector<AvailableStream> outputPreviewStreams;
+ AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
+ static_cast<int32_t>(PixelFormat::YCBCR_420_888)};
+ ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputPreviewStreams,
+ &previewThreshold));
+ ASSERT_NE(0u, outputPreviewStreams.size());
+
+ // Combine valid and invalid stream use cases
+ std::vector<int32_t> useCases(kMandatoryUseCases);
+ useCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL + 1);
+
+ std::vector<int32_t> supportedUseCases;
+ camera_metadata_ro_entry entry;
+ auto retcode = find_camera_metadata_ro_entry(staticMeta,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, &entry);
+ if ((0 == retcode) && (entry.count > 0)) {
+ supportedUseCases.insert(supportedUseCases.end(), entry.data.i32,
+ entry.data.i32 + entry.count);
+ } else {
+ supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT);
+ }
+ free_camera_metadata(staticMeta);
+
+ ::android::hardware::hidl_vec<V3_8::Stream> streams3_8(1);
+ streams3_8[0].v3_7.groupId = -1;
+ streams3_8[0].v3_7.sensorPixelModesUsed = {
+ CameraMetadataEnumAndroidSensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT};
+ streams3_8[0].v3_7.v3_4.bufferSize = 0;
+ streams3_8[0].v3_7.v3_4.v3_2.id = 0;
+ streams3_8[0].v3_7.v3_4.v3_2.streamType = StreamType::OUTPUT;
+ streams3_8[0].v3_7.v3_4.v3_2.width = static_cast<uint32_t>(outputPreviewStreams[0].width);
+ streams3_8[0].v3_7.v3_4.v3_2.height = static_cast<uint32_t>(outputPreviewStreams[0].height);
+ streams3_8[0].v3_7.v3_4.v3_2.format =
+ static_cast<PixelFormat>(outputPreviewStreams[0].format);
+ streams3_8[0].v3_7.v3_4.v3_2.usage = GRALLOC1_CONSUMER_USAGE_CPU_READ;
+ streams3_8[0].v3_7.v3_4.v3_2.dataSpace = 0;
+ streams3_8[0].v3_7.v3_4.v3_2.rotation = StreamRotation::ROTATION_0;
+ streams3_8[0].dynamicRangeProfile =
+ static_cast<CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap>(
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD);
+
+ uint32_t streamConfigCounter = 0;
+ ::android::hardware::camera::device::V3_8::StreamConfiguration config3_8;
+ RequestTemplate reqTemplate = RequestTemplate::STILL_CAPTURE;
+ ret = session3_8->constructDefaultRequestSettings(reqTemplate,
+ [&config3_8](auto status, const auto& req) {
+ ASSERT_EQ(Status::OK, status);
+ config3_8.sessionParams = req;
+ });
+ ASSERT_TRUE(ret.isOk());
+
+ for (int32_t useCase : useCases) {
+ bool useCaseSupported = std::find(supportedUseCases.begin(),
+ supportedUseCases.end(), useCase) != supportedUseCases.end();
+
+ streams3_8[0].useCase =
+ static_cast<CameraMetadataEnumAndroidScalerAvailableStreamUseCases>(useCase);
+ config3_8.streams = streams3_8;
+ config3_8.operationMode = StreamConfigurationMode::NORMAL_MODE;
+ config3_8.streamConfigCounter = streamConfigCounter;
+ config3_8.multiResolutionInputImage = false;
+ ret = cameraDevice3_8->isStreamCombinationSupported_3_8(
+ config3_8, [&useCaseSupported](Status s, bool combStatus) {
+ ASSERT_TRUE((Status::OK == s) || (Status::METHOD_NOT_SUPPORTED == s));
+ if (Status::OK == s) {
+ ASSERT_EQ(combStatus, useCaseSupported);
+ }
+ });
+ ASSERT_TRUE(ret.isOk());
+
+ ret = session3_8->configureStreams_3_8(
+ config3_8,
+ [&](Status s, device::V3_6::HalStreamConfiguration halConfig) {
+ if (useCaseSupported) {
+ ASSERT_EQ(Status::OK, s);
+ ASSERT_EQ(1u, halConfig.streams.size());
+ } else {
+ ASSERT_EQ(Status::ILLEGAL_ARGUMENT, s);
+ }
+ });
+ ASSERT_TRUE(ret.isOk());
+ }
+ ret = session3_8->close();
+ ASSERT_TRUE(ret.isOk());
+ }
+}
+
// Retrieve all valid output stream resolutions from the camera
// static characteristics.
Status CameraHidlTest::getAvailableOutputStreams(const camera_metadata_t* staticMeta,
@@ -9042,6 +9183,7 @@
verifyExtendedSceneModeCharacteristics(metadata);
verifyZoomCharacteristics(metadata);
+ verifyStreamUseCaseCharacteristics(metadata);
}
void CameraHidlTest::verifyExtendedSceneModeCharacteristics(const camera_metadata_t* metadata) {
@@ -9272,6 +9414,46 @@
}
}
+void CameraHidlTest::verifyStreamUseCaseCharacteristics(const camera_metadata_t* metadata) {
+ camera_metadata_ro_entry entry;
+ // Check capabilities
+ int retcode = find_camera_metadata_ro_entry(metadata,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES, &entry);
+ bool hasStreamUseCaseCap = false;
+ if ((0 == retcode) && (entry.count > 0)) {
+ if (std::find(entry.data.u8, entry.data.u8 + entry.count,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE) !=
+ entry.data.u8 + entry.count) {
+ hasStreamUseCaseCap = true;
+ }
+ }
+
+ bool supportMandatoryUseCases = false;
+ retcode = find_camera_metadata_ro_entry(metadata,
+ ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, &entry);
+ if ((0 == retcode) && (entry.count > 0)) {
+ supportMandatoryUseCases = true;
+ for (size_t i = 0; i < kMandatoryUseCases.size(); i++) {
+ if (std::find(entry.data.i32, entry.data.i32 + entry.count, kMandatoryUseCases[i])
+ == entry.data.i32 + entry.count) {
+ supportMandatoryUseCases = false;
+ break;
+ }
+ }
+ bool supportDefaultUseCase = false;
+ for (size_t i = 0; i < entry.count; i++) {
+ if (entry.data.i32[i] == ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT) {
+ supportDefaultUseCase = true;
+ }
+ ASSERT_TRUE(entry.data.i32[i] <= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL ||
+ entry.data.i32[i] >= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START);
+ }
+ ASSERT_TRUE(supportDefaultUseCase);
+ }
+
+ ASSERT_EQ(hasStreamUseCaseCap, supportMandatoryUseCases);
+}
+
void CameraHidlTest::verifyMonochromeCharacteristics(const CameraMetadata& chars,
int deviceVersion) {
const camera_metadata_t* metadata = (camera_metadata_t*)chars.data();
diff --git a/camera/provider/aidl/Android.bp b/camera/provider/aidl/Android.bp
new file mode 100644
index 0000000..6f1b781
--- /dev/null
+++ b/camera/provider/aidl/Android.bp
@@ -0,0 +1,34 @@
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+aidl_interface {
+ name: "android.hardware.camera.provider",
+ vendor_available: true,
+ srcs: [
+ "android/hardware/camera/provider/*.aidl",
+ ],
+ imports: [
+ "android.hardware.camera.device",
+ "android.hardware.camera.common"
+ ],
+ stability: "vintf",
+ backend: {
+ java: {
+ enabled: false,
+ },
+ cpp: {
+ enabled: false,
+ },
+ ndk: {
+ vndk: {
+ enabled: true,
+ },
+ },
+ },
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl
similarity index 87%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl
index 4f29c0b..df77c40 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.provider;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable CameraIdAndStreamCombination {
+ String cameraId;
+ android.hardware.camera.device.StreamConfiguration streamConfiguration;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl
index 4f29c0b..334fb2c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,8 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.provider;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable ConcurrentCameraIdCombination {
+ List<String> combination;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ICameraProvider.aidl
similarity index 65%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ICameraProvider.aidl
index 4f29c0b..c15bdee 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ICameraProvider.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,18 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.provider;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+interface ICameraProvider {
+ void setCallback(android.hardware.camera.provider.ICameraProviderCallback callback);
+ android.hardware.camera.common.VendorTagSection[] getVendorTags();
+ String[] getCameraIdList();
+ android.hardware.camera.device.ICameraDevice getCameraDeviceInterface(String cameraDeviceName);
+ void notifyDeviceStateChange(long deviceState);
+ android.hardware.camera.provider.ConcurrentCameraIdCombination[] getConcurrentCameraIds();
+ boolean isConcurrentStreamCombinationSupported(in android.hardware.camera.provider.CameraIdAndStreamCombination[] configs);
+ const long DEVICE_STATE_NORMAL = 0;
+ const long DEVICE_STATE_BACK_COVERED = 1;
+ const long DEVICE_STATE_FRONT_COVERED = 2;
+ const long DEVICE_STATE_FOLDED = 4;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ICameraProviderCallback.aidl
similarity index 75%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ICameraProviderCallback.aidl
index 4f29c0b..d3c53f5 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ICameraProviderCallback.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.camera.provider;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+interface ICameraProviderCallback {
+ void cameraDeviceStatusChange(String cameraDeviceName, android.hardware.camera.common.CameraDeviceStatus newStatus);
+ void torchModeStatusChange(String cameraDeviceName, android.hardware.camera.common.TorchModeStatus newStatus);
+ void physicalCameraDeviceStatusChange(String cameraDeviceName, String physicalCameraDeviceName, android.hardware.camera.common.CameraDeviceStatus newStatus);
}
diff --git a/audio/7.1/IStreamIn.hal b/camera/provider/aidl/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl
similarity index 72%
copy from audio/7.1/IStreamIn.hal
copy to camera/provider/aidl/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl
index abebe6a..36b48e1 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/provider/aidl/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl
@@ -14,9 +14,13 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.camera.provider;
-import @7.0::IStreamIn;
+import android.hardware.camera.device.StreamConfiguration;
-interface IStreamIn extends @7.0::IStreamIn {
-};
+@VintfStability
+parcelable CameraIdAndStreamCombination {
+ String cameraId;
+
+ StreamConfiguration streamConfiguration;
+}
diff --git a/audio/7.1/IStreamIn.hal b/camera/provider/aidl/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl
similarity index 81%
copy from audio/7.1/IStreamIn.hal
copy to camera/provider/aidl/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl
index abebe6a..7d8e486 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/camera/provider/aidl/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.camera.provider;
-import @7.0::IStreamIn;
-
-interface IStreamIn extends @7.0::IStreamIn {
-};
+@VintfStability
+parcelable ConcurrentCameraIdCombination {
+ List<String> combination;
+}
diff --git a/camera/provider/aidl/android/hardware/camera/provider/ICameraProvider.aidl b/camera/provider/aidl/android/hardware/camera/provider/ICameraProvider.aidl
new file mode 100644
index 0000000..7a4e010
--- /dev/null
+++ b/camera/provider/aidl/android/hardware/camera/provider/ICameraProvider.aidl
@@ -0,0 +1,308 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.provider;
+
+import android.hardware.camera.common.VendorTagSection;
+import android.hardware.camera.device.ICameraDevice;
+import android.hardware.camera.provider.CameraIdAndStreamCombination;
+import android.hardware.camera.provider.ConcurrentCameraIdCombination;
+import android.hardware.camera.provider.ICameraProviderCallback;
+
+/**
+ * Camera provider HAL, which enumerates the available individual camera devices
+ * known to the provider, and provides updates about changes to device status,
+ * such as connection, disconnection, or torch mode enable/disable.
+ *
+ * The provider is responsible for generating a list of camera device service
+ * names that can then be opened via the hardware service manager.
+ *
+ * Multiple camera provider HALs may be present in a single system.
+ * For discovery, the service names, and process names, must be of the form
+ * "android.hardware.camera.provider.ICameraProvider/<type>/<instance>"
+ * where
+ * - <type> is the type of devices this provider knows about, such as
+ * "internal", "external", "remote" etc. The camera framework
+ * must not differentiate or chage its behavior based on the specific type.
+ * - <instance> is a non-negative integer starting from 0 to disambiguate
+ * between multiple HALs of the same type.
+ *
+ * The device instance names enumerated by the provider in getCameraIdList() or
+ * ICameraProviderCallback::cameraDeviceStatusChange() must be of the form
+ * "device@<major>.<minor>/<type>/<id>" where
+ * <major>/<minor> is the AIDL version of the interface. Major version is the version baked into the
+ * name of the device interface. Minor version is the version that would be returned by calling
+ * getInterfaceVersion on the interface binder returned getCameraDeviceInterface.
+ * <id> is either a small incrementing integer for "internal" device types, with 0 being the main
+ * back-facing camera and 1 being the main front-facing camera, if they exist.
+ * Or, for external devices, a unique serial number (if possible) that can be
+ * used to identify the device reliably when it is disconnected and reconnected.
+ *
+ * Multiple providers must not enumerate the same device ID.
+ */
+
+@VintfStability
+interface ICameraProvider {
+
+ /**
+ * Device states to be passed to notifyDeviceStateChange().
+ */
+ const long DEVICE_STATE_NORMAL = 0;
+ const long DEVICE_STATE_BACK_COVERED = 1 << 0;
+ const long DEVICE_STATE_FRONT_COVERED = 1 << 1;
+ const long DEVICE_STATE_FOLDED = 1 << 2;
+
+ /**
+ * setCallback:
+ *
+ * Provide a callback interface to the HAL provider to inform framework of
+ * asynchronous camera events. The framework must call this function once
+ * during camera service startup, before any other calls to the provider
+ * (note that in case the camera service restarts, this method must be
+ * invoked again during its startup).
+ *
+ * @param callback
+ * A non-null callback interface to invoke when camera events occur.
+ * A service specific error will be returned on the following conditions
+ * INTERNAL_ERROR:
+ * An unexpected internal error occurred while setting the callbacks
+ * ILLEGAL_ARGUMENT:
+ * The callback argument is invalid (for example, null).
+ *
+ */
+ void setCallback(ICameraProviderCallback callback);
+
+ /**
+ * getVendorTags:
+ *
+ * Retrieve all vendor tags supported by devices discoverable through this
+ * provider. The tags are grouped into sections.
+ *
+ * A service specific error will be returned on the following conditions
+ * INTERNAL_ERROR:
+ * An unexpected internal error occurred while setting the callbacks
+ * @return
+ * The supported vendor tag sections; empty if there are no supported
+ * vendor tags.
+ *
+ */
+ VendorTagSection[] getVendorTags();
+
+ /**
+ * getCameraIdList:
+ *
+ * Returns the list of internal camera device interfaces known to this
+ * camera provider. These devices can then be accessed via the service manager.
+ *
+ * External camera devices (camera facing EXTERNAL) must be reported through
+ * the device status change callback, not in this list. Only devices with
+ * facing BACK or FRONT must be listed here.
+ *
+ * A service specific error will be returned on the following conditions
+ * INTERNAL_ERROR:
+ * A camera ID list cannot be created. This may be due to
+ * a failure to initialize the camera subsystem, for example.
+ * @return The list of internal camera device names known to this provider.
+ */
+ String[] getCameraIdList();
+
+ /**
+ * getCameraDeviceInterface:
+ *
+ * Return a android.hardware.camera.device/ICameraDevice interface for
+ * the requested device name. This does not power on the camera device, but
+ * simply acquires the interface for querying the device static information,
+ * or to additionally open the device for active use.
+ *
+ * Valid device names for this provider can be obtained via either
+ * getCameraIdList(), or via availability callbacks from
+ * ICameraProviderCallback::cameraDeviceStatusChange().
+ *
+ * @param cameraDeviceName the name of the device to get an interface to.
+ *
+ * A service specific error will be returned on the following conditions
+ * ILLEGAL_ARGUMENT:
+ * This device name is unknown, or has been disconnected
+ * OPERATION_NOT_SUPPORTED:
+ * The specified device does not support this major version of the
+ * HAL interface.
+ * INTERNAL_ERROR:
+ * A camera interface cannot be returned due to an unexpected
+ * internal error.
+ * @return device The interface to this camera device, or null in case of
+ * error.
+ */
+ ICameraDevice getCameraDeviceInterface(String cameraDeviceName);
+
+ /**
+ * notifyDeviceStateChange:
+ *
+ * Notify the HAL provider that the state of the overall device has
+ * changed in some way that the HAL may want to know about.
+ *
+ * For example, a physical shutter may have been uncovered or covered,
+ * or a camera may have been covered or uncovered by an add-on keyboard
+ * or other accessory.
+ *
+ * The state is a bitfield of potential states, and some physical configurations
+ * could plausibly correspond to multiple different combinations of state bits.
+ * The HAL must ignore any state bits it is not actively using to determine
+ * the appropriate camera configuration.
+ *
+ * For example, on some devices the FOLDED state could mean that
+ * backward-facing cameras are covered by the fold, so FOLDED by itself implies
+ * BACK_COVERED. But other devices may support folding but not cover any cameras
+ * when folded, so for those FOLDED would not imply any of the other flags.
+ * Since these relationships are very device-specific, it is difficult to specify
+ * a comprehensive policy. But as a recommendation, it is suggested that if a flag
+ * necessarily implies other flags are set as well, then those flags should be set.
+ * So even though FOLDED would be enough to infer BACK_COVERED on some devices, the
+ * BACK_COVERED flag should also be set for clarity.
+ *
+ * This method may be invoked by the HAL client at any time. It must not
+ * cause any active camera device sessions to be closed, but may dynamically
+ * change which physical camera a logical multi-camera is using for its
+ * active and future output.
+ *
+ * The method must be invoked by the HAL client at least once before the
+ * client calls ICameraDevice::open on any camera device interfaces listed
+ * by this provider, to establish the initial device state.
+ *
+ * @param newState
+ * The new state of the device.
+ */
+ void notifyDeviceStateChange(long deviceState);
+
+ /**
+ * getConcurrentStreamingCameraIds
+ *
+ * Get a vector of combinations of camera device ids that are able to
+ * configure streams concurrently. Each camera device advertised in a
+ * combination MUST at the very least support the following streams while
+ * streaming concurrently with the other camera ids in the combination.
+ *
+ * Target 1 Target 2
+ * -----------------------------------------------------
+ * | Type | Size | Type | Size |
+ * -----------------------------------------------------
+ * | YUV | s1440p | |
+ * -----------------------------------------------------
+ * | JPEG | s1440p | |
+ * -----------------------------------------------------
+ * | PRIV | s1440p | |
+ * -----------------------------------------------------
+ * | YUV / PRIV | s720p | YUV / PRIV | s1440p |
+ * -----------------------------------------------------
+ * | YUV / PRIV | s720p | JPEG | s1440p |
+ * -----------------------------------------------------
+ *
+ * where:
+ * s720p - min (max output resolution for the given format, 1280 X 720)
+ * s1440p - min (max output resolution for the given format, 1920 X 1440)
+ *
+ * If a device has MONOCHROME capability (device's capabilities include
+ * ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME) and therefore supports Y8
+ * outputs, stream combinations mentioned above, where YUV is substituted by
+ * Y8 must be also supported.
+ *
+ * Devices whose capabilities do not include
+ * ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE, must support
+ * at least a single Y16 stream, Dataspace::DEPTH with sVGA resolution,
+ * during concurrent operation.
+ * Where sVGA - min (max output resolution for the given format, 640 X 480)
+ *
+ * The camera framework must call this method whenever it gets a
+ * cameraDeviceStatusChange callback adding a new camera device or removing
+ * a camera device known to it. This is so that the camera framework can get new combinations
+ * of camera ids that can stream concurrently, that might have potentially appeared.
+ *
+ * For each combination (and their subsets) of camera device ids returned by
+ * getConcurrentStreamingCameraIds(): If only the mandatory combinations can
+ * be supported concurrently by each device, then the resource costs must
+ * sum up to > 100 for the concurrent set, to ensure arbitration between
+ * camera applications work as expected. Only if resources are sufficient
+ * to run a set of cameras at full capability (maximally
+ * resource-consuming framerate and stream size settings available in the
+ * configuration settings exposed through camera metadata), should the sum
+ * of resource costs for the combination be <= 100.
+ *
+ * For guaranteed concurrent camera operation, the camera framework must call
+ * ICameraDevice.open() on all devices (intended for concurrent operation), before configuring
+ * any streams on them. This gives the camera HAL process an opportunity to potentially
+ * distribute hardware resources better before stream configuration.
+ *
+ * Due to potential hardware constraints around internal switching of physical camera devices,
+ * a device's complete ZOOM_RATIO_RANGE(if supported), may not apply during concurrent
+ * operation. If ZOOM_RATIO is supported, camera HALs must ensure ZOOM_RATIO_RANGE of
+ * [1.0, ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM] is supported by that device, during
+ * concurrent operation.
+ *
+ * A service specific error will be returned in the following case :
+ *
+ * INTERNAL_ERROR: the hal has encountered an internal error
+ *
+ * @return a list of camera id combinations that support
+ * concurrent stream configurations with the minimum guarantees
+ * specified.
+ */
+ ConcurrentCameraIdCombination[] getConcurrentCameraIds();
+
+ /**
+ * isConcurrentStreamCombinationSupported:
+ *
+ * Check for device support of specific camera stream combinations while
+ * streaming concurrently with other devices.
+ *
+ * The per device streamList must contain at least one output-capable stream, and may
+ * not contain more than one input-capable stream.
+ * In contrast to regular stream configuration the framework does not create
+ * or initialize any actual streams. This means that Hal must not use or
+ * consider the stream "id" value.
+ *
+ * ------------------------------------------------------------------------
+ *
+ * Preconditions:
+ *
+ * The framework can call this method at any time before, during and
+ * after active session configuration per device. This means that calls must not
+ * impact the performance of pending camera requests in any way. In
+ * particular there must not be any glitches or delays during normal
+ * camera streaming.
+ *
+ * The framework must not call this method with any combination of camera
+ * ids that is not a subset of the camera ids advertised by getConcurrentStreamingCameraIds of
+ * the same provider.
+ *
+ * Performance requirements:
+ * This call is expected to be significantly faster than stream
+ * configuration. In general HW and SW camera settings must not be
+ * changed and there must not be a user-visible impact on camera performance.
+ *
+ * @param configs a vector of camera ids and their corresponding stream
+ * configurations that need to be queried for support.
+ *
+ * On error, the service specific error for the operation will be, one of:
+ * METHOD_NOT_SUPPORTED:
+ * The camera provider does not support stream combination query.
+ * INTERNAL_ERROR:
+ * The stream combination query cannot complete due to internal
+ * error.
+ * @return true in case the stream combination is supported, false otherwise.
+ *
+ *
+ */
+ boolean isConcurrentStreamCombinationSupported(in CameraIdAndStreamCombination[] configs);
+}
diff --git a/camera/provider/aidl/android/hardware/camera/provider/ICameraProviderCallback.aidl b/camera/provider/aidl/android/hardware/camera/provider/ICameraProviderCallback.aidl
new file mode 100644
index 0000000..a877637
--- /dev/null
+++ b/camera/provider/aidl/android/hardware/camera/provider/ICameraProviderCallback.aidl
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.provider;
+
+import android.hardware.camera.common.CameraDeviceStatus;
+import android.hardware.camera.common.TorchModeStatus;
+
+@VintfStability
+interface ICameraProviderCallback {
+ /**
+ * cameraDeviceStatusChange:
+ *
+ * Callback to the camera service to indicate that the state of a specific
+ * camera device has changed.
+ *
+ * On camera service startup, when ICameraProvider::setCallback is invoked,
+ * the camera service must assume that all internal camera devices are in
+ * the CAMERA_DEVICE_STATUS_PRESENT state.
+ *
+ * The provider must call this method to inform the camera service of any
+ * initially NOT_PRESENT devices, and of any external camera devices that
+ * are already present, as soon as the callbacks are available through
+ * setCallback.
+ *
+ * @param cameraDeviceName The name of the camera device that has a new status.
+ * @param newStatus The new status that device is in.
+ *
+ */
+ void cameraDeviceStatusChange(String cameraDeviceName, CameraDeviceStatus newStatus);
+
+ /**
+ * torchModeStatusChange:
+ *
+ * Callback to the camera service to indicate that the state of the torch
+ * mode of the flash unit associated with a specific camera device has
+ * changed. At provider registration time, the camera service must assume
+ * the torch modes are in the TORCH_MODE_STATUS_AVAILABLE_OFF state if
+ * android.flash.info.available is reported as true via the
+ * ICameraDevice::getCameraCharacteristics call.
+ *
+ * @param cameraDeviceName The name of the camera device that has a
+ * new status.
+ * @param newStatus The new status that the torch is in.
+ *
+ */
+ void torchModeStatusChange(String cameraDeviceName, TorchModeStatus newStatus);
+
+ /**
+ * cameraPhysicalDeviceStatusChange:
+ *
+ * Callback to the camera service to indicate that the state of a physical
+ * camera device of a logical multi-camera has changed.
+ *
+ * On camera service startup, when ICameraProvider::setCallback is invoked,
+ * the camera service must assume that all physical devices backing internal
+ * multi-camera devices are in the CAMERA_DEVICE_STATUS_PRESENT state.
+ *
+ * The provider must call this method to inform the camera service of any
+ * initially NOT_PRESENT physical devices, as soon as the callbacks are available
+ * through setCallback.
+ *
+ * @param cameraDeviceName The name of the logical multi-camera whose
+ * physical camera has a new status.
+ * @param physicalCameraDeviceName The name of the physical camera device
+ * that has a new status.
+ * @param newStatus The new status that device is in.
+ *
+ */
+ void physicalCameraDeviceStatusChange(
+ String cameraDeviceName, String physicalCameraDeviceName, CameraDeviceStatus newStatus);
+}
diff --git a/cas/1.0/Android.bp b/cas/1.0/Android.bp
index 368156a..e27695c 100644
--- a/cas/1.0/Android.bp
+++ b/cas/1.0/Android.bp
@@ -23,4 +23,8 @@
"android.hidl.base@1.0",
],
gen_java: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media",
+ ],
}
diff --git a/cas/1.1/Android.bp b/cas/1.1/Android.bp
index f5b1cc9..1bf9c5f 100644
--- a/cas/1.1/Android.bp
+++ b/cas/1.1/Android.bp
@@ -22,4 +22,8 @@
"android.hidl.base@1.0",
],
gen_java: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media",
+ ],
}
diff --git a/cas/1.2/Android.bp b/cas/1.2/Android.bp
index 6c94020..5468ed0 100644
--- a/cas/1.2/Android.bp
+++ b/cas/1.2/Android.bp
@@ -24,4 +24,8 @@
"android.hidl.base@1.0",
],
gen_java: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media",
+ ],
}
diff --git a/cas/native/1.0/Android.bp b/cas/native/1.0/Android.bp
index 3bb74c1..ef77ab4 100644
--- a/cas/native/1.0/Android.bp
+++ b/cas/native/1.0/Android.bp
@@ -21,4 +21,8 @@
"android.hidl.base@1.0",
],
gen_java: false,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media",
+ ],
}
diff --git a/common/aidl/Android.bp b/common/aidl/Android.bp
index 028c923..549d970 100644
--- a/common/aidl/Android.bp
+++ b/common/aidl/Android.bp
@@ -30,6 +30,7 @@
ndk: {
apex_available: [
"//apex_available:platform",
+ "com.android.bluetooth",
"com.android.media.swcodec",
"com.android.neuralnetworks",
],
diff --git a/common/fmq/aidl/Android.bp b/common/fmq/aidl/Android.bp
index 842a75f..6fd4200 100644
--- a/common/fmq/aidl/Android.bp
+++ b/common/fmq/aidl/Android.bp
@@ -29,6 +29,13 @@
cpp: {
enabled: false,
},
+ ndk: {
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.bluetooth",
+ ],
+ min_sdk_version: "29",
+ },
},
versions: ["1"],
}
diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml
index dc716bb..18b3885 100644
--- a/compatibility_matrices/compatibility_matrix.current.xml
+++ b/compatibility_matrices/compatibility_matrix.current.xml
@@ -187,6 +187,14 @@
<regex-instance>[^/]+/[0-9]+</regex-instance>
</interface>
</hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.camera.provider</name>
+ <version>1</version>
+ <interface>
+ <name>ICameraProvider</name>
+ <regex-instance>[^/]+/[0-9]+</regex-instance>
+ </interface>
+ </hal>
<hal format="hidl" optional="true">
<name>android.hardware.cas</name>
<version>1.1-2</version>
@@ -300,7 +308,10 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <!-- Either the AIDL or the HIDL composer HAL must exist on the device.
+ If the HIDL composer HAL exists, it must be at least version 2.1.
+ See DeviceManifestTest.ComposerHal -->
+ <hal format="hidl" optional="true">
<name>android.hardware.graphics.composer</name>
<version>2.1-4</version>
<interface>
@@ -374,11 +385,11 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="true">
- <name>android.hardware.input.classifier</name>
- <version>1.0</version>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.input.processor</name>
+ <version>1</version>
<interface>
- <name>IInputClassifier</name>
+ <name>IInputProcessor</name>
<instance>default</instance>
</interface>
</hal>
@@ -427,7 +438,7 @@
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.light</name>
- <version>1</version>
+ <version>2</version>
<interface>
<name>ILights</name>
<instance>default</instance>
@@ -503,7 +514,7 @@
</hal>
<hal format="aidl" optional="false">
<name>android.hardware.power</name>
- <version>1-3</version>
+ <version>2-3</version>
<interface>
<name>IPower</name>
<instance>default</instance>
diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp
index 414c502..6de9d03 100644
--- a/compatibility_matrices/exclude/fcm_exclude.cpp
+++ b/compatibility_matrices/exclude/fcm_exclude.cpp
@@ -53,6 +53,9 @@
// AIDL
"android.hardware.audio.common",
"android.hardware.biometrics.common",
+ "android.hardware.camera.metadata",
+ "android.hardware.camera.device",
+ "android.hardware.camera.common",
"android.hardware.common",
"android.hardware.common.fmq",
"android.hardware.graphics.common",
diff --git a/contexthub/aidl/Android.bp b/contexthub/aidl/Android.bp
index e9143b5..5926b77 100644
--- a/contexthub/aidl/Android.bp
+++ b/contexthub/aidl/Android.bp
@@ -24,6 +24,7 @@
aidl_interface {
name: "android.hardware.contexthub",
vendor_available: true,
+ host_supported: true,
srcs: ["android/hardware/contexthub/*.aidl"],
stability: "vintf",
backend: {
diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl
index 2135041..16666ef 100644
--- a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl
+++ b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl
@@ -189,9 +189,8 @@
* called, the HAL is expected to clean up any resources attached to the messaging channel
* associated with this host endpoint ID.
*
- * @param hostEndPointId The ID of the host that has disconnected.
- *
- * @throws EX_ILLEGAL_ARGUMENT if hostEndpointId is not associated with a connected host.
+ * @param hostEndPointId The ID of the host that has disconnected. Any invalid values for this
+ * parameter should be ignored (no-op).
*/
void onHostEndpointDisconnected(char hostEndpointId);
diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
index f0583be..3c01c6b 100644
--- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
+++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
@@ -338,8 +338,7 @@
TEST_P(ContextHubAidl, TestInvalidHostConnection) {
constexpr char16_t kHostEndpointId = 1;
- Status status = contextHub->onHostEndpointDisconnected(kHostEndpointId);
- ASSERT_EQ(status.exceptionCode(), android::binder::Status::EX_ILLEGAL_ARGUMENT);
+ ASSERT_TRUE(contextHub->onHostEndpointDisconnected(kHostEndpointId).isOk());
}
std::string PrintGeneratedTest(const testing::TestParamInfo<ContextHubAidl::ParamType>& info) {
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl
index aa514da..01a3b3a 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl
@@ -37,7 +37,7 @@
android.hardware.gnss.GnssMeasurement[] measurements;
android.hardware.gnss.GnssClock clock;
android.hardware.gnss.ElapsedRealtime elapsedRealtime;
- @nullable android.hardware.gnss.GnssData.GnssAgc[] gnssAgcs;
+ android.hardware.gnss.GnssData.GnssAgc[] gnssAgcs = {};
@VintfStability
parcelable GnssAgc {
double agcLevelDb;
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl
index 73df195..69fa32b 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl
@@ -36,7 +36,7 @@
interface IAGnssRil {
void setCallback(in android.hardware.gnss.IAGnssRilCallback callback);
void setRefLocation(in android.hardware.gnss.IAGnssRil.AGnssRefLocation agnssReflocation);
- void setSetId(in android.hardware.gnss.IAGnssRil.SetIDType type, in @utf8InCpp String setid);
+ void setSetId(in android.hardware.gnss.IAGnssRil.SetIdType type, in @utf8InCpp String setid);
void updateNetworkState(in android.hardware.gnss.IAGnssRil.NetworkAttributes attributes);
const int NETWORK_CAPABILITY_NOT_METERED = 1;
const int NETWORK_CAPABILITY_NOT_ROAMING = 2;
@@ -48,7 +48,7 @@
NR_CELLID = 8,
}
@Backing(type="int") @VintfStability
- enum SetIDType {
+ enum SetIdType {
NONE = 0,
IMSI = 1,
MSISDM = 2,
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
index a16d27b..5657434 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
@@ -53,9 +53,13 @@
void injectLocation(in android.hardware.gnss.GnssLocation location);
void injectBestLocation(in android.hardware.gnss.GnssLocation location);
void deleteAidingData(in android.hardware.gnss.IGnss.GnssAidingData aidingDataFlags);
- void setPositionMode(in android.hardware.gnss.IGnss.GnssPositionMode mode, in android.hardware.gnss.IGnss.GnssPositionRecurrence recurrence, in int minIntervalMs, in int preferredAccuracyMeters, in int preferredTimeMs, in boolean lowPowerMode);
+ void setPositionMode(in android.hardware.gnss.IGnss.PositionModeOptions options);
android.hardware.gnss.IGnssAntennaInfo getExtensionGnssAntennaInfo();
@nullable android.hardware.gnss.measurement_corrections.IMeasurementCorrectionsInterface getExtensionMeasurementCorrections();
+ void startSvStatus();
+ void stopSvStatus();
+ void startNmea();
+ void stopNmea();
const int ERROR_INVALID_ARGUMENT = 1;
const int ERROR_ALREADY_INIT = 2;
const int ERROR_GENERIC = 3;
@@ -72,18 +76,27 @@
}
@Backing(type="int") @VintfStability
enum GnssAidingData {
- DELETE_EPHEMERIS = 1,
- DELETE_ALMANAC = 2,
- DELETE_POSITION = 4,
- DELETE_TIME = 8,
- DELETE_IONO = 16,
- DELETE_UTC = 32,
- DELETE_HEALTH = 64,
- DELETE_SVDIR = 128,
- DELETE_SVSTEER = 256,
- DELETE_SADATA = 512,
- DELETE_RTI = 1024,
- DELETE_CELLDB_INFO = 32768,
- DELETE_ALL = 65535,
+ EPHEMERIS = 1,
+ ALMANAC = 2,
+ POSITION = 4,
+ TIME = 8,
+ IONO = 16,
+ UTC = 32,
+ HEALTH = 64,
+ SVDIR = 128,
+ SVSTEER = 256,
+ SADATA = 512,
+ RTI = 1024,
+ CELLDB_INFO = 32768,
+ ALL = 65535,
+ }
+ @VintfStability
+ parcelable PositionModeOptions {
+ android.hardware.gnss.IGnss.GnssPositionMode mode;
+ android.hardware.gnss.IGnss.GnssPositionRecurrence recurrence;
+ int minIntervalMs;
+ int preferredAccuracyMeters;
+ int preferredTimeMs;
+ boolean lowPowerMode;
}
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl
index 27d9887..8e4b5f2 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl
@@ -42,13 +42,6 @@
NOT_AVAILABLE = 2,
}
@Backing(type="int") @VintfStability
- enum SatelliteEphemerisSource {
- DEMODULATED = 0,
- SUPL_PROVIDED = 1,
- OTHER_SERVER_PROVIDED = 2,
- OTHER = 3,
- }
- @Backing(type="int") @VintfStability
enum SatelliteEphemerisHealth {
GOOD = 0,
BAD = 1,
@@ -79,7 +72,7 @@
int svid;
android.hardware.gnss.GnssConstellationType constellation;
android.hardware.gnss.IGnssDebug.SatelliteEphemerisType ephemerisType;
- android.hardware.gnss.IGnssDebug.SatelliteEphemerisSource ephemerisSource;
+ android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource ephemerisSource;
android.hardware.gnss.IGnssDebug.SatelliteEphemerisHealth ephemerisHealth;
float ephemerisAgeSeconds;
boolean serverPredictionIsAvailable;
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl
index 8c17841..21a2520 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl
@@ -40,7 +40,19 @@
android.hardware.gnss.SatelliteClockInfo satClockInfo;
double ionoDelayMeters;
double tropoDelayMeters;
+ int TOC;
+ int IODC;
+ int TOE;
+ int IODE;
+ android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource ephemerisSource = android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource.OTHER;
const int HAS_POSITION_VELOCITY_CLOCK_INFO = 1;
const int HAS_IONO = 2;
const int HAS_TROPO = 4;
+ @Backing(type="int") @VintfStability
+ enum SatelliteEphemerisSource {
+ DEMODULATED = 0,
+ SERVER_NORMAL = 1,
+ SERVER_LONG_TERM = 2,
+ OTHER = 3,
+ }
}
diff --git a/gnss/aidl/android/hardware/gnss/GnssData.aidl b/gnss/aidl/android/hardware/gnss/GnssData.aidl
index 204eb65..6b2068e 100644
--- a/gnss/aidl/android/hardware/gnss/GnssData.aidl
+++ b/gnss/aidl/android/hardware/gnss/GnssData.aidl
@@ -76,6 +76,10 @@
* is the primary common use central frequency, e.g. L1 = 1575.45 MHz
* for GPS.
*
+ * If all the GLO frequencies have a common AGC, the FC0 (frequency
+ * channel number 0) of the individual GLO bands is used to represent
+ * all the GLO frequencies.
+ *
* For an L1, L5 receiver tracking a satellite on L1 and L5 at the same
* time, two raw measurement structs must be reported for this same
* satellite, in one of the measurement structs, all the values related
@@ -92,5 +96,5 @@
* GnssMeasurement or GnssClock fields are not reported yet. E.g., when a GNSS signal is too
* weak to be acquired, the AGC value must still be reported.
*/
- @nullable GnssAgc[] gnssAgcs;
+ GnssAgc[] gnssAgcs = {};
}
diff --git a/gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl b/gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl
index 7c25937..8f881b7 100644
--- a/gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl
+++ b/gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl
@@ -23,9 +23,13 @@
@VintfStability
@Backing(type="int")
enum AGnssType {
+ // Secure User Plane Location
SUPL = 1,
+ // CDMA2000
C2K = 2,
+ // SUPL, Emergency call over IP Multimedia Subsystem
SUPL_EIMS = 3,
+ // SUPL, IP Multimedia Subsystem
SUPL_IMS = 4,
}
diff --git a/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl b/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl
index c506b04..b505d81 100644
--- a/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl
+++ b/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl
@@ -17,7 +17,6 @@
package android.hardware.gnss;
import android.hardware.gnss.IAGnssRilCallback;
-import android.hardware.gnss.IAGnssRilCallback.SetIDType;
/**
* Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface
@@ -46,7 +45,7 @@
/** SET ID type*/
@VintfStability
@Backing(type="int")
- enum SetIDType {
+ enum SetIdType {
NONE = 0,
IMSI = 1,
MSISDM = 2,
@@ -100,7 +99,7 @@
/** Represents network connection status and capabilities. */
@VintfStability
parcelable NetworkAttributes {
- /** Network handle of the network for use with the NDK API. */
+ /** A handle representing this Network. */
long networkHandle;
/**
@@ -151,7 +150,7 @@
* If the type is NONE, then the string must be empty.
*
*/
- void setSetId(in SetIDType type, in @utf8InCpp String setid);
+ void setSetId(in SetIdType type, in @utf8InCpp String setid);
/**
* Notifies GNSS of network status changes.
diff --git a/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl b/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl
index 6fb093e..485626d 100644
--- a/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl
+++ b/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl
@@ -25,7 +25,7 @@
/**
* The Hal uses this API to request a SET ID.
*
- * @param setIdflag A bitfield of IAGnssRil.SetIDType that is required by
+ * @param setIdflag A bitfield of IAGnssRil.SetIdType that is required by
* the HAL. The framework will inject an empty SET ID if the flag is NONE.
*
*/
diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl
index 99f2ee4..12fdbb4 100644
--- a/gnss/aidl/android/hardware/gnss/IGnss.aidl
+++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl
@@ -81,19 +81,19 @@
@VintfStability
@Backing(type="int")
enum GnssAidingData {
- DELETE_EPHEMERIS = 0x0001,
- DELETE_ALMANAC = 0x0002,
- DELETE_POSITION = 0x0004,
- DELETE_TIME = 0x0008,
- DELETE_IONO = 0x0010,
- DELETE_UTC = 0x0020,
- DELETE_HEALTH = 0x0040,
- DELETE_SVDIR = 0x0080,
- DELETE_SVSTEER = 0x0100,
- DELETE_SADATA = 0x0200,
- DELETE_RTI = 0x0400,
- DELETE_CELLDB_INFO = 0x8000,
- DELETE_ALL = 0xFFFF
+ EPHEMERIS = 0x0001,
+ ALMANAC = 0x0002,
+ POSITION = 0x0004,
+ TIME = 0x0008,
+ IONO = 0x0010,
+ UTC = 0x0020,
+ HEALTH = 0x0040,
+ SVDIR = 0x0080,
+ SVSTEER = 0x0100,
+ SADATA = 0x0200,
+ RTI = 0x0400,
+ CELLDB_INFO = 0x8000,
+ ALL = 0xFFFF
}
/**
@@ -256,37 +256,56 @@
/**
* Specifies that the next call to start will not use the information defined in the flags.
- * GnssAidingData value of DELETE_ALL is passed for a cold start.
+ * GnssAidingData value of GnssAidingData::ALL is passed for a cold start.
*
* @param aidingDataFlags Flags specifying the aiding data to be deleted.
*/
void deleteAidingData(in GnssAidingData aidingDataFlags);
/**
+ * Options used in the setPositionMode() call for specifying the GNSS engine behavior.
+ */
+ @VintfStability
+ parcelable PositionModeOptions {
+ /**
+ * Must be one of MS_BASED or STANDALONE. It is allowed by the platform (and it is
+ * recommended) to fallback to MS_BASED if MS_ASSISTED is passed in, and MS_BASED is
+ * supported.
+ */
+ GnssPositionMode mode;
+
+ /* Recurrence GNSS position recurrence value, either periodic or single. */
+ GnssPositionRecurrence recurrence;
+
+ /* Represents the time between fixes in milliseconds. */
+ int minIntervalMs;
+
+ /* Represents the requested fix accuracy in meters. */
+ int preferredAccuracyMeters;
+
+ /* Represents the requested time to first fix in milliseconds. */
+ int preferredTimeMs;
+
+ /**
+ * When true, and IGnss is the only client to the GNSS hardware, the GNSS hardware must make
+ * strong tradeoffs to substantially restrict power use. Specifically, in the case of a
+ * several second long minIntervalMs, the GNSS hardware must not, on average, run power
+ * hungry operations like RF and signal searches for more than one second per interval, and
+ * must make exactly one call to gnssSvStatusCb(), and either zero or one call to
+ * GnssLocationCb() at each interval. When false, HAL must operate in the nominal mode and
+ * is expected to make power and performance tradoffs such as duty-cycling when signal
+ * conditions are good and more active searches to reacquire GNSS signals when no signals
+ * are present. When there are additional clients using the GNSS hardware other than IGnss,
+ * the GNSS hardware may operate in a higher power mode, on behalf of those clients.
+ */
+ boolean lowPowerMode;
+ }
+
+ /**
* Sets the GnssPositionMode parameter, its associated recurrence value, the time between fixes,
* requested fix accuracy, time to first fix.
- *
- * @param mode Parameter must be one of MS_BASED or STANDALONE. It is allowed by the platform
- * (and it is recommended) to fallback to MS_BASED if MS_ASSISTED is passed in, and MS_BASED
- * is supported.
- * @param recurrence GNSS position recurrence value, either periodic or single.
- * @param minIntervalMs Represents the time between fixes in milliseconds.
- * @param preferredAccuracyMeters Represents the requested fix accuracy in meters.
- * @param preferredTimeMs Represents the requested time to first fix in milliseconds.
- * @param lowPowerMode When true, and IGnss is the only client to the GNSS hardware, the GNSS
- * hardware must make strong tradeoffs to substantially restrict power use. Specifically, in
- * the case of a several second long minIntervalMs, the GNSS hardware must not, on average,
- * run power hungry operations like RF and signal searches for more than one second per
- * interval, and must make exactly one call to gnssSvStatusCb(), and either zero or one call
- * to GnssLocationCb() at each interval. When false, HAL must operate in the nominal mode
- * and is expected to make power and performance tradoffs such as duty-cycling when signal
- * conditions are good and more active searches to reacquire GNSS signals when no signals
- * are present. When there are additional clients using the GNSS hardware other than IGnss,
- * the GNSS hardware may operate in a higher power mode, on behalf of those clients.
*/
- void setPositionMode(in GnssPositionMode mode, in GnssPositionRecurrence recurrence,
- in int minIntervalMs, in int preferredAccuracyMeters, in int preferredTimeMs,
- in boolean lowPowerMode);
+ void setPositionMode(in PositionModeOptions options);
/*
* This method returns the IGnssAntennaInfo.
@@ -301,4 +320,25 @@
* @return Handle to the IMeasurementCorrectionsInterface.
*/
@nullable IMeasurementCorrectionsInterface getExtensionMeasurementCorrections();
+
+ /**
+ * Starts a SvStatus output stream using the IGnssCallback gnssSvStatusCb().
+ */
+ void startSvStatus();
+
+ /**
+ * Stops the SvStatus output stream.
+ */
+ void stopSvStatus();
+
+ /**
+ * Starts an NMEA (National Marine Electronics Association) output stream using the
+ * IGnssCallback gnssNmeaCb().
+ */
+ void startNmea();
+
+ /**
+ * Stops the NMEA output stream.
+ */
+ void stopNmea();
}
diff --git a/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl
index a74d097..866606f 100644
--- a/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl
+++ b/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl
@@ -202,6 +202,10 @@
/**
* Callback for the HAL to pass a vector of GnssSvInfo back to the client.
*
+ * If GnssMeasurement is registered, the SvStatus report interval is the same as the measurement
+ * interval, i.e., the interval the measurement engine runs at. If GnssMeasurement is not
+ * registered, the SvStatus interval is the same as the location interval.
+ *
* @param svInfo SV status information from HAL.
*/
void gnssSvStatusCb(in GnssSvInfo[] svInfoList);
diff --git a/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl b/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl
index 475a4a3..3071dce5 100644
--- a/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl
+++ b/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl
@@ -17,6 +17,7 @@
package android.hardware.gnss;
import android.hardware.gnss.GnssConstellationType;
+import android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource;
/**
* Extended interface for GNSS Debug support
@@ -35,16 +36,6 @@
NOT_AVAILABLE = 2,
}
- /** Satellite's ephemeris source */
- @VintfStability
- @Backing(type="int")
- enum SatelliteEphemerisSource {
- DEMODULATED = 0,
- SUPL_PROVIDED = 1,
- OTHER_SERVER_PROVIDED = 2,
- OTHER = 3,
- }
-
/** Satellite's ephemeris health */
@VintfStability
@Backing(type="int")
diff --git a/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl b/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl
index a238e3f..e79249d 100644
--- a/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl
+++ b/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl
@@ -74,4 +74,62 @@
/** Tropospheric delay in meters. */
double tropoDelayMeters;
+
+ /**
+ * Time of Clock.
+ *
+ * This is defined in GPS ICD200 documentation
+ * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf).
+ */
+ int TOC;
+
+ /**
+ * Issue of Data, Clock.
+ *
+ * This is defined in GPS ICD200 documentation
+ * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf).
+ *
+ * The field must be set to 0 if it is not supported.
+ */
+ int IODC;
+
+ /**
+ * Time of Ephemeris.
+ *
+ * This is defined in GPS ICD200 documentation
+ * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf).
+ */
+ int TOE;
+
+ /**
+ * Issue of Data, Ephemeris.
+ *
+ * This is defined in GPS ICD200 documentation
+ * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf).
+ *
+ * The field must be set to 0 if it is not supported.
+ */
+ int IODE;
+
+ /** Satellite's ephemeris source */
+ @VintfStability
+ @Backing(type="int")
+ enum SatelliteEphemerisSource {
+ // Demodulated from broadcast signals
+ DEMODULATED = 0,
+ // Server provided Normal type ephemeris data, which is similar to broadcast ephemeris in
+ // longevity (e.g. SUPL) - lasting for few hours and providing satellite orbit and clock
+ // with accuracy of 1 - 2 meters.
+ SERVER_NORMAL = 1,
+ // Server provided Long-Term type ephemeris data, which lasts for many hours to several days
+ // and often provides satellite orbit and clock accuracy of 2 - 20 meters.
+ SERVER_LONG_TERM = 2,
+ // Other source
+ OTHER = 3,
+ }
+
+ /**
+ * Source of the ephemeris.
+ */
+ SatelliteEphemerisSource ephemerisSource = SatelliteEphemerisSource.OTHER;
}
diff --git a/gnss/aidl/default/AGnssRil.cpp b/gnss/aidl/default/AGnssRil.cpp
index afe0039..2aa1abc 100644
--- a/gnss/aidl/default/AGnssRil.cpp
+++ b/gnss/aidl/default/AGnssRil.cpp
@@ -41,7 +41,7 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus AGnssRil::setSetId(SetIDType type, const std::string& setid) {
+ndk::ScopedAStatus AGnssRil::setSetId(SetIdType type, const std::string& setid) {
ALOGD("AGnssRil::setSetId: type:%s, setid: %s", toString(type).c_str(), setid.c_str());
return ndk::ScopedAStatus::ok();
}
diff --git a/gnss/aidl/default/AGnssRil.h b/gnss/aidl/default/AGnssRil.h
index 7e429ee..e205b69 100644
--- a/gnss/aidl/default/AGnssRil.h
+++ b/gnss/aidl/default/AGnssRil.h
@@ -24,7 +24,7 @@
public:
ndk::ScopedAStatus setCallback(const std::shared_ptr<IAGnssRilCallback>& callback) override;
ndk::ScopedAStatus setRefLocation(const AGnssRefLocation& agnssReflocation) override;
- ndk::ScopedAStatus setSetId(SetIDType type, const std::string& setid) override;
+ ndk::ScopedAStatus setSetId(SetIdType type, const std::string& setid) override;
ndk::ScopedAStatus updateNetworkState(const NetworkAttributes& attributes) override;
private:
diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp
index 73f4085..af1dd5c 100644
--- a/gnss/aidl/default/Gnss.cpp
+++ b/gnss/aidl/default/Gnss.cpp
@@ -87,15 +87,13 @@
mIsActive = true;
this->reportGnssStatusValue(IGnssCallback::GnssStatusValue::SESSION_BEGIN);
mThread = std::thread([this]() {
- auto svStatus = filterBlocklistedSatellites(Utils::getMockSvInfoList());
- this->reportSvStatus(svStatus);
+ this->reportSvStatus();
if (!mFirstFixReceived) {
std::this_thread::sleep_for(std::chrono::milliseconds(TTFF_MILLIS));
mFirstFixReceived = true;
}
while (mIsActive == true) {
- auto svStatus = filterBlocklistedSatellites(Utils::getMockSvInfoList());
- this->reportSvStatus(svStatus);
+ this->reportSvStatus();
auto currentLocation = getLocationFromHW();
mGnssPowerIndication->notePowerConsumption();
@@ -124,6 +122,13 @@
return;
}
+void Gnss::reportSvStatus() const {
+ if (mIsSvStatusActive) {
+ auto svStatus = filterBlocklistedSatellites(Utils::getMockSvInfoList());
+ reportSvStatus(svStatus);
+ }
+}
+
void Gnss::reportSvStatus(const std::vector<GnssSvInfo>& svInfoList) const {
std::unique_lock<std::mutex> lock(mMutex);
if (sGnssCallback == nullptr) {
@@ -136,7 +141,8 @@
}
}
-std::vector<GnssSvInfo> Gnss::filterBlocklistedSatellites(std::vector<GnssSvInfo> gnssSvInfoList) {
+std::vector<GnssSvInfo> Gnss::filterBlocklistedSatellites(
+ std::vector<GnssSvInfo> gnssSvInfoList) const {
ALOGD("filterBlocklistedSatellites");
for (uint32_t i = 0; i < gnssSvInfoList.size(); i++) {
if (mGnssConfiguration->isBlocklisted(gnssSvInfoList[i])) {
@@ -168,6 +174,26 @@
return ScopedAStatus::ok();
}
+ScopedAStatus Gnss::startSvStatus() {
+ ALOGD("startSvStatus");
+ mIsSvStatusActive = true;
+ return ScopedAStatus::ok();
+}
+
+ScopedAStatus Gnss::stopSvStatus() {
+ ALOGD("stopSvStatus");
+ mIsSvStatusActive = false;
+ return ScopedAStatus::ok();
+}
+ScopedAStatus Gnss::startNmea() {
+ ALOGD("startNmea");
+ return ScopedAStatus::ok();
+}
+ScopedAStatus Gnss::stopNmea() {
+ ALOGD("stopNmea");
+ return ScopedAStatus::ok();
+}
+
ScopedAStatus Gnss::close() {
ALOGD("close");
sGnssCallback = nullptr;
@@ -210,11 +236,10 @@
return ScopedAStatus::ok();
}
-ScopedAStatus Gnss::setPositionMode(GnssPositionMode, GnssPositionRecurrence, int minIntervalMs,
- int /* preferredAccuracyMeters */, int /* preferredTimeMs */,
- bool lowPowerMode) {
- ALOGD("setPositionMode. minIntervalMs:%d, lowPowerMode:%d", minIntervalMs, (int)lowPowerMode);
- mMinIntervalMs = minIntervalMs;
+ScopedAStatus Gnss::setPositionMode(const PositionModeOptions& options) {
+ ALOGD("setPositionMode. minIntervalMs:%d, lowPowerMode:%d", options.minIntervalMs,
+ (int)options.lowPowerMode);
+ mMinIntervalMs = options.minIntervalMs;
return ScopedAStatus::ok();
}
diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h
index 36874b8..1489b4b 100644
--- a/gnss/aidl/default/Gnss.h
+++ b/gnss/aidl/default/Gnss.h
@@ -50,9 +50,11 @@
ndk::ScopedAStatus injectLocation(const GnssLocation& location) override;
ndk::ScopedAStatus injectBestLocation(const GnssLocation& location) override;
ndk::ScopedAStatus deleteAidingData(GnssAidingData aidingDataFlags) override;
- ndk::ScopedAStatus setPositionMode(GnssPositionMode mode, GnssPositionRecurrence recurrence,
- int minIntervalMs, int preferredAccuracyMeters,
- int preferredTimeMs, bool lowPowerMode) override;
+ ndk::ScopedAStatus setPositionMode(const PositionModeOptions& options) override;
+ ndk::ScopedAStatus startSvStatus() override;
+ ndk::ScopedAStatus stopSvStatus() override;
+ ndk::ScopedAStatus startNmea() override;
+ ndk::ScopedAStatus stopNmea() override;
ndk::ScopedAStatus getExtensionPsds(std::shared_ptr<IGnssPsds>* iGnssPsds) override;
ndk::ScopedAStatus getExtensionGnssConfiguration(
@@ -85,9 +87,10 @@
private:
void reportLocation(const GnssLocation&) const;
+ void reportSvStatus() const;
void reportSvStatus(const std::vector<IGnssCallback::GnssSvInfo>& svInfoList) const;
std::vector<IGnssCallback::GnssSvInfo> filterBlocklistedSatellites(
- std::vector<IGnssCallback::GnssSvInfo> gnssSvInfoList);
+ std::vector<IGnssCallback::GnssSvInfo> gnssSvInfoList) const;
void reportGnssStatusValue(const IGnssCallback::GnssStatusValue gnssStatusValue) const;
std::unique_ptr<GnssLocation> getLocationFromHW();
@@ -95,6 +98,7 @@
std::atomic<long> mMinIntervalMs;
std::atomic<bool> mIsActive;
+ std::atomic<bool> mIsSvStatusActive;
std::atomic<bool> mFirstFixReceived;
std::thread mThread;
diff --git a/gnss/aidl/vts/gnss_hal_test.cpp b/gnss/aidl/vts/gnss_hal_test.cpp
index 13c32ee..c1128ba 100644
--- a/gnss/aidl/vts/gnss_hal_test.cpp
+++ b/gnss/aidl/vts/gnss_hal_test.cpp
@@ -79,9 +79,14 @@
const int kPreferredAccuracy = 0; // Ideally perfect (matches GnssLocationProvider)
const int kPreferredTimeMsec = 0; // Ideally immediate
- auto status = aidl_gnss_hal_->setPositionMode(
- IGnss::GnssPositionMode::MS_BASED, IGnss::GnssPositionRecurrence::RECURRENCE_PERIODIC,
- min_interval_msec, kPreferredAccuracy, kPreferredTimeMsec, low_power_mode);
+ IGnss::PositionModeOptions options;
+ options.mode = IGnss::GnssPositionMode::MS_BASED;
+ options.recurrence = IGnss::GnssPositionRecurrence::RECURRENCE_PERIODIC;
+ options.minIntervalMs = min_interval_msec;
+ options.preferredAccuracyMeters = kPreferredAccuracy;
+ options.preferredTimeMs = kPreferredTimeMsec;
+ options.lowPowerMode = low_power_mode;
+ auto status = aidl_gnss_hal_->setPositionMode(options);
ASSERT_TRUE(status.isOk());
}
@@ -95,9 +100,11 @@
}
SetPositionMode(min_interval_msec, low_power_mode);
- auto result = aidl_gnss_hal_->start();
+ auto status = aidl_gnss_hal_->start();
+ EXPECT_TRUE(status.isOk());
- EXPECT_TRUE(result.isOk());
+ status = aidl_gnss_hal_->startSvStatus();
+ EXPECT_TRUE(status.isOk());
/*
* GnssLocationProvider support of AGPS SUPL & XtraDownloader is not available in VTS,
@@ -124,8 +131,10 @@
// Invoke the super method.
return GnssHalTestTemplate<IGnss_V2_1>::StopAndClearLocations();
}
+ auto status = aidl_gnss_hal_->stopSvStatus();
+ EXPECT_TRUE(status.isOk());
- auto status = aidl_gnss_hal_->stop();
+ status = aidl_gnss_hal_->stop();
EXPECT_TRUE(status.isOk());
/*
diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp
index 1fa6825..8e51b44 100644
--- a/gnss/aidl/vts/gnss_hal_test_cases.cpp
+++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp
@@ -102,7 +102,7 @@
}
}
-void CheckSatellitePvt(const SatellitePvt& satellitePvt) {
+void CheckSatellitePvt(const SatellitePvt& satellitePvt, const int interfaceVersion) {
const double kMaxOrbitRadiusMeters = 43000000.0;
const double kMaxVelocityMps = 4000.0;
// The below values are determined using GPS ICD Table 20-1
@@ -147,6 +147,14 @@
ALOGD("Found HAS_TROPO");
ASSERT_TRUE(satellitePvt.tropoDelayMeters > 0 && satellitePvt.tropoDelayMeters < 100);
}
+ if (interfaceVersion >= 2) {
+ ASSERT_TRUE(satellitePvt.TOC >= 0 && satellitePvt.TOC <= 604784);
+ ASSERT_TRUE(satellitePvt.TOE >= 0 && satellitePvt.TOE <= 604784);
+ // IODC has 10 bits
+ ASSERT_TRUE(satellitePvt.IODC >= 0 && satellitePvt.IODC <= 1023);
+ // IODE has 8 bits
+ ASSERT_TRUE(satellitePvt.IODE >= 0 && satellitePvt.IODE <= 255);
+ }
}
void CheckGnssMeasurementClockFields(const GnssData& measurement) {
@@ -226,7 +234,7 @@
kIsSatellitePvtSupported == true) {
ALOGD("Found a measurement with SatellitePvt");
satellitePvtFound = true;
- CheckSatellitePvt(measurement.satellitePvt);
+ CheckSatellitePvt(measurement.satellitePvt, aidl_gnss_hal_->getInterfaceVersion());
}
}
}
@@ -337,7 +345,7 @@
auto powerStats1 = gnssPowerIndicationCallback->last_gnss_power_stats_;
// Get a location and request another GnssPowerStats
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
gnss_cb_->location_cbq_.reset();
} else {
aidl_gnss_cb_->location_cbq_.reset();
@@ -416,18 +424,18 @@
const int kLocationsToAwait = 3;
const int kRetriesToUnBlocklist = 10;
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
gnss_cb_->location_cbq_.reset();
} else {
aidl_gnss_cb_->location_cbq_.reset();
}
StartAndCheckLocations(kLocationsToAwait);
- int location_called_count = (aidl_gnss_hal_->getInterfaceVersion() == 1)
+ int location_called_count = (aidl_gnss_hal_->getInterfaceVersion() <= 1)
? gnss_cb_->location_cbq_.calledCount()
: aidl_gnss_cb_->location_cbq_.calledCount();
// Tolerate 1 less sv status to handle edge cases in reporting.
- int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1)
+ int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() <= 1)
? gnss_cb_->sv_info_list_cbq_.size()
: aidl_gnss_cb_->sv_info_list_cbq_.size();
EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait);
@@ -442,7 +450,7 @@
const int kGnssSvInfoListTimeout = 2;
BlocklistedSource source_to_blocklist;
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
std::list<hidl_vec<IGnssCallback_2_1::GnssSvInfo>> sv_info_vec_list;
int count = gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec_list, sv_info_list_cbq_size,
kGnssSvInfoListTimeout);
@@ -480,7 +488,7 @@
ASSERT_TRUE(status.isOk());
// retry and ensure satellite not used
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
gnss_cb_->sv_info_list_cbq_.reset();
gnss_cb_->location_cbq_.reset();
} else {
@@ -491,7 +499,7 @@
StartAndCheckLocations(kLocationsToAwait);
// early exit if test is being run with insufficient signal
- location_called_count = (aidl_gnss_hal_->getInterfaceVersion() == 1)
+ location_called_count = (aidl_gnss_hal_->getInterfaceVersion() <= 1)
? gnss_cb_->location_cbq_.calledCount()
: aidl_gnss_cb_->location_cbq_.calledCount();
if (location_called_count == 0) {
@@ -500,14 +508,14 @@
ASSERT_TRUE(location_called_count > 0);
// Tolerate 1 less sv status to handle edge cases in reporting.
- sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1)
+ sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() <= 1)
? gnss_cb_->sv_info_list_cbq_.size()
: aidl_gnss_cb_->sv_info_list_cbq_.size();
EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait);
ALOGD("Observed %d GnssSvInfo, while awaiting %d Locations (%d received)",
sv_info_list_cbq_size, kLocationsToAwait, location_called_count);
for (int i = 0; i < sv_info_list_cbq_size; ++i) {
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
hidl_vec<IGnssCallback_2_1::GnssSvInfo> sv_info_vec;
gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout);
for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) {
@@ -542,7 +550,7 @@
while (!strongest_sv_is_reobserved && (unblocklist_loops_remaining-- > 0)) {
StopAndClearLocations();
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
gnss_cb_->sv_info_list_cbq_.reset();
gnss_cb_->location_cbq_.reset();
} else {
@@ -552,7 +560,7 @@
StartAndCheckLocations(kLocationsToAwait);
// early exit loop if test is being run with insufficient signal
- location_called_count = (aidl_gnss_hal_->getInterfaceVersion() == 1)
+ location_called_count = (aidl_gnss_hal_->getInterfaceVersion() <= 1)
? gnss_cb_->location_cbq_.calledCount()
: aidl_gnss_cb_->location_cbq_.calledCount();
if (location_called_count == 0) {
@@ -561,7 +569,7 @@
ASSERT_TRUE(location_called_count > 0);
// Tolerate 1 less sv status to handle edge cases in reporting.
- sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1)
+ sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() <= 1)
? gnss_cb_->sv_info_list_cbq_.size()
: aidl_gnss_cb_->sv_info_list_cbq_.size();
EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait);
@@ -570,7 +578,7 @@
sv_info_list_cbq_size, kLocationsToAwait, unblocklist_loops_remaining);
for (int i = 0; i < sv_info_list_cbq_size; ++i) {
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
hidl_vec<IGnssCallback_2_1::GnssSvInfo> sv_info_vec;
gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout);
for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) {
@@ -655,7 +663,7 @@
ASSERT_TRUE(status.isOk());
// retry and ensure constellation not used
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
gnss_cb_->sv_info_list_cbq_.reset();
gnss_cb_->location_cbq_.reset();
} else {
@@ -665,14 +673,14 @@
StartAndCheckLocations(kLocationsToAwait);
// Tolerate 1 less sv status to handle edge cases in reporting.
- int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1)
+ int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() <= 1)
? gnss_cb_->sv_info_list_cbq_.size()
: aidl_gnss_cb_->sv_info_list_cbq_.size();
EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait);
ALOGD("Observed %d GnssSvInfo, while awaiting %d Locations", sv_info_list_cbq_size,
kLocationsToAwait);
for (int i = 0; i < sv_info_list_cbq_size; ++i) {
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
hidl_vec<IGnssCallback_2_1::GnssSvInfo> sv_info_vec;
gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout);
for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) {
@@ -758,7 +766,7 @@
StopAndClearLocations();
// retry and ensure constellation not used
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
gnss_cb_->sv_info_list_cbq_.reset();
gnss_cb_->location_cbq_.reset();
} else {
@@ -768,14 +776,14 @@
StartAndCheckLocations(kLocationsToAwait);
// Tolerate 1 less sv status to handle edge cases in reporting.
- int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1)
+ int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() <= 1)
? gnss_cb_->sv_info_list_cbq_.size()
: aidl_gnss_cb_->sv_info_list_cbq_.size();
EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait);
ALOGD("Observed %d GnssSvInfo, while awaiting %d Locations", sv_info_list_cbq_size,
kLocationsToAwait);
for (int i = 0; i < sv_info_list_cbq_size; ++i) {
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
hidl_vec<IGnssCallback_2_1::GnssSvInfo> sv_info_vec;
gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout);
for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) {
@@ -813,7 +821,7 @@
* TestAllExtensions.
*/
TEST_P(GnssHalTest, TestAllExtensions) {
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
return;
}
@@ -855,7 +863,7 @@
* 3. Sets SUPL server host/port.
*/
TEST_P(GnssHalTest, TestAGnssExtension) {
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
return;
}
sp<IAGnss> iAGnss;
@@ -879,7 +887,7 @@
* 3. Sets reference location.
*/
TEST_P(GnssHalTest, TestAGnssRilExtension) {
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
return;
}
sp<IAGnssRil> iAGnssRil;
@@ -913,7 +921,7 @@
* Ensures that GnssDebug values make sense.
*/
TEST_P(GnssHalTest, GnssDebugValuesSanityTest) {
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
return;
}
sp<IGnssDebug> iGnssDebug;
@@ -962,7 +970,7 @@
* 3. Sets proxy apps
*/
TEST_P(GnssHalTest, TestGnssVisibilityControlExtension) {
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
return;
}
sp<IGnssVisibilityControl> iGnssVisibilityControl;
@@ -986,7 +994,7 @@
* and verifies mandatory fields are valid.
*/
TEST_P(GnssHalTest, TestGnssMeasurementSetCallbackWithOptions) {
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
return;
}
const int kFirstGnssMeasurementTimeoutSeconds = 10;
@@ -1024,7 +1032,7 @@
* 2. Sets a GnssMeasurementCallback, waits for a measurement.
*/
TEST_P(GnssHalTest, TestGnssAgcInGnssMeasurement) {
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
return;
}
const int kFirstGnssMeasurementTimeoutSeconds = 10;
@@ -1050,10 +1058,9 @@
// Validity check GnssData fields
CheckGnssMeasurementClockFields(lastMeasurement);
- ASSERT_TRUE(lastMeasurement.gnssAgcs.has_value());
- for (const auto& gnssAgc : lastMeasurement.gnssAgcs.value()) {
- ASSERT_TRUE(gnssAgc.has_value());
- ASSERT_TRUE(gnssAgc.value().carrierFrequencyHz >= 0);
+ ASSERT_TRUE(lastMeasurement.gnssAgcs.size() > 0);
+ for (const auto& gnssAgc : lastMeasurement.gnssAgcs) {
+ ASSERT_TRUE(gnssAgc.carrierFrequencyHz >= 0);
}
}
@@ -1071,7 +1078,7 @@
TEST_P(GnssHalTest, TestGnssAntennaInfo) {
const int kAntennaInfoTimeoutSeconds = 2;
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
return;
}
@@ -1149,7 +1156,7 @@
* capability flag is set.
*/
TEST_P(GnssHalTest, TestGnssMeasurementCorrections) {
- if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
return;
}
if (!(aidl_gnss_cb_->last_capabilities_ &
diff --git a/gnss/common/utils/default/Utils.cpp b/gnss/common/utils/default/Utils.cpp
index 1ff84eb..4e6a718 100644
--- a/gnss/common/utils/default/Utils.cpp
+++ b/gnss/common/utils/default/Utils.cpp
@@ -32,6 +32,7 @@
using aidl::android::hardware::gnss::GnssLocation;
using aidl::android::hardware::gnss::GnssMeasurement;
using aidl::android::hardware::gnss::IGnss;
+using aidl::android::hardware::gnss::IGnssDebug;
using aidl::android::hardware::gnss::IGnssMeasurementCallback;
using aidl::android::hardware::gnss::SatellitePvt;
using GnssSvInfo = aidl::android::hardware::gnss::IGnssCallback::GnssSvInfo;
@@ -181,21 +182,30 @@
.fullInterSignalBiasUncertaintyNs = 792.0,
.satelliteInterSignalBiasNs = 233.9,
.satelliteInterSignalBiasUncertaintyNs = 921.2,
- .satellitePvt = {.flags = SatellitePvt::HAS_POSITION_VELOCITY_CLOCK_INFO |
- SatellitePvt::HAS_IONO | SatellitePvt::HAS_TROPO,
- .satPosEcef = {.posXMeters = 10442993.1153328,
- .posYMeters = -19926932.8051666,
- .posZMeters = -12034295.0216203,
- .ureMeters = 1000.2345678},
- .satVelEcef = {.velXMps = -478.667183715732,
- .velYMps = 1580.68371984114,
- .velZMps = -3030.52994449997,
- .ureRateMps = 10.2345678},
- .satClockInfo = {.satHardwareCodeBiasMeters = 1.396983861923e-09,
- .satTimeCorrectionMeters = -7113.08964331,
- .satClkDriftMps = 0},
- .ionoDelayMeters = 3.069949602639317e-08,
- .tropoDelayMeters = 3.882265204404031},
+ .satellitePvt =
+ {
+ .flags = SatellitePvt::HAS_POSITION_VELOCITY_CLOCK_INFO |
+ SatellitePvt::HAS_IONO | SatellitePvt::HAS_TROPO,
+ .satPosEcef = {.posXMeters = 10442993.1153328,
+ .posYMeters = -19926932.8051666,
+ .posZMeters = -12034295.0216203,
+ .ureMeters = 1000.2345678},
+ .satVelEcef = {.velXMps = -478.667183715732,
+ .velYMps = 1580.68371984114,
+ .velZMps = -3030.52994449997,
+ .ureRateMps = 10.2345678},
+ .satClockInfo = {.satHardwareCodeBiasMeters = 1.396983861923e-09,
+ .satTimeCorrectionMeters = -7113.08964331,
+ .satClkDriftMps = 0},
+ .ionoDelayMeters = 3.069949602639317e-08,
+ .tropoDelayMeters = 3.882265204404031,
+ .ephemerisSource =
+ SatellitePvt::SatelliteEphemerisSource::SERVER_LONG_TERM,
+ .TOC = 12345,
+ .IODC = 143,
+ .TOE = 9876,
+ .IODE = 48,
+ },
.correlationVectors = {}};
GnssClock clock = {.gnssClockFlags = GnssClock::HAS_FULL_BIAS | GnssClock::HAS_BIAS |
@@ -247,8 +257,7 @@
GnssData gnssData = {.measurements = {measurement},
.clock = clock,
.elapsedRealtime = timestamp,
- .gnssAgcs = std::make_optional(std::vector(
- {std::make_optional(gnssAgc1), std::make_optional(gnssAgc2)}))};
+ .gnssAgcs = std::vector({gnssAgc1, gnssAgc2})};
return gnssData;
}
diff --git a/graphics/OWNERS b/graphics/OWNERS
new file mode 100644
index 0000000..75ceb23
--- /dev/null
+++ b/graphics/OWNERS
@@ -0,0 +1,9 @@
+# Bug component: 1075130
+
+# Graphics team
+adyabr@google.com
+alecmouri@google.com
+chrisforbes@google.com
+jreck@google.com
+lpy@google.com
+sumir@google.com
\ No newline at end of file
diff --git a/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl b/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl
index 8c3ca96..92dfd4f 100644
--- a/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl
+++ b/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl
@@ -29,8 +29,8 @@
* @param descriptor Properties of the buffers to allocate. This must be
* obtained from IMapper::createDescriptor().
* @param count The number of buffers to allocate.
- * @return An AllocationResult containing the result of an error, or
- * an AllocationError status
+ * @return An AllocationResult containing the result of the allocation
+ * @throws AllocationError on failure
*/
AllocationResult allocate(in byte[] descriptor, in int count);
}
diff --git a/graphics/allocator/aidl/vts/Android.bp b/graphics/allocator/aidl/vts/Android.bp
new file mode 100644
index 0000000..d74129b
--- /dev/null
+++ b/graphics/allocator/aidl/vts/Android.bp
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2021, 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 {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_test {
+ name: "VtsHalGraphicsAllocatorAidl_TargetTest",
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ srcs: [
+ "VtsHalGraphicsAllocatorAidl_TargetTest.cpp",
+ ],
+
+ shared_libs: [
+ "android.hardware.graphics.allocator-V1-ndk",
+ "android.hardware.graphics.common-V3-ndk",
+ "android.hardware.graphics.mapper@4.0",
+ "libEGL",
+ "libGLESv2",
+ "libbinder_ndk",
+ "libbase",
+ "libsync",
+ "libui",
+ "libgui",
+ "libhidlbase",
+ "libvndksupport",
+ ],
+ static_libs: [
+ "libaidlcommonsupport",
+ "libgtest",
+ ],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+}
diff --git a/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp b/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp
new file mode 100644
index 0000000..784bc66
--- /dev/null
+++ b/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "VtsHalGraphicsAllocatorAidl_TargetTest"
+
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/graphics/allocator/AllocationError.h>
+#include <aidl/android/hardware/graphics/allocator/AllocationResult.h>
+#include <aidl/android/hardware/graphics/allocator/IAllocator.h>
+#include <aidl/android/hardware/graphics/common/BufferUsage.h>
+#include <aidl/android/hardware/graphics/common/PixelFormat.h>
+#include <aidlcommonsupport/NativeHandle.h>
+#include <android/binder_manager.h>
+#include <android/hardware/graphics/mapper/4.0/IMapper.h>
+#include <gtest/gtest.h>
+#include <hidl/GtestPrinter.h>
+#include <hidl/ServiceManagement.h>
+#include <initializer_list>
+#include <optional>
+#include <string>
+#include <tuple>
+
+using namespace aidl::android::hardware::graphics::allocator;
+using namespace aidl::android::hardware::graphics::common;
+using namespace android;
+using namespace android::hardware;
+using namespace android::hardware::graphics::mapper::V4_0;
+
+static constexpr uint64_t pack(const std::initializer_list<BufferUsage>& usages) {
+ uint64_t ret = 0;
+ for (const auto u : usages) {
+ ret |= static_cast<uint64_t>(u);
+ }
+ return ret;
+}
+
+static constexpr hardware::graphics::common::V1_2::PixelFormat cast(PixelFormat format) {
+ return static_cast<hardware::graphics::common::V1_2::PixelFormat>(format);
+}
+
+class BufferHandle {
+ sp<IMapper> mMapper;
+ native_handle_t* mRawHandle;
+ bool mImported = false;
+ uint32_t mStride;
+
+ BufferHandle(const BufferHandle&) = delete;
+ void operator=(const BufferHandle&) = delete;
+
+ public:
+ BufferHandle(const sp<IMapper> mapper, native_handle_t* handle, bool imported, uint32_t stride)
+ : mMapper(mapper), mRawHandle(handle), mImported(imported), mStride(stride) {}
+
+ ~BufferHandle() {
+ if (mRawHandle == nullptr) return;
+
+ if (mImported) {
+ Error error = mMapper->freeBuffer(mRawHandle);
+ EXPECT_EQ(Error::NONE, error) << "failed to free buffer " << mRawHandle;
+ } else {
+ native_handle_close(mRawHandle);
+ native_handle_delete(mRawHandle);
+ }
+ }
+
+ uint32_t stride() const { return mStride; }
+};
+
+class GraphicsAllocatorAidlTests
+ : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
+ private:
+ std::shared_ptr<IAllocator> mAllocator;
+ sp<IMapper> mMapper;
+
+ public:
+ void SetUp() override {
+ mAllocator = IAllocator::fromBinder(
+ ndk::SpAIBinder(AServiceManager_checkService(std::get<0>(GetParam()).c_str())));
+ mMapper = IMapper::getService(std::get<1>(GetParam()));
+
+ ASSERT_NE(nullptr, mAllocator.get()) << "failed to get allocator service";
+ ASSERT_NE(nullptr, mMapper.get()) << "failed to get mapper service";
+ ASSERT_FALSE(mMapper->isRemote()) << "mapper is not in passthrough mode";
+ }
+
+ void TearDown() override {}
+
+ BufferDescriptor createDescriptor(const IMapper::BufferDescriptorInfo& descriptorInfo) {
+ BufferDescriptor descriptor;
+ mMapper->createDescriptor(
+ descriptorInfo, [&](const auto& tmpError, const auto& tmpDescriptor) {
+ ASSERT_EQ(Error::NONE, tmpError) << "failed to create descriptor";
+ descriptor = tmpDescriptor;
+ });
+
+ return descriptor;
+ }
+
+ native_handle_t* importBuffer(const hidl_handle& rawHandle) {
+ native_handle_t* bufferHandle = nullptr;
+ mMapper->importBuffer(rawHandle, [&](const auto& tmpError, const auto& tmpBuffer) {
+ ASSERT_EQ(Error::NONE, tmpError)
+ << "failed to import buffer %p" << rawHandle.getNativeHandle();
+ bufferHandle = static_cast<native_handle_t*>(tmpBuffer);
+ });
+ return bufferHandle;
+ }
+
+ std::unique_ptr<BufferHandle> allocate(const IMapper::BufferDescriptorInfo& descriptorInfo,
+ bool import = false) {
+ auto descriptor = createDescriptor(descriptorInfo);
+ if (::testing::Test::HasFatalFailure()) {
+ return nullptr;
+ }
+
+ AllocationResult result;
+ auto status = mAllocator->allocate(descriptor, 1, &result);
+ if (!status.isOk()) {
+ status_t error = status.getExceptionCode();
+ if (error == EX_SERVICE_SPECIFIC) {
+ error = status.getServiceSpecificError();
+ EXPECT_NE(OK, error) << "Failed to set error properly";
+ EXPECT_EQ(OK, error) << "Failed to allocate";
+ } else {
+ EXPECT_EQ(OK, error) << "Allocation transport failure";
+ }
+ return nullptr;
+ } else {
+ if (import) {
+ native_handle_t* importedHandle = importBuffer(makeFromAidl(result.buffers[0]));
+ if (importedHandle) {
+ return std::make_unique<BufferHandle>(mMapper, importedHandle, true,
+ result.stride);
+ } else {
+ return nullptr;
+ }
+ } else {
+ return std::make_unique<BufferHandle>(mMapper, dupFromAidl(result.buffers[0]),
+ false, result.stride);
+ }
+ }
+ }
+};
+
+TEST_P(GraphicsAllocatorAidlTests, CreateDescriptorBasic) {
+ ASSERT_NO_FATAL_FAILURE(createDescriptor({
+ .name = "CPU_8888",
+ .width = 64,
+ .height = 64,
+ .layerCount = 1,
+ .format = cast(PixelFormat::RGBA_8888),
+ .usage = pack({BufferUsage::CPU_WRITE_OFTEN, BufferUsage::CPU_READ_OFTEN}),
+ .reservedSize = 0,
+ }));
+}
+
+TEST_P(GraphicsAllocatorAidlTests, CanAllocate) {
+ auto buffer = allocate({
+ .name = "CPU_8888",
+ .width = 64,
+ .height = 64,
+ .layerCount = 1,
+ .format = cast(PixelFormat::RGBA_8888),
+ .usage = pack({BufferUsage::CPU_WRITE_OFTEN, BufferUsage::CPU_READ_OFTEN}),
+ .reservedSize = 0,
+ });
+ ASSERT_NE(nullptr, buffer.get());
+ EXPECT_GE(buffer->stride(), 64);
+}
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsAllocatorAidlTests);
+INSTANTIATE_TEST_CASE_P(
+ PerInstance, GraphicsAllocatorAidlTests,
+ testing::Combine(testing::ValuesIn(getAidlHalInstanceNames(IAllocator::descriptor)),
+ testing::ValuesIn(getAllHalInstanceNames(IMapper::descriptor))),
+ PrintInstanceTupleNameToString<>);
\ No newline at end of file
diff --git a/graphics/bufferqueue/1.0/Android.bp b/graphics/bufferqueue/1.0/Android.bp
index eda80d7..c3d38d0 100644
--- a/graphics/bufferqueue/1.0/Android.bp
+++ b/graphics/bufferqueue/1.0/Android.bp
@@ -25,4 +25,9 @@
"android.hidl.base@1.0",
],
gen_java: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media",
+ "com.android.media.swcodec",
+ ],
}
diff --git a/graphics/bufferqueue/2.0/Android.bp b/graphics/bufferqueue/2.0/Android.bp
index 13feeb1..33d9104 100644
--- a/graphics/bufferqueue/2.0/Android.bp
+++ b/graphics/bufferqueue/2.0/Android.bp
@@ -27,4 +27,9 @@
"android.hidl.base@1.0",
],
gen_java: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media",
+ "com.android.media.swcodec",
+ ],
}
diff --git a/graphics/common/aidl/Android.bp b/graphics/common/aidl/Android.bp
index 69ee498..d44252a 100644
--- a/graphics/common/aidl/Android.bp
+++ b/graphics/common/aidl/Android.bp
@@ -25,7 +25,8 @@
],
backend: {
java: {
- enabled: false,
+ enabled: true,
+ platform_apis: true,
},
cpp: {
enabled: false,
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BlendMode.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BlendMode.aidl
index 1c19381..d1f61be 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BlendMode.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BlendMode.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@Backing(type="int") @VintfStability
enum BlendMode {
INVALID = 0,
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl
index e1edb17..d3ab44f 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@Backing(type="long") @VintfStability
enum BufferUsage {
CPU_READ_MASK = 15,
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl
index 7f0d734..b8af644 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@Backing(type="long") @VintfStability
enum ChromaSiting {
NONE = 0,
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ColorTransform.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ColorTransform.aidl
index 255a42f..f74859b 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ColorTransform.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ColorTransform.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@Backing(type="int") @VintfStability
enum ColorTransform {
IDENTITY = 0,
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Compression.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Compression.aidl
index 5b76376..4f155e1 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Compression.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Compression.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@Backing(type="long") @VintfStability
enum Compression {
NONE = 0,
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Cta861_3.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Cta861_3.aidl
index fbe4b2a..ec90c9c 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Cta861_3.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Cta861_3.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@VintfStability
parcelable Cta861_3 {
float maxContentLightLevel;
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl
index 3d97cff..668b033 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@Backing(type="int") @VintfStability
enum Dataspace {
UNKNOWN = 0,
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ExtendableType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ExtendableType.aidl
index 3ada312..5ff1775 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ExtendableType.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ExtendableType.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@VintfStability
parcelable ExtendableType {
@utf8InCpp String name;
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/FRect.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/FRect.aidl
index cb8190b..7972e11 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/FRect.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/FRect.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@VintfStability
parcelable FRect {
float left;
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBuffer.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBuffer.aidl
index 4d8f78d..1817769 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBuffer.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBuffer.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@VintfStability
parcelable HardwareBuffer {
android.hardware.graphics.common.HardwareBufferDescription description;
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBufferDescription.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBufferDescription.aidl
index 4955049..70f46a1 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBufferDescription.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBufferDescription.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@VintfStability
parcelable HardwareBufferDescription {
int width;
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl
index 0320a66..7bae45e 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@Backing(type="int") @VintfStability
enum Hdr {
DOLBY_VISION = 1,
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Interlaced.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Interlaced.aidl
index 30b4e03..e04d2ab 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Interlaced.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Interlaced.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@Backing(type="long") @VintfStability
enum Interlaced {
NONE = 0,
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl
index 512fecb..59d6468 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@Backing(type="int") @VintfStability
enum PixelFormat {
UNSPECIFIED = 0,
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayout.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayout.aidl
index 75fac9f..a090975 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayout.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayout.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@VintfStability
parcelable PlaneLayout {
android.hardware.graphics.common.PlaneLayoutComponent[] components;
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponent.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponent.aidl
index 20c0a0b..0768240 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponent.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponent.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@VintfStability
parcelable PlaneLayoutComponent {
android.hardware.graphics.common.ExtendableType type;
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl
index 2f7d414..8ba9381 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@Backing(type="long") @VintfStability
enum PlaneLayoutComponentType {
Y = 1,
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl
index 3722803..af4705a 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@VintfStability
parcelable Point {
int x;
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Rect.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Rect.aidl
index eb42027..463a68f 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Rect.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Rect.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@VintfStability
parcelable Rect {
int left;
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Smpte2086.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Smpte2086.aidl
index 2be31d8..dce9226 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Smpte2086.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Smpte2086.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@VintfStability
parcelable Smpte2086 {
android.hardware.graphics.common.XyColor primaryRed;
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl
index 150215c..06b31a2 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@Backing(type="long") @VintfStability
enum StandardMetadataType {
INVALID = 0,
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl
index 359c655..986d089 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@Backing(type="int") @VintfStability
enum Transform {
NONE = 0,
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/XyColor.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/XyColor.aidl
index b42de18..e300f25 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/XyColor.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/XyColor.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
+/* @hide */
@VintfStability
parcelable XyColor {
float x;
diff --git a/graphics/common/aidl/android/hardware/graphics/common/BlendMode.aidl b/graphics/common/aidl/android/hardware/graphics/common/BlendMode.aidl
index 2428135..fa3f9e3 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/BlendMode.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/BlendMode.aidl
@@ -18,6 +18,7 @@
/**
* Blend modes, settable per layer.
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl b/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl
index 60dfbfb..12bc441 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl
@@ -18,6 +18,7 @@
/**
* Buffer usage definitions.
+ * @hide
*/
@VintfStability
@Backing(type="long")
@@ -125,6 +126,14 @@
* presents from SF (such as for panel self-refresh), but for any given
* present the buffer must be composited from even if it otherwise appears
* to be the same as a previous composition.
+ *
+ * If the GPU & HWC supports EGL_SINGLE_BUFFER, then it is recommended that
+ * FRONT_BUFFER usage is supported for the same formats as supported by
+ * EGL_SINGLE_BUFFER. In particular, it is recommended that the following
+ * combination is supported when possible:
+ * Format = RGBA_8888
+ * Usage = FRONT_BUFFER | GPU_RENDER_TARGET | COMPOSER_OVERLAY
+ *
*/
FRONT_BUFFER = 1L << 32,
diff --git a/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl b/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl
index 562a664..ac44853 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl
@@ -18,6 +18,7 @@
/**
* Used by IAllocator/IMapper (gralloc) to describe standard chroma siting
+ * @hide
*/
@VintfStability
@Backing(type="long")
diff --git a/graphics/common/aidl/android/hardware/graphics/common/ColorTransform.aidl b/graphics/common/aidl/android/hardware/graphics/common/ColorTransform.aidl
index a8784f5..24ed827 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/ColorTransform.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/ColorTransform.aidl
@@ -19,6 +19,7 @@
/**
* Color transforms that may be applied by hardware composer to the whole
* display.
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/graphics/common/aidl/android/hardware/graphics/common/Compression.aidl b/graphics/common/aidl/android/hardware/graphics/common/Compression.aidl
index 4cca1ba..57afa14 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/Compression.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/Compression.aidl
@@ -18,6 +18,7 @@
/**
* Used by IAllocator/IMapper (gralloc) to describe standard compression strategies
+ * @hide
*/
@VintfStability
@Backing(type="long")
diff --git a/graphics/common/aidl/android/hardware/graphics/common/Cta861_3.aidl b/graphics/common/aidl/android/hardware/graphics/common/Cta861_3.aidl
index 4fbc6b2..9b90a2b 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/Cta861_3.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/Cta861_3.aidl
@@ -20,6 +20,7 @@
* HDR static metadata extension as specified by CTA-861.3.
*
* This is an AIDL counterpart of the NDK struct `AHdrMetadata_cta861_3`.
+ * @hide
*/
@VintfStability
parcelable Cta861_3 {
diff --git a/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl
index 42cdd81..5e9360f 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl
@@ -16,6 +16,7 @@
package android.hardware.graphics.common;
+/** @hide */
@VintfStability
@Backing(type="int")
enum Dataspace {
diff --git a/graphics/common/aidl/android/hardware/graphics/common/ExtendableType.aidl b/graphics/common/aidl/android/hardware/graphics/common/ExtendableType.aidl
index 495693c..3f70c1a 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/ExtendableType.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/ExtendableType.aidl
@@ -22,6 +22,7 @@
* proprietary vendor compression strategy. Instead, compression is represented using this
* ExtendableType that can support standard compression strategies while still allowing
* every vendor to easily add their own non-standard definitions.
+ * @hide
*/
@VintfStability
parcelable ExtendableType {
diff --git a/graphics/common/aidl/android/hardware/graphics/common/FRect.aidl b/graphics/common/aidl/android/hardware/graphics/common/FRect.aidl
index f9f2b60..64595a2 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/FRect.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/FRect.aidl
@@ -17,6 +17,7 @@
package android.hardware.graphics.common;
/**
* General purpose definition of a rectangle with floating point corners.
+ * @hide
*/
@VintfStability
diff --git a/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl b/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl
index 5a22c0f..50306dc 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl
@@ -24,6 +24,7 @@
*
* @note This is different from the public HardwareBuffer.
* @sa +ndk libnativewindow#AHardwareBuffer
+ * @hide
*/
@VintfStability
parcelable HardwareBuffer {
diff --git a/graphics/common/aidl/android/hardware/graphics/common/HardwareBufferDescription.aidl b/graphics/common/aidl/android/hardware/graphics/common/HardwareBufferDescription.aidl
index 078c512..cc53da4 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/HardwareBufferDescription.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/HardwareBufferDescription.aidl
@@ -23,6 +23,7 @@
* Stable AIDL counterpart of AHardwareBuffer_Desc.
*
* @sa +ndk libnativewindow#AHardwareBuffer_Desc
+ * @hide
*/
@VintfStability
parcelable HardwareBufferDescription {
diff --git a/graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl b/graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl
index f6d02dd..f543780 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl
@@ -18,6 +18,7 @@
/**
* Supported HDR formats. Must be kept in sync with equivalents in Display.java.
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/graphics/common/aidl/android/hardware/graphics/common/Interlaced.aidl b/graphics/common/aidl/android/hardware/graphics/common/Interlaced.aidl
index a3f1baa..26252a5 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/Interlaced.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/Interlaced.aidl
@@ -18,6 +18,7 @@
/**
* Used by IAllocator/IMapper (gralloc) to describe standard interlaced strategies
+ * @hide
*/
@VintfStability
@Backing(type="long")
diff --git a/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl b/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl
index 4e891f6..ccf437b 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl
@@ -18,6 +18,7 @@
/**
* Pixel formats for graphics buffers.
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/graphics/common/aidl/android/hardware/graphics/common/PlaneLayout.aidl b/graphics/common/aidl/android/hardware/graphics/common/PlaneLayout.aidl
index b329cb2..bbbcf09 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/PlaneLayout.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/PlaneLayout.aidl
@@ -32,6 +32,7 @@
* - Pixel - a pixel is comprised of all the (non-metadata/raw) components in buffer across
* all planes. For example, a buffer with a plane of Y and a plane of CbCr has a pixel
* of YCbCr.
+ * @hide
*/
@VintfStability
diff --git a/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponent.aidl b/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponent.aidl
index c04cef0..ccf8fe3 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponent.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponent.aidl
@@ -32,6 +32,7 @@
* - Pixel - a pixel is comprised of all the (non-metadata/raw) components in buffer across
* all planes. For example, a buffer with a plane of Y and a plane of CbCr has a pixel
* of YCbCr.
+ * @hide
*/
@VintfStability
diff --git a/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponentType.aidl b/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponentType.aidl
index ce08396..1a11400 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponentType.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponentType.aidl
@@ -23,6 +23,7 @@
* reasons. However, unlike gralloc1's android_flex_component, this field is NOT a bit field.
* A plane's components should NOT be expressed by bitwise OR-ing different
* PlaneLayoutComponentTypes together.
+ * @hide
*/
@VintfStability
@Backing(type="long")
diff --git a/graphics/common/aidl/android/hardware/graphics/common/Point.aidl b/graphics/common/aidl/android/hardware/graphics/common/Point.aidl
index b3ede44..92372eb 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/Point.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/Point.aidl
@@ -18,6 +18,7 @@
/**
* General purpose definition of a point.
+ * @hide
*/
@VintfStability
diff --git a/graphics/common/aidl/android/hardware/graphics/common/Rect.aidl b/graphics/common/aidl/android/hardware/graphics/common/Rect.aidl
index 1a3bc11..5820261 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/Rect.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/Rect.aidl
@@ -18,6 +18,7 @@
/**
* General purpose definition of a rectangle.
+ * @hide
*/
@VintfStability
diff --git a/graphics/common/aidl/android/hardware/graphics/common/Smpte2086.aidl b/graphics/common/aidl/android/hardware/graphics/common/Smpte2086.aidl
index 60614cd..d83a35d 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/Smpte2086.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/Smpte2086.aidl
@@ -21,6 +21,7 @@
* Mastering display metadata as specified by SMPTE ST 2086.
*
* This is an AIDL counterpart of the NDK struct `AHdrMetadata_smpte2086`.
+ * @hide
*/
@VintfStability
parcelable Smpte2086 {
diff --git a/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl b/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl
index 74a9ce3..8126143 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl
@@ -34,6 +34,7 @@
*
* The StandardMetadataType encode/decode support library can be found in:
* frameworks/native/libs/gralloc/types/include/gralloctypes/Gralloc4.h.
+ * @hide
*/
@VintfStability
@Backing(type="long")
diff --git a/graphics/common/aidl/android/hardware/graphics/common/Transform.aidl b/graphics/common/aidl/android/hardware/graphics/common/Transform.aidl
index 4b3a1b1..8df82b5 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/Transform.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/Transform.aidl
@@ -18,6 +18,7 @@
/**
* Transformation definitions
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/graphics/common/aidl/android/hardware/graphics/common/XyColor.aidl b/graphics/common/aidl/android/hardware/graphics/common/XyColor.aidl
index 9571273..6885aba 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/XyColor.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/XyColor.aidl
@@ -22,6 +22,7 @@
* This is an AIDL counterpart of the NDK struct `AColor_xy`.
*
* @note This can be used to represent any 2-dimensional chromaticity.
+ * @hide
*/
@VintfStability
parcelable XyColor {
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp
index bd2c3b1..139b5e8 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp
@@ -35,6 +35,9 @@
"VtsHalGraphicsComposer3_TargetTest.cpp",
"VtsHalGraphicsComposer3_ReadbackTest.cpp",
"composer-vts/GraphicsComposerCallback.cpp",
+ "composer-vts/ReadbackVts.cpp",
+ "composer-vts/RenderEngineVts.cpp",
+ "composer-vts/VtsComposerClient.cpp",
],
shared_libs: [
@@ -72,15 +75,19 @@
"android.hardware.graphics.allocator@2.0",
"android.hardware.graphics.allocator@3.0",
"android.hardware.graphics.allocator@4.0",
- "android.hardware.graphics.composer@3-vts",
"android.hardware.graphics.mapper@2.0-vts",
"android.hardware.graphics.mapper@2.1-vts",
"android.hardware.graphics.mapper@3.0-vts",
"android.hardware.graphics.mapper@4.0-vts",
"libaidlcommonsupport",
+ "libarect",
+ "libbase",
+ "libfmq",
"libgtest",
+ "libmath",
"librenderengine",
"libshaders",
+ "libsync",
"libtonemap",
],
cflags: [
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp
index 3f1e703..45a8f6f 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp
@@ -20,14 +20,12 @@
#include <aidl/Vintf.h>
#include <aidl/android/hardware/graphics/common/BufferUsage.h>
#include <aidl/android/hardware/graphics/composer3/IComposer.h>
-#include <android/binder_manager.h>
#include <composer-vts/include/ReadbackVts.h>
#include <composer-vts/include/RenderEngineVts.h>
#include <gtest/gtest.h>
#include <ui/DisplayId.h>
#include <ui/DisplayIdentification.h>
#include <ui/GraphicBuffer.h>
-#include <ui/GraphicBufferAllocator.h>
#include <ui/PixelFormat.h>
#include <ui/Rect.h>
@@ -37,6 +35,7 @@
#include <tinyxml2.h>
#pragma clang diagnostic pop
#include "composer-vts/include/GraphicsComposerCallback.h"
+#include "composer-vts/include/VtsComposerClient.h"
namespace aidl::android::hardware::graphics::composer3::vts {
namespace {
@@ -48,40 +47,25 @@
class GraphicsCompositionTestBase : public ::testing::Test {
protected:
void SetUpBase(const std::string& name) {
- ndk::SpAIBinder binder(AServiceManager_waitForService(name.c_str()));
- ASSERT_NE(binder, nullptr);
- ASSERT_NO_FATAL_FAILURE(mComposer = IComposer::fromBinder(binder));
- ASSERT_NE(mComposer, nullptr);
- ASSERT_NO_FATAL_FAILURE(mComposer->createClient(&mComposerClient));
- mComposerCallback = ::ndk::SharedRefBase::make<GraphicsComposerCallback>();
- mComposerClient->registerCallback(mComposerCallback);
+ mComposerClient = std::make_shared<VtsComposerClient>(name);
+ ASSERT_TRUE(mComposerClient->createClient().isOk());
- // assume the first display is primary and is never removed
- mPrimaryDisplay = waitForFirstDisplay();
-
- ASSERT_NO_FATAL_FAILURE(mInvalidDisplayId = GetInvalidDisplayId());
-
- int32_t activeConfig;
- EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &activeConfig).isOk());
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(mPrimaryDisplay, activeConfig,
- DisplayAttribute::WIDTH, &mDisplayWidth)
- .isOk());
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(mPrimaryDisplay, activeConfig,
- DisplayAttribute::HEIGHT, &mDisplayHeight)
- .isOk());
+ const auto& [status, displays] = mComposerClient->getDisplays();
+ ASSERT_TRUE(status.isOk());
+ mDisplays = displays;
setTestColorModes();
// explicitly disable vsync
- EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, false).isOk());
- mComposerCallback->setVsyncAllowed(false);
+ for (const auto& display : mDisplays) {
+ EXPECT_TRUE(mComposerClient->setVsync(display.getDisplayId(), /*enable*/ false).isOk());
+ }
+ mComposerClient->setVsyncAllowed(/*isAllowed*/ false);
// set up gralloc
mGraphicBuffer = allocate();
- ASSERT_NO_FATAL_FAILURE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON));
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk());
ASSERT_NO_FATAL_FAILURE(
mTestRenderEngine = std::unique_ptr<TestRenderEngine>(new TestRenderEngine(
@@ -96,11 +80,12 @@
.build())));
::android::renderengine::DisplaySettings clientCompositionDisplay;
- clientCompositionDisplay.physicalDisplay = Rect(mDisplayWidth, mDisplayHeight);
+ clientCompositionDisplay.physicalDisplay = Rect(getDisplayWidth(), getDisplayHeight());
clientCompositionDisplay.clip = clientCompositionDisplay.physicalDisplay;
mTestRenderEngine->initGraphicBuffer(
- static_cast<uint32_t>(mDisplayWidth), static_cast<uint32_t>(mDisplayHeight), 1,
+ static_cast<uint32_t>(getDisplayWidth()), static_cast<uint32_t>(getDisplayHeight()),
+ /*layerCount*/ 1U,
static_cast<uint64_t>(
static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
static_cast<uint64_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
@@ -109,21 +94,27 @@
}
void TearDown() override {
- ASSERT_NO_FATAL_FAILURE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF));
+ ASSERT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk());
+ ASSERT_TRUE(mComposerClient->tearDown());
+ mComposerClient.reset();
const auto errors = mReader.takeErrors();
ASSERT_TRUE(mReader.takeErrors().empty());
- ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty());
-
- if (mComposerCallback != nullptr) {
- EXPECT_EQ(0, mComposerCallback->getInvalidHotplugCount());
- EXPECT_EQ(0, mComposerCallback->getInvalidRefreshCount());
- EXPECT_EQ(0, mComposerCallback->getInvalidVsyncCount());
- }
+ ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
}
+ const VtsDisplay& getPrimaryDisplay() const { return mDisplays[0]; }
+
+ int64_t getPrimaryDisplayId() const { return getPrimaryDisplay().getDisplayId(); }
+
+ int64_t getInvalidDisplayId() const { return mComposerClient->getInvalidDisplayId(); }
+
+ int32_t getDisplayWidth() const { return getPrimaryDisplay().getDisplayWidth(); }
+
+ int32_t getDisplayHeight() const { return getPrimaryDisplay().getDisplayHeight(); }
+
::android::sp<::android::GraphicBuffer> allocate() {
- const auto width = static_cast<uint32_t>(mDisplayWidth);
- const auto height = static_cast<uint32_t>(mDisplayHeight);
+ const auto width = static_cast<uint32_t>(getDisplayWidth());
+ const auto height = static_cast<uint32_t>(getDisplayHeight());
const auto usage = static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
static_cast<uint32_t>(common::BufferUsage::CPU_READ_OFTEN);
@@ -133,9 +124,9 @@
}
uint64_t getStableDisplayId(int64_t display) {
- DisplayIdentification identification;
- const auto error = mComposerClient->getDisplayIdentificationData(display, &identification);
- EXPECT_TRUE(error.isOk());
+ const auto& [status, identification] =
+ mComposerClient->getDisplayIdentificationData(display);
+ EXPECT_TRUE(status.isOk());
if (const auto info = ::android::parseDisplayIdentificationData(
static_cast<uint8_t>(identification.port), identification.data)) {
@@ -203,7 +194,7 @@
}
void writeLayers(const std::vector<std::shared_ptr<TestLayer>>& layers) {
- for (auto layer : layers) {
+ for (const auto& layer : layers) {
layer->write(mWriter);
}
execute();
@@ -216,59 +207,42 @@
return;
}
- std::vector<CommandResultPayload> results;
- auto status = mComposerClient->executeCommands(commands, &results);
+ auto [status, results] = mComposerClient->executeCommands(commands);
ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription();
mReader.parse(std::move(results));
mWriter.reset();
}
- bool getHasReadbackBuffer() {
- ReadbackBufferAttributes readBackBufferAttributes;
- const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay,
- &readBackBufferAttributes);
- mPixelFormat = readBackBufferAttributes.format;
- mDataspace = readBackBufferAttributes.dataspace;
- return error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace);
+ std::pair<ScopedAStatus, bool> getHasReadbackBuffer() {
+ auto [status, readBackBufferAttributes] =
+ mComposerClient->getReadbackBufferAttributes(getPrimaryDisplayId());
+ if (status.isOk()) {
+ mPixelFormat = readBackBufferAttributes.format;
+ mDataspace = readBackBufferAttributes.dataspace;
+ return {std::move(status), ReadbackHelper::readbackSupported(mPixelFormat, mDataspace)};
+ }
+ return {std::move(status), false};
}
- std::shared_ptr<IComposer> mComposer;
- std::shared_ptr<IComposerClient> mComposerClient;
-
- std::shared_ptr<GraphicsComposerCallback> mComposerCallback;
- // the first display and is assumed never to be removed
- int64_t mPrimaryDisplay;
- int64_t mInvalidDisplayId;
- int32_t mDisplayWidth;
- int32_t mDisplayHeight;
+ std::shared_ptr<VtsComposerClient> mComposerClient;
+ std::vector<VtsDisplay> mDisplays;
+ // use the slot count usually set by SF
std::vector<ColorMode> mTestColorModes;
ComposerClientWriter mWriter;
ComposerClientReader mReader;
::android::sp<::android::GraphicBuffer> mGraphicBuffer;
std::unique_ptr<TestRenderEngine> mTestRenderEngine;
-
common::PixelFormat mPixelFormat;
common::Dataspace mDataspace;
static constexpr uint32_t kClientTargetSlotCount = 64;
private:
- int64_t waitForFirstDisplay() {
- while (true) {
- std::vector<int64_t> displays = mComposerCallback->getDisplays();
- if (displays.empty()) {
- usleep(5 * 1000);
- continue;
- }
- return displays[0];
- }
- }
-
void setTestColorModes() {
mTestColorModes.clear();
- std::vector<ColorMode> modes;
- EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &modes).isOk());
+ const auto& [status, modes] = mComposerClient->getColorModes(getPrimaryDisplayId());
+ ASSERT_TRUE(status.isOk());
for (ColorMode mode : modes) {
if (std::find(ReadbackHelper::colorModes.begin(), ReadbackHelper::colorModes.end(),
@@ -277,27 +251,6 @@
}
}
}
-
- // returns an invalid display id (one that has not been registered to a
- // display. Currently assuming that a device will never have close to
- // std::numeric_limit<uint64_t>::max() displays registered while running tests
- int64_t GetInvalidDisplayId() {
- int64_t id = std::numeric_limits<int64_t>::max();
- std::vector<int64_t> displays = mComposerCallback->getDisplays();
- while (id > 0) {
- if (std::none_of(displays.begin(), displays.end(),
- [&](const auto& display) { return id == display; })) {
- return id;
- }
- id--;
- }
-
- // Although 0 could be an invalid display, a return value of 0
- // from GetInvalidDisplayId means all other ids are in use, a condition which
- // we are assuming a device will never have
- EXPECT_NE(0, id);
- return id;
- }
};
class GraphicsCompositionTest : public GraphicsCompositionTestBase,
@@ -308,16 +261,19 @@
TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) {
for (ColorMode mode : mTestColorModes) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- auto layer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay);
- common::Rect coloredSquare({0, 0, mDisplayWidth, mDisplayHeight});
+ auto layer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ common::Rect coloredSquare({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setColor(BLUE);
layer->setDisplayFrame(coloredSquare);
layer->setZOrder(10);
@@ -325,25 +281,26 @@
std::vector<std::shared_ptr<TestLayer>> layers = {layer};
// expected color for each pixel
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, coloredSquare, BLUE);
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), coloredSquare, BLUE);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
// if hwc cannot handle and asks for composition change,
// just succeed the test
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
return;
}
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -356,31 +313,35 @@
TEST_P(GraphicsCompositionTest, SetLayerBuffer) {
for (ColorMode mode : mTestColorModes) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
- {0, 0, mDisplayWidth, mDisplayHeight / 4}, RED);
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
- {0, mDisplayHeight / 4, mDisplayWidth, mDisplayHeight / 2},
- GREEN);
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
- {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight},
- BLUE);
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
+ {0, 0, getDisplayWidth(), getDisplayHeight() / 4}, RED);
+ ReadbackHelper::fillColorsArea(
+ expectedColors, getDisplayWidth(),
+ {0, getDisplayHeight() / 4, getDisplayWidth(), getDisplayHeight() / 2}, GREEN);
+ ReadbackHelper::fillColorsArea(
+ expectedColors, getDisplayWidth(),
+ {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE);
auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth,
- mDisplayHeight, common::PixelFormat::RGBA_8888);
- layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
+ mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(),
+ getDisplayWidth(), getDisplayHeight(), common::PixelFormat::RGBA_8888);
+ layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter);
ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors));
@@ -389,16 +350,16 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
return;
}
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -412,16 +373,19 @@
TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) {
for (ColorMode mode : mTestColorModes) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- auto layer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay);
- common::Rect coloredSquare({0, 0, mDisplayWidth, mDisplayHeight});
+ auto layer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ common::Rect coloredSquare({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setColor(BLUE);
layer->setDisplayFrame(coloredSquare);
layer->setZOrder(10);
@@ -432,28 +396,31 @@
static_cast<uint64_t>(static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
static_cast<uint64_t>(common::BufferUsage::CPU_WRITE_OFTEN));
- mGraphicBuffer->reallocate(static_cast<uint32_t>(mDisplayWidth),
- static_cast<uint32_t>(mDisplayHeight), 1,
+ mGraphicBuffer->reallocate(static_cast<uint32_t>(getDisplayWidth()),
+ static_cast<uint32_t>(getDisplayHeight()), 1,
static_cast<uint32_t>(common::PixelFormat::RGBA_8888), usage);
- mWriter.setLayerBuffer(mPrimaryDisplay, layer->getLayer(), 0, mGraphicBuffer->handle, -1);
+ mWriter.setLayerBuffer(getPrimaryDisplayId(), layer->getLayer(), /*slot*/ 0,
+ mGraphicBuffer->handle,
+ /*acquireFence*/ -1);
// expected color for each pixel
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, coloredSquare, BLUE);
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), coloredSquare, BLUE);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
return;
}
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -462,111 +429,118 @@
}
TEST_P(GraphicsCompositionTest, SetReadbackBuffer) {
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight,
- mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
}
-TEST_P(GraphicsCompositionTest, SetReadbackBufferBadDisplay) {
- if (!getHasReadbackBuffer()) {
+TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadDisplay) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
ASSERT_NE(nullptr, mGraphicBuffer);
ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck());
- aidl::android::hardware::common::NativeHandle bufferHandle =
- ::android::dupToAidl(mGraphicBuffer->handle);
+ const auto& bufferHandle = mGraphicBuffer->handle;
::ndk::ScopedFileDescriptor fence = ::ndk::ScopedFileDescriptor(-1);
- const auto error = mComposerClient->setReadbackBuffer(mInvalidDisplayId, bufferHandle, fence);
+ const auto status =
+ mComposerClient->setReadbackBuffer(getInvalidDisplayId(), bufferHandle, fence);
- EXPECT_FALSE(error.isOk());
- ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
-TEST_P(GraphicsCompositionTest, SetReadbackBufferBadParameter) {
- if (!getHasReadbackBuffer()) {
+TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadParameter) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- aidl::android::hardware::common::NativeHandle bufferHandle;
- {
- ::android::sp<::android::GraphicBuffer> buffer = allocate();
- ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck());
- ::android::makeToAidl(mGraphicBuffer->handle);
- }
-
+ const native_handle_t bufferHandle{};
ndk::ScopedFileDescriptor releaseFence = ndk::ScopedFileDescriptor(-1);
- const auto error =
- mComposerClient->setReadbackBuffer(mPrimaryDisplay, bufferHandle, releaseFence);
+ const auto status =
+ mComposerClient->setReadbackBuffer(getPrimaryDisplayId(), &bufferHandle, releaseFence);
- EXPECT_FALSE(error.isOk());
- ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError());
}
TEST_P(GraphicsCompositionTest, GetReadbackBufferFenceInactive) {
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- ndk::ScopedFileDescriptor releaseFence;
- const auto error = mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &releaseFence);
+ const auto& [status, releaseFence] =
+ mComposerClient->getReadbackBufferFence(getPrimaryDisplayId());
- ASSERT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError());
EXPECT_EQ(-1, releaseFence.get());
}
TEST_P(GraphicsCompositionTest, ClientComposition) {
- EXPECT_TRUE(mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kClientTargetSlotCount)
- .isOk());
+ EXPECT_TRUE(
+ mComposerClient->setClientTargetSlotCount(getPrimaryDisplayId(), kClientTargetSlotCount)
+ .isOk());
for (ColorMode mode : mTestColorModes) {
- EXPECT_TRUE(mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
.isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
- {0, 0, mDisplayWidth, mDisplayHeight / 4}, RED);
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
- {0, mDisplayHeight / 4, mDisplayWidth, mDisplayHeight / 2},
- GREEN);
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
- {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight},
- BLUE);
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
+ {0, 0, getDisplayWidth(), getDisplayHeight() / 4}, RED);
+ ReadbackHelper::fillColorsArea(
+ expectedColors, getDisplayWidth(),
+ {0, getDisplayHeight() / 4, getDisplayWidth(), getDisplayHeight() / 2}, GREEN);
+ ReadbackHelper::fillColorsArea(
+ expectedColors, getDisplayWidth(),
+ {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE);
auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth,
- mDisplayHeight, PixelFormat::RGBA_FP16);
- layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
+ mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(),
+ getDisplayWidth(), getDisplayHeight(), PixelFormat::RGBA_FP16);
+ layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter);
std::vector<std::shared_ptr<TestLayer>> layers = {layer};
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- auto changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay);
+ auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
if (!changedCompositionTypes.empty()) {
ASSERT_EQ(1, changedCompositionTypes.size());
ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition);
@@ -577,7 +551,7 @@
static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
static_cast<uint32_t>(common::BufferUsage::COMPOSER_CLIENT_TARGET));
Dataspace clientDataspace = ReadbackHelper::getDataspaceForColorMode(mode);
- common::Rect damage{0, 0, mDisplayWidth, mDisplayHeight};
+ common::Rect damage{0, 0, getDisplayWidth(), getDisplayHeight()};
// create client target buffer
mGraphicBuffer->reallocate(layer->getWidth(), layer->getHeight(),
@@ -595,21 +569,22 @@
clientBufData, clientFormat, expectedColors));
EXPECT_EQ(::android::OK, mGraphicBuffer->unlock());
- ndk::ScopedFileDescriptor fenceHandle;
- EXPECT_TRUE(
- mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fenceHandle).isOk());
+ const auto& [status, bufferFence] =
+ mComposerClient->getReadbackBufferFence(getPrimaryDisplayId());
+ EXPECT_TRUE(status.isOk());
layer->setToClientComposition(mWriter);
- mWriter.acceptDisplayChanges(mPrimaryDisplay);
- mWriter.setClientTarget(mPrimaryDisplay, 0, mGraphicBuffer->handle, fenceHandle.get(),
- clientDataspace, std::vector<common::Rect>(1, damage));
+ mWriter.acceptDisplayChanges(getPrimaryDisplayId());
+ mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, mGraphicBuffer->handle,
+ bufferFence.get(), clientDataspace,
+ std::vector<common::Rect>(1, damage));
execute();
- changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay);
+ changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
ASSERT_TRUE(changedCompositionTypes.empty());
}
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -619,31 +594,37 @@
}
TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kClientTargetSlotCount));
+ ASSERT_TRUE(
+ mComposerClient->setClientTargetSlotCount(getPrimaryDisplayId(), kClientTargetSlotCount)
+ .isOk());
for (ColorMode mode : mTestColorModes) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
- {0, 0, mDisplayWidth, mDisplayHeight / 2}, GREEN);
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
- {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, RED);
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
+ {0, 0, getDisplayWidth(), getDisplayHeight() / 2}, GREEN);
+ ReadbackHelper::fillColorsArea(
+ expectedColors, getDisplayWidth(),
+ {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, RED);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
auto deviceLayer = std::make_shared<TestBufferLayer>(
- mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth,
- mDisplayHeight / 2, PixelFormat::RGBA_8888);
+ mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(),
+ getDisplayWidth(), getDisplayHeight() / 2, PixelFormat::RGBA_8888);
std::vector<Color> deviceColors(deviceLayer->getWidth() * deviceLayer->getHeight());
ReadbackHelper::fillColorsArea(deviceColors, static_cast<int32_t>(deviceLayer->getWidth()),
{0, 0, static_cast<int32_t>(deviceLayer->getWidth()),
@@ -662,54 +643,59 @@
static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
static_cast<uint32_t>(common::BufferUsage::COMPOSER_CLIENT_TARGET));
Dataspace clientDataspace = ReadbackHelper::getDataspaceForColorMode(mode);
- int32_t clientWidth = mDisplayWidth;
- int32_t clientHeight = mDisplayHeight / 2;
+ int32_t clientWidth = getDisplayWidth();
+ int32_t clientHeight = getDisplayHeight() / 2;
auto clientLayer = std::make_shared<TestBufferLayer>(
- mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, clientWidth,
- clientHeight, PixelFormat::RGBA_FP16, Composition::DEVICE);
- common::Rect clientFrame = {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight};
+ mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(),
+ clientWidth, clientHeight, PixelFormat::RGBA_FP16, Composition::DEVICE);
+ common::Rect clientFrame = {0, getDisplayHeight() / 2, getDisplayWidth(),
+ getDisplayHeight()};
clientLayer->setDisplayFrame(clientFrame);
clientLayer->setZOrder(0);
clientLayer->write(mWriter);
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- auto changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay);
+ auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
if (changedCompositionTypes.size() != 1) {
continue;
}
// create client target buffer
ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition);
- mGraphicBuffer->reallocate(static_cast<uint32_t>(mDisplayWidth),
- static_cast<uint32_t>(mDisplayHeight),
+ mGraphicBuffer->reallocate(static_cast<uint32_t>(getDisplayWidth()),
+ static_cast<uint32_t>(getDisplayHeight()),
static_cast<int32_t>(common::PixelFormat::RGBA_8888),
clientLayer->getLayerCount(), clientUsage);
ASSERT_NE(nullptr, mGraphicBuffer->handle);
void* clientBufData;
- mGraphicBuffer->lock(clientUsage, {0, 0, mDisplayWidth, mDisplayHeight}, &clientBufData);
+ mGraphicBuffer->lock(clientUsage, {0, 0, getDisplayWidth(), getDisplayHeight()},
+ &clientBufData);
- std::vector<Color> clientColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
- ReadbackHelper::fillColorsArea(clientColors, mDisplayWidth, clientFrame, RED);
+ std::vector<Color> clientColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(clientColors, getDisplayWidth(), clientFrame, RED);
ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(
- static_cast<uint32_t>(mDisplayWidth), static_cast<uint32_t>(mDisplayHeight),
+ static_cast<uint32_t>(getDisplayWidth()), static_cast<uint32_t>(getDisplayHeight()),
mGraphicBuffer->getStride(), clientBufData, clientFormat, clientColors));
EXPECT_EQ(::android::OK, mGraphicBuffer->unlock());
- ndk::ScopedFileDescriptor fenceHandle;
- EXPECT_TRUE(mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fenceHandle).isOk());
+ const auto& [status, bufferFence] =
+ mComposerClient->getReadbackBufferFence(getPrimaryDisplayId());
+ EXPECT_TRUE(status.isOk());
clientLayer->setToClientComposition(mWriter);
- mWriter.acceptDisplayChanges(mPrimaryDisplay);
- mWriter.setClientTarget(mPrimaryDisplay, 0, mGraphicBuffer->handle, fenceHandle.get(),
- clientDataspace, std::vector<common::Rect>(1, clientFrame));
+ mWriter.acceptDisplayChanges(getPrimaryDisplayId());
+ mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, mGraphicBuffer->handle,
+ bufferFence.get(), clientDataspace,
+ std::vector<common::Rect>(1, clientFrame));
execute();
- changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay);
+ changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
ASSERT_TRUE(changedCompositionTypes.empty());
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
@@ -718,66 +704,72 @@
TEST_P(GraphicsCompositionTest, SetLayerDamage) {
for (ColorMode mode : mTestColorModes) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- common::Rect redRect = {0, 0, mDisplayWidth / 4, mDisplayHeight / 4};
+ common::Rect redRect = {0, 0, getDisplayWidth() / 4, getDisplayHeight() / 4};
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED);
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED);
auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth,
- mDisplayHeight, PixelFormat::RGBA_8888);
- layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
+ mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(),
+ getDisplayWidth(), getDisplayHeight(), PixelFormat::RGBA_8888);
+ layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter);
ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors));
std::vector<std::shared_ptr<TestLayer>> layers = {layer};
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
return;
}
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
// update surface damage and recheck
- redRect = {mDisplayWidth / 4, mDisplayHeight / 4, mDisplayWidth / 2, mDisplayHeight / 2};
- ReadbackHelper::clearColors(expectedColors, mDisplayWidth, mDisplayHeight, mDisplayWidth);
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED);
+ redRect = {getDisplayWidth() / 4, getDisplayHeight() / 4, getDisplayWidth() / 2,
+ getDisplayHeight() / 2};
+ ReadbackHelper::clearColors(expectedColors, getDisplayWidth(), getDisplayHeight(),
+ getDisplayWidth());
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED);
ASSERT_NO_FATAL_FAILURE(layer->fillBuffer(expectedColors));
layer->setSurfaceDamage(
- std::vector<common::Rect>(1, {0, 0, mDisplayWidth / 2, mDisplayWidth / 2}));
+ std::vector<common::Rect>(1, {0, 0, getDisplayWidth() / 2, getDisplayWidth() / 2}));
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -787,43 +779,47 @@
TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) {
for (ColorMode mode : mTestColorModes) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- auto layer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay);
+ auto layer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
layer->setColor(RED);
- layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
+ layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
layer->setAlpha(0);
layer->setBlendMode(BlendMode::PREMULTIPLIED);
std::vector<std::shared_ptr<TestLayer>> layers = {layer};
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
return;
}
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
mTestRenderEngine->setRenderLayers(layers);
@@ -834,50 +830,54 @@
TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) {
for (ColorMode mode : mTestColorModes) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
- {0, 0, mDisplayWidth, mDisplayHeight / 4}, RED);
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
- {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight},
- BLUE);
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
+ {0, 0, getDisplayWidth(), getDisplayHeight() / 4}, RED);
+ ReadbackHelper::fillColorsArea(
+ expectedColors, getDisplayWidth(),
+ {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE);
auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth,
- mDisplayHeight, PixelFormat::RGBA_8888);
- layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
+ mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(),
+ getDisplayWidth(), getDisplayHeight(), PixelFormat::RGBA_8888);
+ layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter);
- layer->setSourceCrop({0, static_cast<float>(mDisplayHeight / 2),
- static_cast<float>(mDisplayWidth),
- static_cast<float>(mDisplayHeight)});
+ layer->setSourceCrop({0, static_cast<float>(getDisplayHeight() / 2),
+ static_cast<float>(getDisplayWidth()),
+ static_cast<float>(getDisplayHeight())});
ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors));
std::vector<std::shared_ptr<TestLayer>> layers = {layer};
// update expected colors to match crop
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
- {0, 0, mDisplayWidth, mDisplayHeight}, BLUE);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
+ {0, 0, getDisplayWidth(), getDisplayHeight()}, BLUE);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
return;
}
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
@@ -889,67 +889,72 @@
TEST_P(GraphicsCompositionTest, SetLayerZOrder) {
for (ColorMode mode : mTestColorModes) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- common::Rect redRect = {0, 0, mDisplayWidth, mDisplayHeight / 2};
- common::Rect blueRect = {0, mDisplayHeight / 4, mDisplayWidth, mDisplayHeight};
- auto redLayer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay);
+ common::Rect redRect = {0, 0, getDisplayWidth(), getDisplayHeight() / 2};
+ common::Rect blueRect = {0, getDisplayHeight() / 4, getDisplayWidth(), getDisplayHeight()};
+ auto redLayer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
redLayer->setColor(RED);
redLayer->setDisplayFrame(redRect);
- auto blueLayer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay);
+ auto blueLayer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
blueLayer->setColor(BLUE);
blueLayer->setDisplayFrame(blueRect);
blueLayer->setZOrder(5);
std::vector<std::shared_ptr<TestLayer>> layers = {redLayer, blueLayer};
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
// red in front of blue
redLayer->setZOrder(10);
// fill blue first so that red will overwrite on overlap
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, blueRect, BLUE);
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED);
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), blueRect, BLUE);
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
return;
}
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
redLayer->setZOrder(1);
- ReadbackHelper::clearColors(expectedColors, mDisplayWidth, mDisplayHeight, mDisplayWidth);
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED);
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, blueRect, BLUE);
+ ReadbackHelper::clearColors(expectedColors, getDisplayWidth(), getDisplayHeight(),
+ getDisplayWidth());
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED);
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), blueRect, BLUE);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty());
+ ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -961,9 +966,9 @@
}
TEST_P(GraphicsCompositionTest, SetLayerWhitePointDims) {
- std::vector<DisplayCapability> capabilities;
- const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities);
- ASSERT_TRUE(error.isOk());
+ const auto& [status, capabilities] =
+ mComposerClient->getDisplayCapabilities(getPrimaryDisplayId());
+ ASSERT_TRUE(status.isOk());
const bool brightnessSupport = std::find(capabilities.begin(), capabilities.end(),
DisplayCapability::BRIGHTNESS) != capabilities.end();
@@ -974,7 +979,7 @@
}
const std::optional<float> maxBrightnessNitsOptional =
- getMaxDisplayBrightnessNits(mPrimaryDisplay);
+ getMaxDisplayBrightnessNits(getPrimaryDisplayId());
ASSERT_TRUE(maxBrightnessNitsOptional.has_value());
@@ -983,29 +988,34 @@
// Preconditions to successfully run are knowing the max brightness and successfully applying
// the max brightness
ASSERT_GT(maxBrightnessNits, 0.f);
- mWriter.setDisplayBrightness(mPrimaryDisplay, 1.f);
+ mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.f);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
for (ColorMode mode : mTestColorModes) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace for "
"color mode: "
<< toString(mode);
continue;
}
- const common::Rect redRect = {0, 0, mDisplayWidth, mDisplayHeight / 2};
- const common::Rect dimmerRedRect = {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight};
- const auto redLayer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay);
+ const common::Rect redRect = {0, 0, getDisplayWidth(), getDisplayHeight() / 2};
+ const common::Rect dimmerRedRect = {0, getDisplayHeight() / 2, getDisplayWidth(),
+ getDisplayHeight()};
+ const auto redLayer =
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
redLayer->setColor(RED);
redLayer->setDisplayFrame(redRect);
redLayer->setWhitePointNits(maxBrightnessNits);
const auto dimmerRedLayer =
- std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay);
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
dimmerRedLayer->setColor(RED);
dimmerRedLayer->setDisplayFrame(dimmerRedRect);
// Intentionally use a small dimming ratio as some implementations may be more likely to
@@ -1014,26 +1024,27 @@
dimmerRedLayer->setWhitePointNits(maxBrightnessNits * kDimmingRatio);
const std::vector<std::shared_ptr<TestLayer>> layers = {redLayer, dimmerRedLayer};
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED);
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, dimmerRedRect, DIM_RED);
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED);
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), dimmerRedRect, DIM_RED);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED()
<< "Readback verification not supported for GPU composition for color mode: "
<< toString(mode);
continue;
}
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1060,19 +1071,22 @@
void setUpLayers(BlendMode blendMode) {
mLayers.clear();
- std::vector<Color> topLayerPixelColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
- ReadbackHelper::fillColorsArea(topLayerPixelColors, mDisplayWidth,
- {0, 0, mDisplayWidth, mDisplayHeight}, mTopLayerColor);
+ std::vector<Color> topLayerPixelColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(topLayerPixelColors, getDisplayWidth(),
+ {0, 0, getDisplayWidth(), getDisplayHeight()},
+ mTopLayerColor);
- auto backgroundLayer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay);
- backgroundLayer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
+ auto backgroundLayer =
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ backgroundLayer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
backgroundLayer->setZOrder(0);
backgroundLayer->setColor(mBackgroundColor);
auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth,
- mDisplayHeight, PixelFormat::RGBA_8888);
- layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
+ mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(),
+ getDisplayWidth(), getDisplayHeight(), PixelFormat::RGBA_8888);
+ layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
layer->setDataspace(Dataspace::UNKNOWN, mWriter);
ASSERT_NO_FATAL_FAILURE(layer->setBuffer(topLayerPixelColors));
@@ -1086,7 +1100,8 @@
void setExpectedColors(std::vector<Color>& expectedColors) {
ASSERT_EQ(2, mLayers.size());
- ReadbackHelper::clearColors(expectedColors, mDisplayWidth, mDisplayHeight, mDisplayWidth);
+ ReadbackHelper::clearColors(expectedColors, getDisplayWidth(), getDisplayHeight(),
+ getDisplayWidth());
auto layer = mLayers[1];
BlendMode blendMode = layer->getBlendMode();
@@ -1126,34 +1141,38 @@
TEST_P(GraphicsBlendModeCompositionTest, None) {
for (ColorMode mode : mTestColorModes) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
setBackgroundColor(BLACK);
setTopLayerColor(TRANSLUCENT_RED);
setUpLayers(BlendMode::NONE);
setExpectedColors(expectedColors);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
return;
}
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1166,15 +1185,19 @@
TEST_P(GraphicsBlendModeCompositionTest, Coverage) {
for (ColorMode mode : mTestColorModes) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
setBackgroundColor(BLACK);
setTopLayerColor(TRANSLUCENT_RED);
@@ -1182,19 +1205,19 @@
setUpLayers(BlendMode::COVERAGE);
setExpectedColors(expectedColors);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
return;
}
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
@@ -1203,34 +1226,38 @@
TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) {
for (ColorMode mode : mTestColorModes) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
setBackgroundColor(BLACK);
setTopLayerColor(TRANSLUCENT_RED);
setUpLayers(BlendMode::PREMULTIPLIED);
setExpectedColors(expectedColors);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
return;
}
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
@@ -1245,18 +1272,20 @@
void SetUp() override {
GraphicsCompositionTest::SetUp();
- auto backgroundLayer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay);
+ auto backgroundLayer =
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
backgroundLayer->setColor({0.0f, 0.0f, 0.0f, 0.0f});
- backgroundLayer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
+ backgroundLayer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
backgroundLayer->setZOrder(0);
- mSideLength = mDisplayWidth < mDisplayHeight ? mDisplayWidth : mDisplayHeight;
+ mSideLength =
+ getDisplayWidth() < getDisplayHeight() ? getDisplayWidth() : getDisplayHeight();
common::Rect redRect = {0, 0, mSideLength / 2, mSideLength / 2};
common::Rect blueRect = {mSideLength / 2, mSideLength / 2, mSideLength, mSideLength};
- mLayer = std::make_shared<TestBufferLayer>(mComposerClient, mGraphicBuffer,
- *mTestRenderEngine, mPrimaryDisplay, mSideLength,
- mSideLength, PixelFormat::RGBA_8888);
+ mLayer = std::make_shared<TestBufferLayer>(
+ mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(),
+ mSideLength, mSideLength, PixelFormat::RGBA_8888);
mLayer->setDisplayFrame({0, 0, mSideLength, mSideLength});
mLayer->setZOrder(10);
@@ -1275,41 +1304,44 @@
TEST_P(GraphicsTransformCompositionTest, FLIP_H) {
for (ColorMode mode : mTestColorModes) {
- auto error =
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC);
- if (!error.isOk() &&
- (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED ||
- error.getServiceSpecificError() == IComposerClient::EX_BAD_PARAMETER)) {
+ auto status = mComposerClient->setColorMode(getPrimaryDisplayId(), mode,
+ RenderIntent::COLORIMETRIC);
+ if (!status.isOk() &&
+ (status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED ||
+ status.getServiceSpecificError() == IComposerClient::EX_BAD_PARAMETER)) {
SUCCEED() << "ColorMode not supported, skip test";
return;
}
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
mLayer->setTransform(Transform::FLIP_H);
mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter);
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
{mSideLength / 2, 0, mSideLength, mSideLength / 2}, RED);
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
{0, mSideLength / 2, mSideLength / 2, mSideLength}, BLUE);
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
return;
}
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1322,36 +1354,40 @@
TEST_P(GraphicsTransformCompositionTest, FLIP_V) {
for (ColorMode mode : mTestColorModes) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
mLayer->setTransform(Transform::FLIP_V);
mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter);
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
{0, mSideLength / 2, mSideLength / 2, mSideLength}, RED);
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
{mSideLength / 2, 0, mSideLength, mSideLength / 2}, BLUE);
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
return;
}
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
@@ -1363,37 +1399,41 @@
TEST_P(GraphicsTransformCompositionTest, ROT_180) {
for (ColorMode mode : mTestColorModes) {
- ASSERT_NO_FATAL_FAILURE(
- mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
- if (!getHasReadbackBuffer()) {
+ const auto& [readbackStatus, isSupported] = getHasReadbackBuffer();
+ EXPECT_TRUE(readbackStatus.isOk());
+ if (!isSupported) {
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
- mDisplayHeight, mPixelFormat, mDataspace);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
mLayer->setTransform(Transform::ROT_180);
mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter);
- std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
+ std::vector<Color> expectedColors(
+ static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
{mSideLength / 2, mSideLength / 2, mSideLength, mSideLength},
RED);
- ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
+ ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(),
{0, 0, mSideLength / 2, mSideLength / 2}, BLUE);
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
return;
}
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
index 026a431..404b548 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -1,7 +1,18 @@
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wconversion"
-
+/**
+ * Copyright (c) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include <aidl/Gtest.h>
#include <aidl/Vintf.h>
#include <aidl/android/hardware/graphics/common/BlendMode.h>
@@ -11,7 +22,6 @@
#include <aidl/android/hardware/graphics/composer3/Composition.h>
#include <aidl/android/hardware/graphics/composer3/IComposer.h>
#include <android-base/properties.h>
-#include <android/binder_manager.h>
#include <android/binder_process.h>
#include <android/hardware/graphics/composer3/ComposerClientReader.h>
#include <android/hardware/graphics/composer3/ComposerClientWriter.h>
@@ -22,16 +32,10 @@
#include <ui/PixelFormat.h>
#include <algorithm>
#include <numeric>
-#include <regex>
#include <string>
#include <thread>
-#include <unordered_map>
-#include <unordered_set>
-#include <utility>
#include "composer-vts/include/GraphicsComposerCallback.h"
-
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic pop // ignored "-Wconversion
+#include "composer-vts/include/VtsComposerClient.h"
#undef LOG_TAG
#define LOG_TAG "VtsHalGraphicsComposer3_TargetTest"
@@ -44,90 +48,39 @@
using ::android::GraphicBuffer;
using ::android::sp;
-class VtsDisplay {
- public:
- VtsDisplay(int64_t displayId, int32_t displayWidth, int32_t displayHeight)
- : mDisplayId(displayId), mDisplayWidth(displayWidth), mDisplayHeight(displayHeight) {}
-
- int64_t get() const { return mDisplayId; }
-
- FRect getCrop() const {
- return {0, 0, static_cast<float>(mDisplayWidth), static_cast<float>(mDisplayHeight)};
- }
-
- Rect getFrameRect() const { return {0, 0, mDisplayWidth, mDisplayHeight}; }
-
- void setDimensions(int32_t displayWidth, int32_t displayHeight) {
- mDisplayWidth = displayWidth;
- mDisplayHeight = displayHeight;
- }
-
- private:
- const int64_t mDisplayId;
- int32_t mDisplayWidth;
- int32_t mDisplayHeight;
-};
-
class GraphicsComposerAidlTest : public ::testing::TestWithParam<std::string> {
protected:
void SetUp() override {
- std::string name = GetParam();
- ndk::SpAIBinder binder(AServiceManager_waitForService(name.c_str()));
- ASSERT_NE(binder, nullptr);
- ASSERT_NO_FATAL_FAILURE(mComposer = IComposer::fromBinder(binder));
- ASSERT_NE(mComposer, nullptr);
+ mComposerClient = std::make_unique<VtsComposerClient>(GetParam());
+ ASSERT_TRUE(mComposerClient->createClient().isOk());
- ndk::ScopedAStatus status;
- ASSERT_NO_FATAL_FAILURE(status = mComposer->createClient(&mComposerClient));
+ const auto& [status, displays] = mComposerClient->getDisplays();
ASSERT_TRUE(status.isOk());
-
- mComposerCallback = ::ndk::SharedRefBase::make<GraphicsComposerCallback>();
- EXPECT_TRUE(mComposerClient->registerCallback(mComposerCallback).isOk());
-
- // assume the first displays are built-in and are never removed
- mDisplays = waitForDisplays();
- mPrimaryDisplay = mDisplays[0].get();
- ASSERT_NO_FATAL_FAILURE(mInvalidDisplayId = GetInvalidDisplayId());
-
- int32_t activeConfig;
- EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &activeConfig).isOk());
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(mPrimaryDisplay, activeConfig,
- DisplayAttribute::WIDTH, &mDisplayWidth)
- .isOk());
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(mPrimaryDisplay, activeConfig,
- DisplayAttribute::HEIGHT, &mDisplayHeight)
- .isOk());
+ mDisplays = displays;
// explicitly disable vsync
for (const auto& display : mDisplays) {
- EXPECT_TRUE(mComposerClient->setVsyncEnabled(display.get(), false).isOk());
+ EXPECT_TRUE(mComposerClient->setVsync(display.getDisplayId(), false).isOk());
}
- mComposerCallback->setVsyncAllowed(false);
+ mComposerClient->setVsyncAllowed(false);
}
void TearDown() override {
- destroyAllLayers();
- if (mComposerCallback != nullptr) {
- EXPECT_EQ(0, mComposerCallback->getInvalidHotplugCount());
- EXPECT_EQ(0, mComposerCallback->getInvalidRefreshCount());
- EXPECT_EQ(0, mComposerCallback->getInvalidVsyncCount());
- EXPECT_EQ(0, mComposerCallback->getInvalidVsyncPeriodChangeCount());
- EXPECT_EQ(0, mComposerCallback->getInvalidSeamlessPossibleCount());
- }
+ ASSERT_TRUE(mComposerClient->tearDown());
+ mComposerClient.reset();
}
- void Test_setContentTypeForDisplay(const int64_t& display,
- const std::vector<ContentType>& capabilities,
- const ContentType& contentType, const char* contentTypeStr) {
- const bool contentTypeSupport = std::find(capabilities.begin(), capabilities.end(),
- contentType) != capabilities.end();
+ void Test_setContentTypeForDisplay(int64_t display,
+ const std::vector<ContentType>& supportedContentTypes,
+ ContentType contentType, const char* contentTypeStr) {
+ const bool contentTypeSupport =
+ std::find(supportedContentTypes.begin(), supportedContentTypes.end(),
+ contentType) != supportedContentTypes.end();
if (!contentTypeSupport) {
- EXPECT_EQ(IComposerClient::EX_UNSUPPORTED,
- mComposerClient->setContentType(display, contentType)
- .getServiceSpecificError());
+ const auto& status = mComposerClient->setContentType(display, contentType);
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError());
GTEST_SUCCEED() << contentTypeStr << " content type is not supported on display "
<< std::to_string(display) << ", skipping test";
return;
@@ -137,209 +90,79 @@
EXPECT_TRUE(mComposerClient->setContentType(display, ContentType::NONE).isOk());
}
- void Test_setContentType(const ContentType& contentType, const char* contentTypeStr) {
+ void Test_setContentType(ContentType contentType, const char* contentTypeStr) {
for (const auto& display : mDisplays) {
- std::vector<ContentType> supportedContentTypes;
- const auto error = mComposerClient->getSupportedContentTypes(display.get(),
- &supportedContentTypes);
- EXPECT_TRUE(error.isOk());
-
- Test_setContentTypeForDisplay(display.get(), supportedContentTypes, contentType,
- contentTypeStr);
+ const auto& [status, supportedContentTypes] =
+ mComposerClient->getSupportedContentTypes(display.getDisplayId());
+ EXPECT_TRUE(status.isOk());
+ Test_setContentTypeForDisplay(display.getDisplayId(), supportedContentTypes,
+ contentType, contentTypeStr);
}
}
- int64_t createLayer(const VtsDisplay& display) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(display.get(), kBufferSlotCount, &layer).isOk());
-
- auto resourceIt = mDisplayResources.find(display.get());
- if (resourceIt == mDisplayResources.end()) {
- resourceIt = mDisplayResources.insert({display.get(), DisplayResource(false)}).first;
- }
-
- EXPECT_TRUE(resourceIt->second.layers.insert(layer).second)
- << "duplicated layer id " << layer;
-
- return layer;
- }
-
- void destroyAllLayers() {
- for (const auto& it : mDisplayResources) {
- auto display = it.first;
- const DisplayResource& resource = it.second;
-
- for (auto layer : resource.layers) {
- const auto error = mComposerClient->destroyLayer(display, layer);
- EXPECT_TRUE(error.isOk());
- }
-
- if (resource.isVirtual) {
- const auto error = mComposerClient->destroyVirtualDisplay(display);
- EXPECT_TRUE(error.isOk());
- }
- }
- mDisplayResources.clear();
- }
-
- void destroyLayer(const VtsDisplay& display, int64_t layer) {
- auto const error = mComposerClient->destroyLayer(display.get(), layer);
- ASSERT_TRUE(error.isOk()) << "failed to destroy layer " << layer;
-
- auto resourceIt = mDisplayResources.find(display.get());
- ASSERT_NE(mDisplayResources.end(), resourceIt);
- resourceIt->second.layers.erase(layer);
- }
-
bool hasCapability(Capability capability) {
- std::vector<Capability> capabilities;
- EXPECT_TRUE(mComposer->getCapabilities(&capabilities).isOk());
+ const auto& [status, capabilities] = mComposerClient->getCapabilities();
+ EXPECT_TRUE(status.isOk());
return std::any_of(
capabilities.begin(), capabilities.end(),
[&](const Capability& activeCapability) { return activeCapability == capability; });
}
- // returns an invalid display id (one that has not been registered to a
- // display. Currently assuming that a device will never have close to
- // std::numeric_limit<uint64_t>::max() displays registered while running tests
- int64_t GetInvalidDisplayId() {
- int64_t id = std::numeric_limits<int64_t>::max();
- while (id > 0) {
- if (std::none_of(mDisplays.begin(), mDisplays.end(),
- [&](const VtsDisplay& display) { return id == display.get(); })) {
- return id;
- }
- id--;
- }
+ const VtsDisplay& getPrimaryDisplay() const { return mDisplays[0]; }
- // Although 0 could be an invalid display, a return value of 0
- // from GetInvalidDisplayId means all other ids are in use, a condition which
- // we are assuming a device will never have
- EXPECT_NE(0, id);
- return id;
- }
+ int64_t getPrimaryDisplayId() const { return getPrimaryDisplay().getDisplayId(); }
- std::vector<VtsDisplay> waitForDisplays() {
- while (true) {
- // Sleep for a small period of time to allow all built-in displays
- // to post hotplug events
- std::this_thread::sleep_for(5ms);
- std::vector<int64_t> displays = mComposerCallback->getDisplays();
- if (displays.empty()) {
- continue;
- }
+ int64_t getInvalidDisplayId() const { return mComposerClient->getInvalidDisplayId(); }
- std::vector<VtsDisplay> vtsDisplays;
- vtsDisplays.reserve(displays.size());
- for (int64_t display : displays) {
- int32_t activeConfig;
- EXPECT_TRUE(mComposerClient->getActiveConfig(display, &activeConfig).isOk());
- int32_t displayWidth;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display, activeConfig,
- DisplayAttribute::WIDTH, &displayWidth)
- .isOk());
- int32_t displayHeight;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display, activeConfig,
- DisplayAttribute::HEIGHT, &displayHeight)
- .isOk());
- vtsDisplays.emplace_back(VtsDisplay{display, displayWidth, displayHeight});
- }
-
- return vtsDisplays;
- }
- }
-
- // returns an invalid config id which is std::numeric_limit<int32_t>::max()
- int32_t GetInvalidConfigId() { return IComposerClient::INVALID_CONFIGURATION; }
-
- ndk::ScopedAStatus setActiveConfigWithConstraints(
- VtsDisplay& display, int32_t config, const VsyncPeriodChangeConstraints& constraints,
- VsyncPeriodChangeTimeline* timeline) {
- auto error = mComposerClient->setActiveConfigWithConstraints(display.get(), config,
- constraints, timeline);
- if (error.isOk()) {
- int32_t displayWidth;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config,
- DisplayAttribute::WIDTH, &displayWidth)
- .isOk());
- int32_t displayHeight;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config,
- DisplayAttribute::HEIGHT, &displayHeight)
- .isOk());
- display.setDimensions(displayWidth, displayHeight);
- }
- return error;
- }
+ VtsDisplay& getEditablePrimaryDisplay() { return mDisplays[0]; }
struct TestParameters {
nsecs_t delayForChange;
bool refreshMiss;
};
- // Keep track of all virtual displays and layers. When a test fails with
- // ASSERT_*, the destructor will clean up the resources for the test.
- struct DisplayResource {
- DisplayResource(bool isVirtual_) : isVirtual(isVirtual_) {}
-
- bool isVirtual;
- std::unordered_set<int64_t> layers;
- };
-
- std::shared_ptr<IComposer> mComposer;
- std::shared_ptr<IComposerClient> mComposerClient;
- int64_t mInvalidDisplayId;
- int64_t mPrimaryDisplay;
+ std::unique_ptr<VtsComposerClient> mComposerClient;
std::vector<VtsDisplay> mDisplays;
- std::shared_ptr<GraphicsComposerCallback> mComposerCallback;
// use the slot count usually set by SF
static constexpr uint32_t kBufferSlotCount = 64;
- std::unordered_map<int64_t, DisplayResource> mDisplayResources;
- int32_t mDisplayWidth;
- int32_t mDisplayHeight;
};
-TEST_P(GraphicsComposerAidlTest, getDisplayCapabilitiesBadDisplay) {
- std::vector<DisplayCapability> capabilities;
- const auto error = mComposerClient->getDisplayCapabilities(mInvalidDisplayId, &capabilities);
+TEST_P(GraphicsComposerAidlTest, GetDisplayCapabilities_BadDisplay) {
+ const auto& [status, _] = mComposerClient->getDisplayCapabilities(getInvalidDisplayId());
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
-TEST_P(GraphicsComposerAidlTest, getDisplayCapabilities) {
+TEST_P(GraphicsComposerAidlTest, GetDisplayCapabilities) {
for (const auto& display : mDisplays) {
- std::vector<DisplayCapability> capabilities;
+ const auto& [status, capabilities] =
+ mComposerClient->getDisplayCapabilities(display.getDisplayId());
- EXPECT_TRUE(mComposerClient->getDisplayCapabilities(display.get(), &capabilities).isOk());
+ EXPECT_TRUE(status.isOk());
}
}
TEST_P(GraphicsComposerAidlTest, DumpDebugInfo) {
- std::string debugInfo;
- EXPECT_TRUE(mComposer->dumpDebugInfo(&debugInfo).isOk());
+ ASSERT_TRUE(mComposerClient->dumpDebugInfo().isOk());
}
TEST_P(GraphicsComposerAidlTest, CreateClientSingleton) {
std::shared_ptr<IComposerClient> composerClient;
- const auto error = mComposer->createClient(&composerClient);
+ const auto& status = mComposerClient->createClient();
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_NO_RESOURCES, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_NO_RESOURCES, status.getServiceSpecificError());
}
TEST_P(GraphicsComposerAidlTest, GetDisplayIdentificationData) {
- DisplayIdentification displayIdentification0;
-
- const auto error =
- mComposerClient->getDisplayIdentificationData(mPrimaryDisplay, &displayIdentification0);
- if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
+ const auto& [status0, displayIdentification0] =
+ mComposerClient->getDisplayIdentificationData(getPrimaryDisplayId());
+ if (!status0.isOk() && status0.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
+ GTEST_SUCCEED() << "Display identification data not supported, skipping test";
return;
}
- ASSERT_TRUE(error.isOk()) << "failed to get display identification data";
+ ASSERT_TRUE(status0.isOk()) << "failed to get display identification data";
ASSERT_FALSE(displayIdentification0.data.empty());
constexpr size_t kEdidBlockSize = 128;
@@ -355,10 +178,9 @@
static_cast<uint8_t>(0)))
<< "EDID base block doesn't checksum";
- DisplayIdentification displayIdentification1;
- ASSERT_TRUE(
- mComposerClient->getDisplayIdentificationData(mPrimaryDisplay, &displayIdentification1)
- .isOk());
+ const auto& [status1, displayIdentification1] =
+ mComposerClient->getDisplayIdentificationData(getPrimaryDisplayId());
+ ASSERT_TRUE(status1.isOk());
ASSERT_EQ(displayIdentification0.port, displayIdentification1.port) << "ports are not stable";
ASSERT_TRUE(displayIdentification0.data.size() == displayIdentification1.data.size() &&
@@ -368,42 +190,42 @@
}
TEST_P(GraphicsComposerAidlTest, GetHdrCapabilities) {
- HdrCapabilities hdrCapabilities;
- const auto error = mComposerClient->getHdrCapabilities(mPrimaryDisplay, &hdrCapabilities);
+ const auto& [status, hdrCapabilities] =
+ mComposerClient->getHdrCapabilities(getPrimaryDisplayId());
- ASSERT_TRUE(error.isOk());
- ASSERT_TRUE(hdrCapabilities.maxLuminance >= hdrCapabilities.minLuminance);
+ ASSERT_TRUE(status.isOk());
+ EXPECT_TRUE(hdrCapabilities.maxLuminance >= hdrCapabilities.minLuminance);
}
TEST_P(GraphicsComposerAidlTest, GetPerFrameMetadataKeys) {
- std::vector<PerFrameMetadataKey> keys;
- const auto error = mComposerClient->getPerFrameMetadataKeys(mPrimaryDisplay, &keys);
-
- if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
+ const auto& [status, keys] = mComposerClient->getPerFrameMetadataKeys(getPrimaryDisplayId());
+ if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
GTEST_SUCCEED() << "getPerFrameMetadataKeys is not supported";
return;
}
- EXPECT_TRUE(error.isOk());
- ASSERT_TRUE(keys.size() >= 0);
+
+ ASSERT_TRUE(status.isOk());
+ EXPECT_TRUE(keys.size() >= 0);
}
TEST_P(GraphicsComposerAidlTest, GetReadbackBufferAttributes) {
- ReadbackBufferAttributes readBackBufferAttributes;
- const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay,
- &readBackBufferAttributes);
-
- if (error.isOk()) {
- EXPECT_EQ(EX_NONE, error.getServiceSpecificError());
+ const auto& [status, _] = mComposerClient->getReadbackBufferAttributes(getPrimaryDisplayId());
+ if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
+ GTEST_SUCCEED() << "getReadbackBufferAttributes is not supported";
+ return;
}
+
+ ASSERT_TRUE(status.isOk());
}
TEST_P(GraphicsComposerAidlTest, GetRenderIntents) {
- std::vector<ColorMode> modes;
- EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &modes).isOk());
- for (auto mode : modes) {
- std::vector<RenderIntent> intents;
- EXPECT_TRUE(mComposerClient->getRenderIntents(mPrimaryDisplay, mode, &intents).isOk());
+ const auto& [status, modes] = mComposerClient->getColorModes(getPrimaryDisplayId());
+ EXPECT_TRUE(status.isOk());
+ for (auto mode : modes) {
+ const auto& [intentStatus, intents] =
+ mComposerClient->getRenderIntents(getPrimaryDisplayId(), mode);
+ EXPECT_TRUE(intentStatus.isOk());
bool isHdr;
switch (mode) {
case ColorMode::BT2100_PQ:
@@ -417,158 +239,157 @@
RenderIntent requiredIntent =
isHdr ? RenderIntent::TONE_MAP_COLORIMETRIC : RenderIntent::COLORIMETRIC;
- auto iter = std::find(intents.cbegin(), intents.cend(), requiredIntent);
+ const auto iter = std::find(intents.cbegin(), intents.cend(), requiredIntent);
EXPECT_NE(intents.cend(), iter);
}
}
-TEST_P(GraphicsComposerAidlTest, GetRenderIntentsBadDisplay) {
- std::vector<ColorMode> modes;
- EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &modes).isOk());
+TEST_P(GraphicsComposerAidlTest, GetRenderIntents_BadDisplay) {
+ const auto& [status, modes] = mComposerClient->getColorModes(getPrimaryDisplayId());
+ ASSERT_TRUE(status.isOk());
+
for (auto mode : modes) {
- std::vector<RenderIntent> renderIntents;
- const auto error =
- mComposerClient->getRenderIntents(mInvalidDisplayId, mode, &renderIntents);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ const auto& [intentStatus, _] =
+ mComposerClient->getRenderIntents(getInvalidDisplayId(), mode);
+
+ EXPECT_FALSE(intentStatus.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, intentStatus.getServiceSpecificError());
}
}
-TEST_P(GraphicsComposerAidlTest, GetRenderIntentsBadParameter) {
- std::vector<RenderIntent> renderIntents;
- const auto error = mComposerClient->getRenderIntents(
- mPrimaryDisplay, static_cast<ColorMode>(-1), &renderIntents);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError());
+TEST_P(GraphicsComposerAidlTest, GetRenderIntents_BadParameter) {
+ const auto& [status, _] =
+ mComposerClient->getRenderIntents(getPrimaryDisplayId(), static_cast<ColorMode>(-1));
+
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError());
}
TEST_P(GraphicsComposerAidlTest, GetColorModes) {
- std::vector<ColorMode> colorModes;
- EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &colorModes).isOk());
+ const auto& [status, colorModes] = mComposerClient->getColorModes(getPrimaryDisplayId());
+ ASSERT_TRUE(status.isOk());
- auto native = std::find(colorModes.cbegin(), colorModes.cend(), ColorMode::NATIVE);
- ASSERT_NE(colorModes.cend(), native);
+ const auto native = std::find(colorModes.cbegin(), colorModes.cend(), ColorMode::NATIVE);
+ EXPECT_NE(colorModes.cend(), native);
}
-TEST_P(GraphicsComposerAidlTest, GetColorModeBadDisplay) {
- std::vector<ColorMode> colorModes;
- const auto error = mComposerClient->getColorModes(mInvalidDisplayId, &colorModes);
+TEST_P(GraphicsComposerAidlTest, GetColorMode_BadDisplay) {
+ const auto& [status, _] = mComposerClient->getColorModes(getInvalidDisplayId());
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
TEST_P(GraphicsComposerAidlTest, SetColorMode) {
- std::vector<ColorMode> colorModes;
- EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &colorModes).isOk());
+ const auto& [status, colorModes] = mComposerClient->getColorModes(getPrimaryDisplayId());
+ EXPECT_TRUE(status.isOk());
+
for (auto mode : colorModes) {
- std::vector<RenderIntent> intents;
- EXPECT_TRUE(mComposerClient->getRenderIntents(mPrimaryDisplay, mode, &intents).isOk())
- << "failed to get render intents";
+ const auto& [intentStatus, intents] =
+ mComposerClient->getRenderIntents(getPrimaryDisplayId(), mode);
+ EXPECT_TRUE(intentStatus.isOk()) << "failed to get render intents";
+
for (auto intent : intents) {
- const auto error = mComposerClient->setColorMode(mPrimaryDisplay, mode, intent);
- EXPECT_TRUE(error.isOk() ||
- IComposerClient::EX_UNSUPPORTED == error.getServiceSpecificError())
+ const auto modeStatus =
+ mComposerClient->setColorMode(getPrimaryDisplayId(), mode, intent);
+ EXPECT_TRUE(modeStatus.isOk() ||
+ IComposerClient::EX_UNSUPPORTED == modeStatus.getServiceSpecificError())
<< "failed to set color mode";
}
}
- const auto error = mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE,
- RenderIntent::COLORIMETRIC);
- EXPECT_TRUE(error.isOk() || IComposerClient::EX_UNSUPPORTED == error.getServiceSpecificError())
+ const auto modeStatus = mComposerClient->setColorMode(getPrimaryDisplayId(), ColorMode::NATIVE,
+ RenderIntent::COLORIMETRIC);
+ EXPECT_TRUE(modeStatus.isOk() ||
+ IComposerClient::EX_UNSUPPORTED == modeStatus.getServiceSpecificError())
<< "failed to set color mode";
}
-TEST_P(GraphicsComposerAidlTest, SetColorModeBadDisplay) {
- std::vector<ColorMode> colorModes;
- EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &colorModes).isOk());
- for (auto mode : colorModes) {
- std::vector<RenderIntent> intents;
- EXPECT_TRUE(mComposerClient->getRenderIntents(mPrimaryDisplay, mode, &intents).isOk())
- << "failed to get render intents";
- for (auto intent : intents) {
- auto const error = mComposerClient->setColorMode(mInvalidDisplayId, mode, intent);
+TEST_P(GraphicsComposerAidlTest, SetColorMode_BadDisplay) {
+ const auto& [status, colorModes] = mComposerClient->getColorModes(getPrimaryDisplayId());
+ ASSERT_TRUE(status.isOk());
- EXPECT_FALSE(error.isOk());
- ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ for (auto mode : colorModes) {
+ const auto& [intentStatus, intents] =
+ mComposerClient->getRenderIntents(getPrimaryDisplayId(), mode);
+ ASSERT_TRUE(intentStatus.isOk()) << "failed to get render intents";
+
+ for (auto intent : intents) {
+ auto const modeStatus =
+ mComposerClient->setColorMode(getInvalidDisplayId(), mode, intent);
+
+ EXPECT_FALSE(modeStatus.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, modeStatus.getServiceSpecificError());
}
}
}
-TEST_P(GraphicsComposerAidlTest, SetColorModeBadParameter) {
- const auto colorModeError = mComposerClient->setColorMode(
- mPrimaryDisplay, static_cast<ColorMode>(-1), RenderIntent::COLORIMETRIC);
+TEST_P(GraphicsComposerAidlTest, SetColorMode_BadParameter) {
+ auto status = mComposerClient->setColorMode(getPrimaryDisplayId(), static_cast<ColorMode>(-1),
+ RenderIntent::COLORIMETRIC);
- EXPECT_FALSE(colorModeError.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, colorModeError.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError());
- const auto renderIntentError = mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE,
- static_cast<RenderIntent>(-1));
+ status = mComposerClient->setColorMode(getPrimaryDisplayId(), ColorMode::NATIVE,
+ static_cast<RenderIntent>(-1));
- EXPECT_FALSE(renderIntentError.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, renderIntentError.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError());
}
TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSamplingAttributes) {
- int constexpr invalid = -1;
+ int constexpr kInvalid = -1;
+ const auto& [status, format] =
+ mComposerClient->getDisplayedContentSamplingAttributes(getPrimaryDisplayId());
- DisplayContentSamplingAttributes format;
- auto error = mComposerClient->getDisplayedContentSamplingAttributes(mPrimaryDisplay, &format);
-
- if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
+ if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
SUCCEED() << "Device does not support optional extension. Test skipped";
return;
}
- EXPECT_TRUE(error.isOk());
- EXPECT_NE(format.format, static_cast<common::PixelFormat>(invalid));
- EXPECT_NE(format.dataspace, static_cast<common::Dataspace>(invalid));
- EXPECT_NE(format.componentMask, static_cast<FormatColorComponent>(invalid));
+ ASSERT_TRUE(status.isOk());
+ EXPECT_NE(kInvalid, static_cast<int>(format.format));
+ EXPECT_NE(kInvalid, static_cast<int>(format.dataspace));
+ EXPECT_NE(kInvalid, static_cast<int>(format.componentMask));
};
TEST_P(GraphicsComposerAidlTest, SetDisplayedContentSamplingEnabled) {
- auto const maxFrames = 10;
+ int constexpr kMaxFrames = 10;
FormatColorComponent enableAllComponents = FormatColorComponent::FORMAT_COMPONENT_0;
- auto error = mComposerClient->setDisplayedContentSamplingEnabled(
- mPrimaryDisplay, true, enableAllComponents, maxFrames);
- if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
+ auto status = mComposerClient->setDisplayedContentSamplingEnabled(
+ getPrimaryDisplayId(), /*isEnabled*/ true, enableAllComponents, kMaxFrames);
+ if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
SUCCEED() << "Device does not support optional extension. Test skipped";
return;
}
- EXPECT_TRUE(error.isOk());
+ EXPECT_TRUE(status.isOk());
- error = mComposerClient->setDisplayedContentSamplingEnabled(mPrimaryDisplay, false,
- enableAllComponents, maxFrames);
- EXPECT_TRUE(error.isOk());
+ status = mComposerClient->setDisplayedContentSamplingEnabled(
+ getPrimaryDisplayId(), /*isEnabled*/ false, enableAllComponents, kMaxFrames);
+ EXPECT_TRUE(status.isOk());
}
TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSample) {
- DisplayContentSamplingAttributes displayContentSamplingAttributes;
- int constexpr invalid = -1;
- displayContentSamplingAttributes.format = static_cast<common::PixelFormat>(invalid);
- displayContentSamplingAttributes.dataspace = static_cast<common::Dataspace>(invalid);
- displayContentSamplingAttributes.componentMask = static_cast<FormatColorComponent>(invalid);
- auto error = mComposerClient->getDisplayedContentSamplingAttributes(
- mPrimaryDisplay, &displayContentSamplingAttributes);
- if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
+ const auto& [status, displayContentSamplingAttributes] =
+ mComposerClient->getDisplayedContentSamplingAttributes(getPrimaryDisplayId());
+ if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
SUCCEED() << "Sampling attributes aren't supported on this device, test skipped";
return;
}
- int64_t maxFrames = 10;
- int64_t timestamp = 0;
- int64_t frameCount = 0;
- DisplayContentSample displayContentSample;
- error = mComposerClient->getDisplayedContentSample(mPrimaryDisplay, maxFrames, timestamp,
- &displayContentSample);
- if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
+ int64_t constexpr kMaxFrames = 10;
+ int64_t constexpr kTimestamp = 0;
+ const auto& [sampleStatus, displayContentSample] = mComposerClient->getDisplayedContentSample(
+ getPrimaryDisplayId(), kMaxFrames, kTimestamp);
+ if (!sampleStatus.isOk() &&
+ sampleStatus.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
SUCCEED() << "Device does not support optional extension. Test skipped";
return;
}
- EXPECT_TRUE(error.isOk());
- EXPECT_LE(frameCount, maxFrames);
- std::vector<std::vector<int64_t>> histogram = {
+ EXPECT_TRUE(sampleStatus.isOk());
+ const std::vector<std::vector<int64_t>> histogram = {
displayContentSample.sampleComponent0, displayContentSample.sampleComponent1,
displayContentSample.sampleComponent2, displayContentSample.sampleComponent3};
@@ -579,18 +400,24 @@
}
}
-TEST_P(GraphicsComposerAidlTest, getDisplayConnectionType) {
- DisplayConnectionType type;
- EXPECT_FALSE(mComposerClient->getDisplayConnectionType(mInvalidDisplayId, &type).isOk());
+TEST_P(GraphicsComposerAidlTest, GetDisplayConnectionType) {
+ const auto& [status, type] = mComposerClient->getDisplayConnectionType(getInvalidDisplayId());
+
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
+
for (const auto& display : mDisplays) {
- EXPECT_TRUE(mComposerClient->getDisplayConnectionType(display.get(), &type).isOk());
+ const auto& [connectionTypeStatus, _] =
+ mComposerClient->getDisplayConnectionType(display.getDisplayId());
+ EXPECT_TRUE(connectionTypeStatus.isOk());
}
}
-TEST_P(GraphicsComposerAidlTest, getDisplayAttribute) {
+TEST_P(GraphicsComposerAidlTest, GetDisplayAttribute) {
for (const auto& display : mDisplays) {
- std::vector<int32_t> configs;
- EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk());
+ const auto& [status, configs] = mComposerClient->getDisplayConfigs(display.getDisplayId());
+ EXPECT_TRUE(status.isOk());
+
for (const auto& config : configs) {
const std::array<DisplayAttribute, 4> requiredAttributes = {{
DisplayAttribute::WIDTH,
@@ -598,11 +425,10 @@
DisplayAttribute::VSYNC_PERIOD,
DisplayAttribute::CONFIG_GROUP,
}};
- int32_t value;
for (const auto& attribute : requiredAttributes) {
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config, attribute, &value)
- .isOk());
+ const auto& [attribStatus, value] = mComposerClient->getDisplayAttribute(
+ display.getDisplayId(), config, attribute);
+ EXPECT_TRUE(attribStatus.isOk());
EXPECT_NE(-1, value);
}
@@ -611,22 +437,19 @@
DisplayAttribute::DPI_Y,
}};
for (const auto& attribute : optionalAttributes) {
- const auto error = mComposerClient->getDisplayAttribute(display.get(), config,
- attribute, &value);
- if (error.isOk()) {
- EXPECT_EQ(EX_NONE, error.getServiceSpecificError());
- } else {
- EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError());
- }
+ const auto& [attribStatus, value] = mComposerClient->getDisplayAttribute(
+ display.getDisplayId(), config, attribute);
+ EXPECT_TRUE(attribStatus.isOk() || IComposerClient::EX_UNSUPPORTED ==
+ attribStatus.getServiceSpecificError());
}
}
}
}
-TEST_P(GraphicsComposerAidlTest, checkConfigsAreValid) {
+TEST_P(GraphicsComposerAidlTest, CheckConfigsAreValid) {
for (const auto& display : mDisplays) {
- std::vector<int32_t> configs;
- EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk());
+ const auto& [status, configs] = mComposerClient->getDisplayConfigs(display.getDisplayId());
+ EXPECT_TRUE(status.isOk());
EXPECT_FALSE(std::any_of(configs.begin(), configs.end(), [](auto config) {
return config == IComposerClient::INVALID_CONFIGURATION;
@@ -634,349 +457,287 @@
}
}
-TEST_P(GraphicsComposerAidlTest, getDisplayAttributeConfigsInAGroupDifferOnlyByVsyncPeriod) {
- struct Resolution {
- int32_t width;
- int32_t height;
- };
- struct Dpi {
- int32_t x;
- int32_t y;
- };
- for (const auto& display : mDisplays) {
- std::vector<int32_t> configs;
- EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk());
- std::unordered_map<int32_t, Resolution> configGroupToResolutionMap;
- std::unordered_map<int32_t, Dpi> configGroupToDpiMap;
- for (const auto& config : configs) {
- int32_t configGroup = -1;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config,
- DisplayAttribute::CONFIG_GROUP, &configGroup)
- .isOk());
- int32_t width = -1;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config,
- DisplayAttribute::WIDTH, &width)
- .isOk());
- int32_t height = -1;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config,
- DisplayAttribute::HEIGHT, &height)
- .isOk());
- if (configGroupToResolutionMap.find(configGroup) == configGroupToResolutionMap.end()) {
- configGroupToResolutionMap[configGroup] = {width, height};
- }
- EXPECT_EQ(configGroupToResolutionMap[configGroup].width, width);
- EXPECT_EQ(configGroupToResolutionMap[configGroup].height, height);
+TEST_P(GraphicsComposerAidlTest, GetDisplayVsyncPeriod_BadDisplay) {
+ const auto& [status, vsyncPeriodNanos] =
+ mComposerClient->getDisplayVsyncPeriod(getInvalidDisplayId());
- int32_t dpiX = -1;
- mComposerClient->getDisplayAttribute(display.get(), config, DisplayAttribute::DPI_X,
- &dpiX);
-
- int32_t dpiY = -1;
- mComposerClient->getDisplayAttribute(display.get(), config, DisplayAttribute::DPI_Y,
- &dpiY);
- if (dpiX == -1 && dpiY == -1) {
- continue;
- }
-
- if (configGroupToDpiMap.find(configGroup) == configGroupToDpiMap.end()) {
- configGroupToDpiMap[configGroup] = {dpiX, dpiY};
- }
- EXPECT_EQ(configGroupToDpiMap[configGroup].x, dpiX);
- EXPECT_EQ(configGroupToDpiMap[configGroup].y, dpiY);
- }
- }
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
-TEST_P(GraphicsComposerAidlTest, getDisplayVsyncPeriod_BadDisplay) {
- int32_t vsyncPeriodNanos;
- const auto error = mComposerClient->getDisplayVsyncPeriod(mInvalidDisplayId, &vsyncPeriodNanos);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
-}
-
-TEST_P(GraphicsComposerAidlTest, setActiveConfigWithConstraints_BadDisplay) {
- VsyncPeriodChangeTimeline timeline;
+TEST_P(GraphicsComposerAidlTest, SetActiveConfigWithConstraints_BadDisplay) {
VsyncPeriodChangeConstraints constraints;
-
constraints.seamlessRequired = false;
constraints.desiredTimeNanos = systemTime();
- int32_t config = 0;
- auto const error = mComposerClient->setActiveConfigWithConstraints(mInvalidDisplayId, config,
- constraints, &timeline);
+ auto invalidDisplay = VtsDisplay(getInvalidDisplayId());
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ const auto& [status, timeline] = mComposerClient->setActiveConfigWithConstraints(
+ &invalidDisplay, /*config*/ 0, constraints);
+
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
-TEST_P(GraphicsComposerAidlTest, setActiveConfigWithConstraints_BadConfig) {
- VsyncPeriodChangeTimeline timeline;
+TEST_P(GraphicsComposerAidlTest, SetActiveConfigWithConstraints_BadConfig) {
VsyncPeriodChangeConstraints constraints;
-
constraints.seamlessRequired = false;
constraints.desiredTimeNanos = systemTime();
for (VtsDisplay& display : mDisplays) {
- int32_t invalidConfigId = GetInvalidConfigId();
- const auto error =
- setActiveConfigWithConstraints(display, invalidConfigId, constraints, &timeline);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_CONFIG, error.getServiceSpecificError());
+ int32_t constexpr kInvalidConfigId = IComposerClient::INVALID_CONFIGURATION;
+ const auto& [status, _] = mComposerClient->setActiveConfigWithConstraints(
+ &display, kInvalidConfigId, constraints);
+
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_CONFIG, status.getServiceSpecificError());
}
}
-TEST_P(GraphicsComposerAidlTest, setBootDisplayConfig_BadDisplay) {
- int32_t config = 0;
- auto const error = mComposerClient->setBootDisplayConfig(mInvalidDisplayId, config);
+TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadDisplay) {
+ const auto& status = mComposerClient->setBootDisplayConfig(getInvalidDisplayId(), /*config*/ 0);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
-TEST_P(GraphicsComposerAidlTest, setBootDisplayConfig_BadConfig) {
+TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadConfig) {
for (VtsDisplay& display : mDisplays) {
- int32_t invalidConfigId = GetInvalidConfigId();
- const auto error = mComposerClient->setBootDisplayConfig(display.get(), invalidConfigId);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_CONFIG, error.getServiceSpecificError());
+ int32_t constexpr kInvalidConfigId = IComposerClient::INVALID_CONFIGURATION;
+ const auto& status =
+ mComposerClient->setBootDisplayConfig(display.getDisplayId(), kInvalidConfigId);
+
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_CONFIG, status.getServiceSpecificError());
}
}
-TEST_P(GraphicsComposerAidlTest, setBootDisplayConfig) {
- std::vector<int32_t> configs;
- EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk());
- for (auto config : configs) {
- EXPECT_TRUE(mComposerClient->setBootDisplayConfig(mPrimaryDisplay, config).isOk());
+TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig) {
+ const auto& [status, configs] = mComposerClient->getDisplayConfigs(getPrimaryDisplayId());
+ EXPECT_TRUE(status.isOk());
+ for (const auto& config : configs) {
+ EXPECT_TRUE(mComposerClient->setBootDisplayConfig(getPrimaryDisplayId(), config).isOk());
}
}
-TEST_P(GraphicsComposerAidlTest, clearBootDisplayConfig_BadDisplay) {
- auto const error = mComposerClient->clearBootDisplayConfig(mInvalidDisplayId);
+TEST_P(GraphicsComposerAidlTest, ClearBootDisplayConfig_BadDisplay) {
+ const auto& status = mComposerClient->clearBootDisplayConfig(getInvalidDisplayId());
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
-TEST_P(GraphicsComposerAidlTest, clearBootDisplayConfig) {
- EXPECT_TRUE(mComposerClient->clearBootDisplayConfig(mPrimaryDisplay).isOk());
+TEST_P(GraphicsComposerAidlTest, ClearBootDisplayConfig) {
+ EXPECT_TRUE(mComposerClient->clearBootDisplayConfig(getPrimaryDisplayId()).isOk());
}
-TEST_P(GraphicsComposerAidlTest, getPreferredBootDisplayConfig_BadDisplay) {
- int32_t config;
- auto const error = mComposerClient->getPreferredBootDisplayConfig(mInvalidDisplayId, &config);
+TEST_P(GraphicsComposerAidlTest, GetPreferredBootDisplayConfig_BadDisplay) {
+ const auto& [status, _] = mComposerClient->getPreferredBootDisplayConfig(getInvalidDisplayId());
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
-TEST_P(GraphicsComposerAidlTest, getPreferredBootDisplayConfig) {
- int32_t preferredDisplayConfig = 0;
- auto const error = mComposerClient->getPreferredBootDisplayConfig(mPrimaryDisplay,
- &preferredDisplayConfig);
- EXPECT_TRUE(error.isOk());
+TEST_P(GraphicsComposerAidlTest, GetPreferredBootDisplayConfig) {
+ const auto& [status, preferredDisplayConfig] =
+ mComposerClient->getPreferredBootDisplayConfig(getPrimaryDisplayId());
+ EXPECT_TRUE(status.isOk());
- std::vector<int32_t> configs;
- EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk());
+ const auto& [configStatus, configs] = mComposerClient->getDisplayConfigs(getPrimaryDisplayId());
+
+ EXPECT_TRUE(configStatus.isOk());
EXPECT_NE(configs.end(), std::find(configs.begin(), configs.end(), preferredDisplayConfig));
}
-TEST_P(GraphicsComposerAidlTest, setAutoLowLatencyModeBadDisplay) {
- EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY,
- mComposerClient->setAutoLowLatencyMode(mInvalidDisplayId, true)
- .getServiceSpecificError());
- EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY,
- mComposerClient->setAutoLowLatencyMode(mInvalidDisplayId, false)
- .getServiceSpecificError());
+TEST_P(GraphicsComposerAidlTest, SetAutoLowLatencyMode_BadDisplay) {
+ auto status = mComposerClient->setAutoLowLatencyMode(getInvalidDisplayId(), /*isEnabled*/ true);
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
+
+ status = mComposerClient->setAutoLowLatencyMode(getInvalidDisplayId(), /*isEnabled*/ false);
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
-TEST_P(GraphicsComposerAidlTest, setAutoLowLatencyMode) {
+TEST_P(GraphicsComposerAidlTest, SetAutoLowLatencyMode) {
for (const auto& display : mDisplays) {
- std::vector<DisplayCapability> capabilities;
- const auto error = mComposerClient->getDisplayCapabilities(display.get(), &capabilities);
- EXPECT_TRUE(error.isOk());
+ const auto& [status, capabilities] =
+ mComposerClient->getDisplayCapabilities(display.getDisplayId());
+ ASSERT_TRUE(status.isOk());
const bool allmSupport =
std::find(capabilities.begin(), capabilities.end(),
DisplayCapability::AUTO_LOW_LATENCY_MODE) != capabilities.end();
if (!allmSupport) {
- const auto errorIsOn = mComposerClient->setAutoLowLatencyMode(display.get(), true);
- EXPECT_FALSE(errorIsOn.isOk());
- EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, errorIsOn.getServiceSpecificError());
- const auto errorIsOff = mComposerClient->setAutoLowLatencyMode(display.get(), false);
- EXPECT_FALSE(errorIsOff.isOk());
- EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, errorIsOff.getServiceSpecificError());
+ const auto& statusIsOn = mComposerClient->setAutoLowLatencyMode(display.getDisplayId(),
+ /*isEnabled*/ true);
+ EXPECT_FALSE(statusIsOn.isOk());
+ EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, statusIsOn.getServiceSpecificError());
+ const auto& statusIsOff = mComposerClient->setAutoLowLatencyMode(display.getDisplayId(),
+ /*isEnabled*/ false);
+ EXPECT_FALSE(statusIsOff.isOk());
+ EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, statusIsOff.getServiceSpecificError());
GTEST_SUCCEED() << "Auto Low Latency Mode is not supported on display "
- << std::to_string(display.get()) << ", skipping test";
+ << std::to_string(display.getDisplayId()) << ", skipping test";
return;
}
- EXPECT_TRUE(mComposerClient->setAutoLowLatencyMode(display.get(), true).isOk());
- EXPECT_TRUE(mComposerClient->setAutoLowLatencyMode(display.get(), false).isOk());
+ EXPECT_TRUE(mComposerClient->setAutoLowLatencyMode(display.getDisplayId(), true).isOk());
+ EXPECT_TRUE(mComposerClient->setAutoLowLatencyMode(display.getDisplayId(), false).isOk());
}
}
-TEST_P(GraphicsComposerAidlTest, getSupportedContentTypesBadDisplay) {
- std::vector<ContentType> supportedContentTypes;
- const auto error =
- mComposerClient->getSupportedContentTypes(mInvalidDisplayId, &supportedContentTypes);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+TEST_P(GraphicsComposerAidlTest, GetSupportedContentTypes_BadDisplay) {
+ const auto& [status, _] = mComposerClient->getSupportedContentTypes(getInvalidDisplayId());
+
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
-TEST_P(GraphicsComposerAidlTest, getSupportedContentTypes) {
- std::vector<ContentType> supportedContentTypes;
+TEST_P(GraphicsComposerAidlTest, GetSupportedContentTypes) {
for (const auto& display : mDisplays) {
- supportedContentTypes.clear();
- const auto error =
- mComposerClient->getSupportedContentTypes(display.get(), &supportedContentTypes);
-
- ASSERT_TRUE(error.isOk());
+ const auto& [status, supportedContentTypes] =
+ mComposerClient->getSupportedContentTypes(display.getDisplayId());
+ ASSERT_TRUE(status.isOk());
const bool noneSupported =
std::find(supportedContentTypes.begin(), supportedContentTypes.end(),
ContentType::NONE) != supportedContentTypes.end();
+
EXPECT_FALSE(noneSupported);
}
}
-TEST_P(GraphicsComposerAidlTest, setContentTypeNoneAlwaysAccepted) {
+TEST_P(GraphicsComposerAidlTest, SetContentTypeNoneAlwaysAccepted) {
for (const auto& display : mDisplays) {
- const auto error = mComposerClient->setContentType(display.get(), ContentType::NONE);
- EXPECT_TRUE(error.isOk());
+ EXPECT_TRUE(
+ mComposerClient->setContentType(display.getDisplayId(), ContentType::NONE).isOk());
}
}
-TEST_P(GraphicsComposerAidlTest, setContentTypeBadDisplay) {
+TEST_P(GraphicsComposerAidlTest, SetContentType_BadDisplay) {
constexpr ContentType types[] = {ContentType::NONE, ContentType::GRAPHICS, ContentType::PHOTO,
ContentType::CINEMA, ContentType::GAME};
for (const auto& type : types) {
- auto const error = mComposerClient->setContentType(mInvalidDisplayId, type);
+ const auto& status = mComposerClient->setContentType(getInvalidDisplayId(), type);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
}
-TEST_P(GraphicsComposerAidlTest, setGraphicsContentType) {
+TEST_P(GraphicsComposerAidlTest, SetGraphicsContentType) {
Test_setContentType(ContentType::GRAPHICS, "GRAPHICS");
}
-TEST_P(GraphicsComposerAidlTest, setPhotoContentType) {
+TEST_P(GraphicsComposerAidlTest, SetPhotoContentType) {
Test_setContentType(ContentType::PHOTO, "PHOTO");
}
-TEST_P(GraphicsComposerAidlTest, setCinemaContentType) {
+TEST_P(GraphicsComposerAidlTest, SetCinemaContentType) {
Test_setContentType(ContentType::CINEMA, "CINEMA");
}
-TEST_P(GraphicsComposerAidlTest, setGameContentType) {
+TEST_P(GraphicsComposerAidlTest, SetGameContentType) {
Test_setContentType(ContentType::GAME, "GAME");
}
TEST_P(GraphicsComposerAidlTest, CreateVirtualDisplay) {
- int32_t maxVirtualDisplayCount;
- EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&maxVirtualDisplayCount).isOk());
+ const auto& [status, maxVirtualDisplayCount] = mComposerClient->getMaxVirtualDisplayCount();
+ EXPECT_TRUE(status.isOk());
+
if (maxVirtualDisplayCount == 0) {
GTEST_SUCCEED() << "no virtual display support";
return;
}
- VirtualDisplay virtualDisplay;
+ const auto& [virtualDisplayStatus, virtualDisplay] = mComposerClient->createVirtualDisplay(
+ /*width*/ 64, /*height*/ 64, common::PixelFormat::IMPLEMENTATION_DEFINED,
+ kBufferSlotCount);
- EXPECT_TRUE(mComposerClient
- ->createVirtualDisplay(64, 64, common::PixelFormat::IMPLEMENTATION_DEFINED,
- kBufferSlotCount, &virtualDisplay)
- .isOk());
-
- ASSERT_TRUE(mDisplayResources.insert({virtualDisplay.display, DisplayResource(true)}).second)
- << "duplicated virtual display id " << virtualDisplay.display;
-
+ ASSERT_TRUE(virtualDisplayStatus.isOk());
EXPECT_TRUE(mComposerClient->destroyVirtualDisplay(virtualDisplay.display).isOk());
}
-TEST_P(GraphicsComposerAidlTest, DestroyVirtualDisplayBadDisplay) {
- int32_t maxDisplayCount = 0;
- EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&maxDisplayCount).isOk());
+TEST_P(GraphicsComposerAidlTest, DestroyVirtualDisplay_BadDisplay) {
+ const auto& [status, maxDisplayCount] = mComposerClient->getMaxVirtualDisplayCount();
+ EXPECT_TRUE(status.isOk());
+
if (maxDisplayCount == 0) {
GTEST_SUCCEED() << "no virtual display support";
return;
}
- const auto error = mComposerClient->destroyVirtualDisplay(mInvalidDisplayId);
- EXPECT_FALSE(error.isOk());
- ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ const auto& destroyStatus = mComposerClient->destroyVirtualDisplay(getInvalidDisplayId());
+
+ EXPECT_FALSE(destroyStatus.isOk());
+ ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, destroyStatus.getServiceSpecificError());
}
TEST_P(GraphicsComposerAidlTest, CreateLayer) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+ const auto& [status, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
- EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk());
+ EXPECT_TRUE(status.isOk());
+ EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk());
}
-TEST_P(GraphicsComposerAidlTest, CreateLayerBadDisplay) {
- int64_t layer;
- const auto error = mComposerClient->createLayer(mInvalidDisplayId, kBufferSlotCount, &layer);
+TEST_P(GraphicsComposerAidlTest, CreateLayer_BadDisplay) {
+ const auto& [status, _] = mComposerClient->createLayer(getInvalidDisplayId(), kBufferSlotCount);
- EXPECT_FALSE(error.isOk());
- ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
-TEST_P(GraphicsComposerAidlTest, DestroyLayerBadDisplay) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+TEST_P(GraphicsComposerAidlTest, DestroyLayer_BadDisplay) {
+ const auto& [status, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(status.isOk());
- const auto error = mComposerClient->destroyLayer(mInvalidDisplayId, layer);
+ const auto& destroyStatus = mComposerClient->destroyLayer(getInvalidDisplayId(), layer);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
- EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk());
+ EXPECT_FALSE(destroyStatus.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, destroyStatus.getServiceSpecificError());
+ ASSERT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk());
}
-TEST_P(GraphicsComposerAidlTest, DestroyLayerBadLayerError) {
+TEST_P(GraphicsComposerAidlTest, DestroyLayer_BadLayerError) {
// We haven't created any layers yet, so any id should be invalid
- const auto error = mComposerClient->destroyLayer(mPrimaryDisplay, 1);
+ const auto& status = mComposerClient->destroyLayer(getPrimaryDisplayId(), /*layer*/ 1);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_LAYER, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_LAYER, status.getServiceSpecificError());
}
-TEST_P(GraphicsComposerAidlTest, GetActiveConfigBadDisplay) {
- int32_t config;
- const auto error = mComposerClient->getActiveConfig(mInvalidDisplayId, &config);
+TEST_P(GraphicsComposerAidlTest, GetActiveConfig_BadDisplay) {
+ const auto& [status, _] = mComposerClient->getActiveConfig(getInvalidDisplayId());
- EXPECT_FALSE(error.isOk());
- ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
TEST_P(GraphicsComposerAidlTest, GetDisplayConfig) {
- std::vector<int32_t> configs;
- EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk());
+ const auto& [status, _] = mComposerClient->getDisplayConfigs(getPrimaryDisplayId());
+ EXPECT_TRUE(status.isOk());
}
-TEST_P(GraphicsComposerAidlTest, GetDisplayConfigBadDisplay) {
- std::vector<int32_t> configs;
- const auto error = mComposerClient->getDisplayConfigs(mInvalidDisplayId, &configs);
+TEST_P(GraphicsComposerAidlTest, GetDisplayConfig_BadDisplay) {
+ const auto& [status, _] = mComposerClient->getDisplayConfigs(getInvalidDisplayId());
- EXPECT_FALSE(error.isOk());
- ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
TEST_P(GraphicsComposerAidlTest, GetDisplayName) {
- std::string displayName;
- EXPECT_TRUE(mComposerClient->getDisplayName(mPrimaryDisplay, &displayName).isOk());
+ const auto& [status, _] = mComposerClient->getDisplayName(getPrimaryDisplayId());
+ EXPECT_TRUE(status.isOk());
}
-TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientationBadDisplay) {
- Transform displayOrientation;
- const auto error =
- mComposerClient->getDisplayPhysicalOrientation(mInvalidDisplayId, &displayOrientation);
+TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientation_BadDisplay) {
+ const auto& [status, _] = mComposerClient->getDisplayPhysicalOrientation(getInvalidDisplayId());
- EXPECT_FALSE(error.isOk());
- ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientation) {
@@ -987,94 +748,111 @@
Transform::ROT_270,
};
- Transform displayOrientation;
- const auto error =
- mComposerClient->getDisplayPhysicalOrientation(mPrimaryDisplay, &displayOrientation);
+ const auto& [status, displayOrientation] =
+ mComposerClient->getDisplayPhysicalOrientation(getPrimaryDisplayId());
- EXPECT_TRUE(error.isOk());
+ EXPECT_TRUE(status.isOk());
EXPECT_NE(std::find(allowedDisplayOrientations.begin(), allowedDisplayOrientations.end(),
displayOrientation),
allowedDisplayOrientations.end());
}
TEST_P(GraphicsComposerAidlTest, SetClientTargetSlotCount) {
- EXPECT_TRUE(
- mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kBufferSlotCount).isOk());
+ EXPECT_TRUE(mComposerClient->setClientTargetSlotCount(getPrimaryDisplayId(), kBufferSlotCount)
+ .isOk());
}
TEST_P(GraphicsComposerAidlTest, SetActiveConfig) {
- std::vector<int32_t> configs;
- EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk());
- for (auto config : configs) {
- EXPECT_TRUE(mComposerClient->setActiveConfig(mPrimaryDisplay, config).isOk());
- int32_t config1;
- EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk());
+ const auto& [status, configs] = mComposerClient->getDisplayConfigs(getPrimaryDisplayId());
+ EXPECT_TRUE(status.isOk());
+
+ for (const auto& config : configs) {
+ auto display = getEditablePrimaryDisplay();
+ EXPECT_TRUE(mComposerClient->setActiveConfig(&display, config).isOk());
+ const auto& [configStatus, config1] =
+ mComposerClient->getActiveConfig(getPrimaryDisplayId());
+ EXPECT_TRUE(configStatus.isOk());
EXPECT_EQ(config, config1);
}
}
TEST_P(GraphicsComposerAidlTest, SetActiveConfigPowerCycle) {
- EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk());
- EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk());
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk());
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk());
- std::vector<int32_t> configs;
- EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk());
- for (auto config : configs) {
- EXPECT_TRUE(mComposerClient->setActiveConfig(mPrimaryDisplay, config).isOk());
- int32_t config1;
- EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk());
+ const auto& [status, configs] = mComposerClient->getDisplayConfigs(getPrimaryDisplayId());
+ EXPECT_TRUE(status.isOk());
+
+ for (const auto& config : configs) {
+ auto display = getEditablePrimaryDisplay();
+ EXPECT_TRUE(mComposerClient->setActiveConfig(&display, config).isOk());
+ const auto& [config1Status, config1] =
+ mComposerClient->getActiveConfig(getPrimaryDisplayId());
+ EXPECT_TRUE(config1Status.isOk());
EXPECT_EQ(config, config1);
- EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk());
- EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk());
- EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk());
- EXPECT_EQ(config, config1);
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk());
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk());
+ const auto& [config2Status, config2] =
+ mComposerClient->getActiveConfig(getPrimaryDisplayId());
+ EXPECT_TRUE(config2Status.isOk());
+ EXPECT_EQ(config, config2);
}
}
TEST_P(GraphicsComposerAidlTest, SetPowerModeUnsupported) {
- std::vector<DisplayCapability> capabilities;
- auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities);
- ASSERT_TRUE(error.isOk());
+ const auto& [status, capabilities] =
+ mComposerClient->getDisplayCapabilities(getPrimaryDisplayId());
+ ASSERT_TRUE(status.isOk());
+
const bool isDozeSupported = std::find(capabilities.begin(), capabilities.end(),
DisplayCapability::DOZE) != capabilities.end();
const bool isSuspendSupported = std::find(capabilities.begin(), capabilities.end(),
DisplayCapability::SUSPEND) != capabilities.end();
- if (!isDozeSupported) {
- error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError());
- error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE_SUSPEND);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError());
+ if (!isDozeSupported) {
+ const auto& powerModeDozeStatus =
+ mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::DOZE);
+ EXPECT_FALSE(powerModeDozeStatus.isOk());
+ EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, powerModeDozeStatus.getServiceSpecificError());
+
+ const auto& powerModeDozeSuspendStatus =
+ mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::DOZE_SUSPEND);
+ EXPECT_FALSE(powerModeDozeSuspendStatus.isOk());
+ EXPECT_EQ(IComposerClient::EX_UNSUPPORTED,
+ powerModeDozeSuspendStatus.getServiceSpecificError());
}
if (!isSuspendSupported) {
- error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON_SUSPEND);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError());
+ const auto& powerModeSuspendStatus =
+ mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON_SUSPEND);
+ EXPECT_FALSE(powerModeSuspendStatus.isOk());
+ EXPECT_EQ(IComposerClient::EX_UNSUPPORTED,
+ powerModeSuspendStatus.getServiceSpecificError());
- error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE_SUSPEND);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError());
+ const auto& powerModeDozeSuspendStatus =
+ mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::DOZE_SUSPEND);
+ EXPECT_FALSE(powerModeDozeSuspendStatus.isOk());
+ EXPECT_EQ(IComposerClient::EX_UNSUPPORTED,
+ powerModeDozeSuspendStatus.getServiceSpecificError());
}
}
TEST_P(GraphicsComposerAidlTest, SetVsyncEnabled) {
- mComposerCallback->setVsyncAllowed(true);
+ mComposerClient->setVsyncAllowed(true);
- EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, true).isOk());
+ EXPECT_TRUE(mComposerClient->setVsync(getPrimaryDisplayId(), true).isOk());
usleep(60 * 1000);
- EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, false).isOk());
+ EXPECT_TRUE(mComposerClient->setVsync(getPrimaryDisplayId(), false).isOk());
- mComposerCallback->setVsyncAllowed(false);
+ mComposerClient->setVsyncAllowed(false);
}
TEST_P(GraphicsComposerAidlTest, SetPowerMode) {
- std::vector<DisplayCapability> capabilities;
- const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities);
- ASSERT_TRUE(error.isOk());
+ const auto& [status, capabilities] =
+ mComposerClient->getDisplayCapabilities(getPrimaryDisplayId());
+ ASSERT_TRUE(status.isOk());
+
const bool isDozeSupported = std::find(capabilities.begin(), capabilities.end(),
DisplayCapability::DOZE) != capabilities.end();
const bool isSuspendSupported = std::find(capabilities.begin(), capabilities.end(),
@@ -1097,14 +875,15 @@
}
for (auto mode : modes) {
- EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk());
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), mode).isOk());
}
}
TEST_P(GraphicsComposerAidlTest, SetPowerModeVariations) {
- std::vector<DisplayCapability> capabilities;
- const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities);
- ASSERT_TRUE(error.isOk());
+ const auto& [status, capabilities] =
+ mComposerClient->getDisplayCapabilities(getPrimaryDisplayId());
+ ASSERT_TRUE(status.isOk());
+
const bool isDozeSupported = std::find(capabilities.begin(), capabilities.end(),
DisplayCapability::DOZE) != capabilities.end();
const bool isSuspendSupported = std::find(capabilities.begin(), capabilities.end(),
@@ -1116,21 +895,21 @@
modes.push_back(PowerMode::ON);
modes.push_back(PowerMode::OFF);
for (auto mode : modes) {
- EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk());
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), mode).isOk());
}
modes.clear();
modes.push_back(PowerMode::OFF);
modes.push_back(PowerMode::OFF);
for (auto mode : modes) {
- EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk());
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), mode).isOk());
}
modes.clear();
modes.push_back(PowerMode::ON);
modes.push_back(PowerMode::ON);
for (auto mode : modes) {
- EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk());
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), mode).isOk());
}
modes.clear();
@@ -1138,7 +917,7 @@
modes.push_back(PowerMode::ON_SUSPEND);
modes.push_back(PowerMode::ON_SUSPEND);
for (auto mode : modes) {
- EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk());
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), mode).isOk());
}
modes.clear();
}
@@ -1147,7 +926,7 @@
modes.push_back(PowerMode::DOZE);
modes.push_back(PowerMode::DOZE);
for (auto mode : modes) {
- EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk());
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), mode).isOk());
}
modes.clear();
}
@@ -1156,46 +935,46 @@
modes.push_back(PowerMode::DOZE_SUSPEND);
modes.push_back(PowerMode::DOZE_SUSPEND);
for (auto mode : modes) {
- EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk());
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), mode).isOk());
}
modes.clear();
}
}
-TEST_P(GraphicsComposerAidlTest, SetPowerModeBadDisplay) {
- const auto error = mComposerClient->setPowerMode(mInvalidDisplayId, PowerMode::ON);
+TEST_P(GraphicsComposerAidlTest, SetPowerMode_BadDisplay) {
+ const auto& status = mComposerClient->setPowerMode(getInvalidDisplayId(), PowerMode::ON);
- EXPECT_FALSE(error.isOk());
- ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError());
}
-TEST_P(GraphicsComposerAidlTest, SetPowerModeBadParameter) {
- const auto error = mComposerClient->setPowerMode(mPrimaryDisplay, static_cast<PowerMode>(-1));
+TEST_P(GraphicsComposerAidlTest, SetPowerMode_BadParameter) {
+ const auto& status =
+ mComposerClient->setPowerMode(getPrimaryDisplayId(), static_cast<PowerMode>(-1));
- EXPECT_FALSE(error.isOk());
- ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError());
}
TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrix) {
- std::vector<float> matrix;
- EXPECT_TRUE(
- mComposerClient->getDataspaceSaturationMatrix(common::Dataspace::SRGB_LINEAR, &matrix)
- .isOk());
+ const auto& [status, matrix] =
+ mComposerClient->getDataspaceSaturationMatrix(common::Dataspace::SRGB_LINEAR);
+ ASSERT_TRUE(status.isOk());
+ ASSERT_EQ(16, matrix.size()); // matrix should not be empty if call succeeded.
// the last row is known
- ASSERT_EQ(0.0f, matrix[12]);
- ASSERT_EQ(0.0f, matrix[13]);
- ASSERT_EQ(0.0f, matrix[14]);
- ASSERT_EQ(1.0f, matrix[15]);
+ EXPECT_EQ(0.0f, matrix[12]);
+ EXPECT_EQ(0.0f, matrix[13]);
+ EXPECT_EQ(0.0f, matrix[14]);
+ EXPECT_EQ(1.0f, matrix[15]);
}
-TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrixBadParameter) {
- std::vector<float> matrix;
- const auto error =
- mComposerClient->getDataspaceSaturationMatrix(common::Dataspace::UNKNOWN, &matrix);
+TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrix_BadParameter) {
+ const auto& [status, matrix] =
+ mComposerClient->getDataspaceSaturationMatrix(common::Dataspace::UNKNOWN);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError());
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError());
}
// Tests for Command.
@@ -1204,8 +983,8 @@
void TearDown() override {
const auto errors = mReader.takeErrors();
ASSERT_TRUE(mReader.takeErrors().empty());
- ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty());
- ASSERT_TRUE(mReader.takeBufferAheadResultLayers(mPrimaryDisplay).empty());
+ ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
+ ASSERT_TRUE(mReader.takeBufferAheadResultLayers(getPrimaryDisplayId()).empty());
ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::TearDown());
}
@@ -1217,8 +996,7 @@
return;
}
- std::vector<CommandResultPayload> results;
- const auto status = mComposerClient->executeCommands(commands, &results);
+ auto [status, results] = mComposerClient->executeCommands(commands);
ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription();
mReader.parse(std::move(results));
@@ -1229,24 +1007,9 @@
return std::chrono::time_point<std::chrono::steady_clock>(std::chrono::nanoseconds(time));
}
- void setActiveConfig(VtsDisplay& display, int32_t config) {
- EXPECT_TRUE(mComposerClient->setActiveConfig(display.get(), config).isOk());
- int32_t displayWidth;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config, DisplayAttribute::WIDTH,
- &displayWidth)
- .isOk());
- int32_t displayHeight;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config, DisplayAttribute::HEIGHT,
- &displayHeight)
- .isOk());
- display.setDimensions(displayWidth, displayHeight);
- }
-
void forEachTwoConfigs(int64_t display, std::function<void(int32_t, int32_t)> func) {
- std::vector<int32_t> displayConfigs;
- EXPECT_TRUE(mComposerClient->getDisplayConfigs(display, &displayConfigs).isOk());
+ const auto& [status, displayConfigs] = mComposerClient->getDisplayConfigs(display);
+ ASSERT_TRUE(status.isOk());
for (const int32_t config1 : displayConfigs) {
for (const int32_t config2 : displayConfigs) {
if (config1 != config2) {
@@ -1261,8 +1024,9 @@
int64_t newPeriodNanos) {
const auto kChangeDeadline = toTimePoint(timeline.newVsyncAppliedTimeNanos) + 100ms;
while (std::chrono::steady_clock::now() <= kChangeDeadline) {
- int32_t vsyncPeriodNanos;
- EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display, &vsyncPeriodNanos).isOk());
+ const auto& [status, vsyncPeriodNanos] =
+ mComposerClient->getDisplayVsyncPeriod(display);
+ EXPECT_TRUE(status.isOk());
if (systemTime() <= desiredTimeNanos) {
EXPECT_EQ(vsyncPeriodNanos, oldPeriodNanos);
} else if (vsyncPeriodNanos == newPeriodNanos) {
@@ -1274,9 +1038,10 @@
sp<GraphicBuffer> allocate() {
return sp<GraphicBuffer>::make(
- static_cast<uint32_t>(mDisplayWidth), static_cast<uint32_t>(mDisplayHeight),
+ static_cast<uint32_t>(getPrimaryDisplay().getDisplayWidth()),
+ static_cast<uint32_t>(getPrimaryDisplay().getDisplayHeight()),
::android::PIXEL_FORMAT_RGBA_8888,
- /*layerCount*/ 1,
+ /*layerCount*/ 1U,
(static_cast<uint64_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
static_cast<uint64_t>(common::BufferUsage::COMPOSER_OVERLAY)),
@@ -1291,39 +1056,32 @@
std::this_thread::sleep_until(toTimePoint(timeline->refreshTimeNanos));
}
- EXPECT_TRUE(mComposerClient->setPowerMode(display.get(), PowerMode::ON).isOk());
- EXPECT_TRUE(
- mComposerClient
- ->setColorMode(display.get(), ColorMode::NATIVE, RenderIntent::COLORIMETRIC)
- .isOk());
+ EXPECT_TRUE(mComposerClient->setPowerMode(display.getDisplayId(), PowerMode::ON).isOk());
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(display.getDisplayId(), ColorMode::NATIVE,
+ RenderIntent::COLORIMETRIC)
+ .isOk());
- int64_t layer = 0;
- ASSERT_NO_FATAL_FAILURE(layer = createLayer(display));
+ const auto& [status, layer] =
+ mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(status.isOk());
{
const auto buffer = allocate();
ASSERT_NE(nullptr, buffer);
ASSERT_EQ(::android::OK, buffer->initCheck());
ASSERT_NE(nullptr, buffer->handle);
- mWriter.setLayerCompositionType(display.get(), layer, Composition::DEVICE);
- mWriter.setLayerDisplayFrame(display.get(), layer, display.getFrameRect());
- mWriter.setLayerPlaneAlpha(display.get(), layer, 1);
- mWriter.setLayerSourceCrop(display.get(), layer, display.getCrop());
- mWriter.setLayerTransform(display.get(), layer, static_cast<Transform>(0));
- mWriter.setLayerVisibleRegion(display.get(), layer,
- std::vector<Rect>(1, display.getFrameRect()));
- mWriter.setLayerZOrder(display.get(), layer, 10);
- mWriter.setLayerBlendMode(display.get(), layer, BlendMode::NONE);
- mWriter.setLayerSurfaceDamage(display.get(), layer,
- std::vector<Rect>(1, display.getFrameRect()));
- mWriter.setLayerBuffer(display.get(), layer, 0, buffer->handle, -1);
- mWriter.setLayerDataspace(display.get(), layer, common::Dataspace::UNKNOWN);
+ configureLayer(display, layer, Composition::DEVICE, display.getFrameRect(),
+ display.getCrop());
+ mWriter.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, buffer->handle,
+ /*acquireFence*/ -1);
+ mWriter.setLayerDataspace(display.getDisplayId(), layer, common::Dataspace::UNKNOWN);
- mWriter.validateDisplay(display.get(), ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(display.get());
+ mWriter.presentDisplay(display.getDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
}
@@ -1332,31 +1090,32 @@
const auto buffer = allocate();
ASSERT_NE(nullptr, buffer->handle);
- mWriter.setLayerBuffer(display.get(), layer, 0, buffer->handle, -1);
- mWriter.setLayerSurfaceDamage(display.get(), layer,
+ mWriter.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, buffer->handle,
+ /*acquireFence*/ -1);
+ mWriter.setLayerSurfaceDamage(display.getDisplayId(), layer,
std::vector<Rect>(1, {0, 0, 10, 10}));
- mWriter.validateDisplay(display.get(), ComposerClientWriter::kNoTimestamp);
+ mWriter.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(display.get());
+ mWriter.presentDisplay(display.getDisplayId());
execute();
}
- ASSERT_NO_FATAL_FAILURE(destroyLayer(display, layer));
+ EXPECT_TRUE(mComposerClient->destroyLayer(display.getDisplayId(), layer).isOk());
}
sp<::android::Fence> presentAndGetFence(
std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
- mWriter.validateDisplay(mPrimaryDisplay, expectedPresentTime);
+ mWriter.validateDisplay(getPrimaryDisplayId(), expectedPresentTime);
execute();
EXPECT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
EXPECT_TRUE(mReader.takeErrors().empty());
- auto presentFence = mReader.takePresentFence(mPrimaryDisplay);
+ auto presentFence = mReader.takePresentFence(getPrimaryDisplayId());
// take ownership
const int fenceOwner = presentFence.get();
*presentFence.getR() = -1;
@@ -1365,74 +1124,49 @@
}
int32_t getVsyncPeriod() {
- int32_t activeConfig;
- EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &activeConfig).isOk());
+ const auto& [status, activeConfig] =
+ mComposerClient->getActiveConfig(getPrimaryDisplayId());
+ EXPECT_TRUE(status.isOk());
- int32_t vsyncPeriod;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(mPrimaryDisplay, activeConfig,
- DisplayAttribute::VSYNC_PERIOD, &vsyncPeriod)
- .isOk());
+ const auto& [vsyncPeriodStatus, vsyncPeriod] = mComposerClient->getDisplayAttribute(
+ getPrimaryDisplayId(), activeConfig, DisplayAttribute::VSYNC_PERIOD);
+ EXPECT_TRUE(vsyncPeriodStatus.isOk());
return vsyncPeriod;
}
int64_t createOnScreenLayer() {
- const int64_t layer = createLayer(mDisplays[0]);
- mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::DEVICE);
- mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, {0, 0, mDisplayWidth, mDisplayHeight});
- mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1);
- mWriter.setLayerSourceCrop(
- mPrimaryDisplay, layer,
- {0, 0, static_cast<float>(mDisplayWidth), static_cast<float>(mDisplayHeight)});
- mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast<Transform>(0));
- mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer,
- std::vector<Rect>(1, {0, 0, mDisplayWidth, mDisplayHeight}));
- mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10);
- mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE);
- mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer,
- std::vector<Rect>(1, {0, 0, mDisplayWidth, mDisplayHeight}));
- mWriter.setLayerDataspace(mPrimaryDisplay, layer, common::Dataspace::UNKNOWN);
+ const auto& [status, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(status.isOk());
+ Rect displayFrame{0, 0, getPrimaryDisplay().getDisplayWidth(),
+ getPrimaryDisplay().getDisplayHeight()};
+ FRect cropRect{0, 0, (float)getPrimaryDisplay().getDisplayWidth(),
+ (float)getPrimaryDisplay().getDisplayHeight()};
+ configureLayer(getPrimaryDisplay(), layer, Composition::DEVICE, displayFrame, cropRect);
+ mWriter.setLayerDataspace(getPrimaryDisplayId(), layer, common::Dataspace::UNKNOWN);
return layer;
}
bool hasDisplayCapability(int64_t display, DisplayCapability cap) {
- std::vector<DisplayCapability> capabilities;
- const auto error = mComposerClient->getDisplayCapabilities(display, &capabilities);
- EXPECT_TRUE(error.isOk());
+ const auto& [status, capabilities] = mComposerClient->getDisplayCapabilities(display);
+ EXPECT_TRUE(status.isOk());
return std::find(capabilities.begin(), capabilities.end(), cap) != capabilities.end();
}
void Test_setActiveConfigWithConstraints(const TestParameters& params) {
for (VtsDisplay& display : mDisplays) {
- forEachTwoConfigs(display.get(), [&](int32_t config1, int32_t config2) {
- setActiveConfig(display, config1);
+ forEachTwoConfigs(display.getDisplayId(), [&](int32_t config1, int32_t config2) {
+ EXPECT_TRUE(mComposerClient->setActiveConfig(&display, config1).isOk());
sendRefreshFrame(display, nullptr);
- int32_t vsyncPeriod1;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config1,
- DisplayAttribute::VSYNC_PERIOD,
- &vsyncPeriod1)
- .isOk());
- int32_t configGroup1;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config1,
- DisplayAttribute::CONFIG_GROUP,
- &configGroup1)
- .isOk());
- int32_t vsyncPeriod2;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config2,
- DisplayAttribute::VSYNC_PERIOD,
- &vsyncPeriod2)
- .isOk());
- int32_t configGroup2;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config2,
- DisplayAttribute::CONFIG_GROUP,
- &configGroup2)
- .isOk());
+ const auto displayConfigGroup1 = display.getDisplayConfig(config1);
+ int32_t vsyncPeriod1 = displayConfigGroup1.vsyncPeriod;
+ int32_t configGroup1 = displayConfigGroup1.configGroup;
+
+ const auto displayConfigGroup2 = display.getDisplayConfig(config2);
+ int32_t vsyncPeriod2 = displayConfigGroup2.vsyncPeriod;
+ int32_t configGroup2 = displayConfigGroup2.configGroup;
if (vsyncPeriod1 == vsyncPeriod2) {
return; // continue
@@ -1443,12 +1177,12 @@
return; // continue
}
- VsyncPeriodChangeTimeline timeline;
VsyncPeriodChangeConstraints constraints = {
.desiredTimeNanos = systemTime() + params.delayForChange,
.seamlessRequired = false};
- EXPECT_TRUE(setActiveConfigWithConstraints(display, config2, constraints, &timeline)
- .isOk());
+ const auto& [status, timeline] = mComposerClient->setActiveConfigWithConstraints(
+ &display, config2, constraints);
+ EXPECT_TRUE(status.isOk());
EXPECT_TRUE(timeline.newVsyncAppliedTimeNanos >= constraints.desiredTimeNanos);
// Refresh rate should change within a reasonable time
@@ -1465,13 +1199,13 @@
}
sendRefreshFrame(display, &timeline);
}
- waitForVsyncPeriodChange(display.get(), timeline, constraints.desiredTimeNanos,
- vsyncPeriod1, vsyncPeriod2);
+ waitForVsyncPeriodChange(display.getDisplayId(), timeline,
+ constraints.desiredTimeNanos, vsyncPeriod1, vsyncPeriod2);
// At this point the refresh rate should have changed already, however in rare
// cases the implementation might have missed the deadline. In this case a new
// timeline should have been provided.
- auto newTimeline = mComposerCallback->takeLastVsyncPeriodChangeTimeline();
+ auto newTimeline = mComposerClient->takeLastVsyncPeriodChangeTimeline();
if (timeline.refreshRequired && params.refreshMiss) {
EXPECT_TRUE(newTimeline.has_value());
}
@@ -1480,14 +1214,14 @@
if (newTimeline->refreshRequired) {
sendRefreshFrame(display, &newTimeline.value());
}
- waitForVsyncPeriodChange(display.get(), newTimeline.value(),
+ waitForVsyncPeriodChange(display.getDisplayId(), newTimeline.value(),
constraints.desiredTimeNanos, vsyncPeriod1,
vsyncPeriod2);
}
- int32_t vsyncPeriodNanos;
- EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display.get(), &vsyncPeriodNanos)
- .isOk());
+ const auto& [vsyncPeriodNanosStatus, vsyncPeriodNanos] =
+ mComposerClient->getDisplayVsyncPeriod(display.getDisplayId());
+ EXPECT_TRUE(vsyncPeriodNanosStatus.isOk());
EXPECT_EQ(vsyncPeriodNanos, vsyncPeriod2);
});
}
@@ -1499,7 +1233,7 @@
return;
}
- ASSERT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk());
+ ASSERT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk());
const auto vsyncPeriod = getVsyncPeriod();
@@ -1509,7 +1243,8 @@
ASSERT_NE(nullptr, buffer2);
const auto layer = createOnScreenLayer();
- mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, buffer1->handle, -1);
+ mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, buffer1->handle,
+ /*acquireFence*/ -1);
const sp<::android::Fence> presentFence1 =
presentAndGetFence(ComposerClientWriter::kNoTimestamp);
presentFence1->waitForever(LOG_TAG);
@@ -1519,7 +1254,8 @@
expectedPresentTime += *framesDelay * vsyncPeriod;
}
- mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, buffer2->handle, -1);
+ mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, buffer2->handle,
+ /*acquireFence*/ -1);
const auto setExpectedPresentTime = [&]() -> std::optional<ClockMonotonicTimestamp> {
if (!framesDelay.has_value()) {
return ComposerClientWriter::kNoTimestamp;
@@ -1535,9 +1271,23 @@
const auto actualPresentTime = presentFence2->getSignalTime();
EXPECT_GE(actualPresentTime, expectedPresentTime - vsyncPeriod / 2);
- ASSERT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk());
+ ASSERT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk());
}
+ void configureLayer(const VtsDisplay& display, int64_t layer, Composition composition,
+ const Rect& displayFrame, const FRect& cropRect) {
+ mWriter.setLayerCompositionType(display.getDisplayId(), layer, composition);
+ mWriter.setLayerDisplayFrame(display.getDisplayId(), layer, displayFrame);
+ mWriter.setLayerPlaneAlpha(display.getDisplayId(), layer, /*alpha*/ 1);
+ mWriter.setLayerSourceCrop(display.getDisplayId(), layer, cropRect);
+ mWriter.setLayerTransform(display.getDisplayId(), layer, static_cast<Transform>(0));
+ mWriter.setLayerVisibleRegion(display.getDisplayId(), layer,
+ std::vector<Rect>(1, displayFrame));
+ mWriter.setLayerZOrder(display.getDisplayId(), layer, /*z*/ 10);
+ mWriter.setLayerBlendMode(display.getDisplayId(), layer, BlendMode::NONE);
+ mWriter.setLayerSurfaceDamage(display.getDisplayId(), layer,
+ std::vector<Rect>(1, displayFrame));
+ }
// clang-format off
const std::array<float, 16> kIdentity = {{
1.0f, 0.0f, 0.0f, 0.0f,
@@ -1551,15 +1301,16 @@
ComposerClientReader mReader;
};
-TEST_P(GraphicsComposerAidlCommandTest, SET_COLOR_TRANSFORM) {
- mWriter.setColorTransform(mPrimaryDisplay, kIdentity.data());
+TEST_P(GraphicsComposerAidlCommandTest, SetColorTransform) {
+ mWriter.setColorTransform(getPrimaryDisplayId(), kIdentity.data());
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerColorTransform) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter.setLayerColorTransform(mPrimaryDisplay, layer, kIdentity.data());
+ const auto& [status, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(status.isOk());
+ mWriter.setLayerColorTransform(getPrimaryDisplayId(), layer, kIdentity.data());
execute();
const auto errors = mReader.takeErrors();
@@ -1570,13 +1321,13 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) {
- std::vector<DisplayCapability> capabilities;
- auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities);
- ASSERT_TRUE(error.isOk());
+ const auto& [status, capabilities] =
+ mComposerClient->getDisplayCapabilities(getPrimaryDisplayId());
+ ASSERT_TRUE(status.isOk());
bool brightnessSupport = std::find(capabilities.begin(), capabilities.end(),
DisplayCapability::BRIGHTNESS) != capabilities.end();
if (!brightnessSupport) {
- mWriter.setDisplayBrightness(mPrimaryDisplay, 0.5f);
+ mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f);
execute();
const auto errors = mReader.takeErrors();
EXPECT_EQ(1, errors.size());
@@ -1585,23 +1336,23 @@
return;
}
- mWriter.setDisplayBrightness(mPrimaryDisplay, 0.0f);
+ mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.0f);
execute();
EXPECT_TRUE(mReader.takeErrors().empty());
- mWriter.setDisplayBrightness(mPrimaryDisplay, 0.5f);
+ mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f);
execute();
EXPECT_TRUE(mReader.takeErrors().empty());
- mWriter.setDisplayBrightness(mPrimaryDisplay, 1.0f);
+ mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.0f);
execute();
EXPECT_TRUE(mReader.takeErrors().empty());
- mWriter.setDisplayBrightness(mPrimaryDisplay, -1.0f);
+ mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -1.0f);
execute();
EXPECT_TRUE(mReader.takeErrors().empty());
- mWriter.setDisplayBrightness(mPrimaryDisplay, 2.0f);
+ mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 2.0f);
execute();
{
const auto errors = mReader.takeErrors();
@@ -1609,7 +1360,7 @@
EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode);
}
- mWriter.setDisplayBrightness(mPrimaryDisplay, -2.0f);
+ mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -2.0f);
execute();
{
const auto errors = mReader.takeErrors();
@@ -1618,51 +1369,49 @@
}
}
-TEST_P(GraphicsComposerAidlCommandTest, SET_CLIENT_TARGET) {
- EXPECT_TRUE(
- mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kBufferSlotCount).isOk());
+TEST_P(GraphicsComposerAidlCommandTest, SetClientTarget) {
+ EXPECT_TRUE(mComposerClient->setClientTargetSlotCount(getPrimaryDisplayId(), kBufferSlotCount)
+ .isOk());
- mWriter.setClientTarget(mPrimaryDisplay, 0, nullptr, -1, Dataspace::UNKNOWN,
- std::vector<Rect>());
+ mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, nullptr, /*acquireFence*/ -1,
+ Dataspace::UNKNOWN, std::vector<Rect>());
execute();
}
-TEST_P(GraphicsComposerAidlCommandTest, SET_OUTPUT_BUFFER) {
- int32_t virtualDisplayCount;
- EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&virtualDisplayCount).isOk());
+TEST_P(GraphicsComposerAidlCommandTest, SetOutputBuffer) {
+ const auto& [status, virtualDisplayCount] = mComposerClient->getMaxVirtualDisplayCount();
+ EXPECT_TRUE(status.isOk());
if (virtualDisplayCount == 0) {
GTEST_SUCCEED() << "no virtual display support";
return;
}
- VirtualDisplay display;
- EXPECT_TRUE(mComposerClient
- ->createVirtualDisplay(64, 64, common::PixelFormat::IMPLEMENTATION_DEFINED,
- kBufferSlotCount, &display)
- .isOk());
+ const auto& [displayStatus, display] = mComposerClient->createVirtualDisplay(
+ /*width*/ 64, /*height*/ 64, common::PixelFormat::IMPLEMENTATION_DEFINED,
+ kBufferSlotCount);
+ EXPECT_TRUE(displayStatus.isOk());
const auto buffer = allocate();
const auto handle = buffer->handle;
- mWriter.setOutputBuffer(display.display, 0, handle, -1);
+ mWriter.setOutputBuffer(display.display, /*slot*/ 0, handle, /*releaseFence*/ -1);
execute();
}
-TEST_P(GraphicsComposerAidlCommandTest, VALIDATE_DISPLAY) {
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+TEST_P(GraphicsComposerAidlCommandTest, ValidDisplay) {
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
}
-TEST_P(GraphicsComposerAidlCommandTest, ACCEPT_DISPLAY_CHANGES) {
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
- mWriter.acceptDisplayChanges(mPrimaryDisplay);
+TEST_P(GraphicsComposerAidlCommandTest, AcceptDisplayChanges) {
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter.acceptDisplayChanges(getPrimaryDisplayId());
execute();
}
-// TODO(b/208441745) fix the test failure
-TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY) {
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
- mWriter.presentDisplay(mPrimaryDisplay);
+TEST_P(GraphicsComposerAidlCommandTest, PresentDisplay) {
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
}
@@ -1673,236 +1422,237 @@
* additional call to validateDisplay when only the layer buffer handle and
* surface damage have been set
*/
-// TODO(b/208441745) fix the test failure
-TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) {
+TEST_P(GraphicsComposerAidlCommandTest, PresentDisplayNoLayerStateChanges) {
if (!hasCapability(Capability::SKIP_VALIDATE)) {
GTEST_SUCCEED() << "Device does not have skip validate capability, skipping";
return;
}
- mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON);
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk());
- std::vector<RenderIntent> renderIntents;
- mComposerClient->getRenderIntents(mPrimaryDisplay, ColorMode::NATIVE, &renderIntents);
+ const auto& [renderIntentsStatus, renderIntents] =
+ mComposerClient->getRenderIntents(getPrimaryDisplayId(), ColorMode::NATIVE);
+ EXPECT_TRUE(renderIntentsStatus.isOk());
for (auto intent : renderIntents) {
- mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE, intent);
+ EXPECT_TRUE(mComposerClient->setColorMode(getPrimaryDisplayId(), ColorMode::NATIVE, intent)
+ .isOk());
const auto buffer = allocate();
const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
- Rect displayFrame{0, 0, mDisplayWidth, mDisplayHeight};
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::DEVICE);
- mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, displayFrame);
- mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1);
- mWriter.setLayerSourceCrop(mPrimaryDisplay, layer,
- {0, 0, (float)mDisplayWidth, (float)mDisplayHeight});
- mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast<Transform>(0));
- mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector<Rect>(1, displayFrame));
- mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10);
- mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE);
- mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector<Rect>(1, displayFrame));
- mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle, -1);
- mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN);
-
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ Rect displayFrame{0, 0, getPrimaryDisplay().getDisplayWidth(),
+ getPrimaryDisplay().getDisplayHeight()};
+ FRect cropRect{0, 0, (float)getPrimaryDisplay().getDisplayWidth(),
+ (float)getPrimaryDisplay().getDisplayHeight()};
+ configureLayer(getPrimaryDisplay(), layer, Composition::CURSOR, displayFrame, cropRect);
+ mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle,
+ /*acquireFence*/ -1);
+ mWriter.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED() << "Composition change requested, skipping test";
return;
}
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
const auto buffer2 = allocate();
const auto handle2 = buffer2->handle;
ASSERT_NE(nullptr, handle2);
- mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle2, -1);
- mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector<Rect>(1, {0, 0, 10, 10}));
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle2,
+ /*acquireFence*/ -1);
+ mWriter.setLayerSurfaceDamage(getPrimaryDisplayId(), layer,
+ std::vector<Rect>(1, {0, 0, 10, 10}));
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
}
}
-// TODO(b/208441745) fix the test failure
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_CURSOR_POSITION) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerCursorPosition) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
const auto buffer = allocate();
const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
- Rect displayFrame{0, 0, mDisplayWidth, mDisplayHeight};
- mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle, -1);
- mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::CURSOR);
- mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, displayFrame);
- mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1);
- mWriter.setLayerSourceCrop(mPrimaryDisplay, layer,
- {0, 0, (float)mDisplayWidth, (float)mDisplayHeight});
- mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast<Transform>(0));
- mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector<Rect>(1, displayFrame));
- mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10);
- mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE);
- mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector<Rect>(1, displayFrame));
- mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN);
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, /*acquireFence*/ -1);
+
+ Rect displayFrame{0, 0, getPrimaryDisplay().getDisplayWidth(),
+ getPrimaryDisplay().getDisplayHeight()};
+ FRect cropRect{0, 0, (float)getPrimaryDisplay().getDisplayWidth(),
+ (float)getPrimaryDisplay().getDisplayHeight()};
+ configureLayer(getPrimaryDisplay(), layer, Composition::CURSOR, displayFrame, cropRect);
+ mWriter.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED() << "Composition change requested, skipping test";
return;
}
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.presentDisplay(getPrimaryDisplayId());
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerCursorPosition(mPrimaryDisplay, layer, 1, 1);
+ mWriter.setLayerCursorPosition(getPrimaryDisplayId(), layer, /*x*/ 1, /*y*/ 1);
execute();
- mWriter.setLayerCursorPosition(mPrimaryDisplay, layer, 0, 0);
- mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
- mWriter.presentDisplay(mPrimaryDisplay);
+ mWriter.setLayerCursorPosition(getPrimaryDisplayId(), layer, /*x*/ 0, /*y*/ 0);
+ mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter.presentDisplay(getPrimaryDisplayId());
execute();
}
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BUFFER) {
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerBuffer) {
const auto buffer = allocate();
const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle, -1);
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
+ mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, /*acquireFence*/ -1);
execute();
}
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SURFACE_DAMAGE) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerSurfaceDamage) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
Rect empty{0, 0, 0, 0};
Rect unit{0, 0, 1, 1};
- mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector<Rect>(1, empty));
+ mWriter.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, std::vector<Rect>(1, empty));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector<Rect>(1, unit));
+ mWriter.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, std::vector<Rect>(1, unit));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector<Rect>());
+ mWriter.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, std::vector<Rect>());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
}
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BLOCKING_REGION) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerBlockingRegion) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
Rect empty{0, 0, 0, 0};
Rect unit{0, 0, 1, 1};
- mWriter.setLayerBlockingRegion(mPrimaryDisplay, layer, std::vector<Rect>(1, empty));
+ mWriter.setLayerBlockingRegion(getPrimaryDisplayId(), layer, std::vector<Rect>(1, empty));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerBlockingRegion(mPrimaryDisplay, layer, std::vector<Rect>(1, unit));
+ mWriter.setLayerBlockingRegion(getPrimaryDisplayId(), layer, std::vector<Rect>(1, unit));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerBlockingRegion(mPrimaryDisplay, layer, std::vector<Rect>());
+ mWriter.setLayerBlockingRegion(getPrimaryDisplayId(), layer, std::vector<Rect>());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
}
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BLEND_MODE) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerBlendMode) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
- mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE);
+ mWriter.setLayerBlendMode(getPrimaryDisplayId(), layer, BlendMode::NONE);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::PREMULTIPLIED);
+ mWriter.setLayerBlendMode(getPrimaryDisplayId(), layer, BlendMode::PREMULTIPLIED);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::COVERAGE);
+ mWriter.setLayerBlendMode(getPrimaryDisplayId(), layer, BlendMode::COVERAGE);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
}
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_COLOR) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerColor) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
- mWriter.setLayerColor(mPrimaryDisplay, layer, Color{1.0f, 1.0f, 1.0f, 1.0f});
+ mWriter.setLayerColor(getPrimaryDisplayId(), layer, Color{1.0f, 1.0f, 1.0f, 1.0f});
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerColor(mPrimaryDisplay, layer, Color{0.0f, 0.0f, 0.0f, 0.0f});
+ mWriter.setLayerColor(getPrimaryDisplayId(), layer, Color{0.0f, 0.0f, 0.0f, 0.0f});
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
}
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_COMPOSITION_TYPE) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerCompositionType) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
- mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::CLIENT);
+ mWriter.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::CLIENT);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::DEVICE);
+ mWriter.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::DEVICE);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::SOLID_COLOR);
+ mWriter.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::SOLID_COLOR);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::CURSOR);
+ mWriter.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::CURSOR);
+ execute();
+}
+
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerDataspace) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
+
+ mWriter.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN);
+ execute();
+}
+
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerDisplayFrame) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
+
+ mWriter.setLayerDisplayFrame(getPrimaryDisplayId(), layer, Rect{0, 0, 1, 1});
+ execute();
+}
+
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerPlaneAlpha) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
+
+ mWriter.setLayerPlaneAlpha(getPrimaryDisplayId(), layer, /*alpha*/ 0.0f);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerPlaneAlpha(getPrimaryDisplayId(), layer, /*alpha*/ 1.0f);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
}
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_DATASPACE) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
-
- mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN);
- execute();
-}
-
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_DISPLAY_FRAME) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
-
- mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, Rect{0, 0, 1, 1});
- execute();
-}
-
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_PLANE_ALPHA) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
-
- mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 0.0f);
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1.0f);
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-}
-
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SIDEBAND_STREAM) {
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerSidebandStream) {
if (!hasCapability(Capability::SIDEBAND_STREAM)) {
GTEST_SUCCEED() << "no sideband stream support";
return;
@@ -1912,98 +1662,104 @@
const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
- mWriter.setLayerSidebandStream(mPrimaryDisplay, layer, handle);
+ mWriter.setLayerSidebandStream(getPrimaryDisplayId(), layer, handle);
execute();
}
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SOURCE_CROP) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerSourceCrop) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
- mWriter.setLayerSourceCrop(mPrimaryDisplay, layer, FRect{0.0f, 0.0f, 1.0f, 1.0f});
+ mWriter.setLayerSourceCrop(getPrimaryDisplayId(), layer, FRect{0.0f, 0.0f, 1.0f, 1.0f});
execute();
}
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_TRANSFORM) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerTransform) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
- mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast<Transform>(0));
+ mWriter.setLayerTransform(getPrimaryDisplayId(), layer, static_cast<Transform>(0));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::FLIP_H);
+ mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::FLIP_H);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::FLIP_V);
+ mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::FLIP_V);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::ROT_90);
+ mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::ROT_90);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::ROT_180);
+ mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::ROT_180);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::ROT_270);
+ mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::ROT_270);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerTransform(mPrimaryDisplay, layer,
+ mWriter.setLayerTransform(getPrimaryDisplayId(), layer,
static_cast<Transform>(static_cast<int>(Transform::FLIP_H) |
static_cast<int>(Transform::ROT_90)));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerTransform(mPrimaryDisplay, layer,
+ mWriter.setLayerTransform(getPrimaryDisplayId(), layer,
static_cast<Transform>(static_cast<int>(Transform::FLIP_V) |
static_cast<int>(Transform::ROT_90)));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
}
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_VISIBLE_REGION) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerVisibleRegion) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
Rect empty{0, 0, 0, 0};
Rect unit{0, 0, 1, 1};
- mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector<Rect>(1, empty));
+ mWriter.setLayerVisibleRegion(getPrimaryDisplayId(), layer, std::vector<Rect>(1, empty));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector<Rect>(1, unit));
+ mWriter.setLayerVisibleRegion(getPrimaryDisplayId(), layer, std::vector<Rect>(1, unit));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector<Rect>());
+ mWriter.setLayerVisibleRegion(getPrimaryDisplayId(), layer, std::vector<Rect>());
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
}
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_Z_ORDER) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerZOrder) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
- mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10);
+ mWriter.setLayerZOrder(getPrimaryDisplayId(), layer, /*z*/ 10);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerZOrder(mPrimaryDisplay, layer, 0);
+ mWriter.setLayerZOrder(getPrimaryDisplayId(), layer, /*z*/ 0);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
}
-TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_PER_FRAME_METADATA) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerPerFrameMetadata) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
/**
* DISPLAY_P3 is a color space that uses the DCI_P3 primaries,
@@ -2030,88 +1786,86 @@
aidlMetadata.push_back({PerFrameMetadataKey::MIN_LUMINANCE, 0.1f});
aidlMetadata.push_back({PerFrameMetadataKey::MAX_CONTENT_LIGHT_LEVEL, 78.0});
aidlMetadata.push_back({PerFrameMetadataKey::MAX_FRAME_AVERAGE_LIGHT_LEVEL, 62.0});
- mWriter.setLayerPerFrameMetadata(mPrimaryDisplay, layer, aidlMetadata);
+ mWriter.setLayerPerFrameMetadata(getPrimaryDisplayId(), layer, aidlMetadata);
execute();
const auto errors = mReader.takeErrors();
if (errors.size() == 1 && errors[0].errorCode == EX_UNSUPPORTED_OPERATION) {
GTEST_SUCCEED() << "SetLayerPerFrameMetadata is not supported";
- EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk());
+ EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk());
return;
}
- EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk());
+ EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk());
}
-TEST_P(GraphicsComposerAidlCommandTest, setLayerWhitePointNits) {
- int64_t layer;
- EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
+TEST_P(GraphicsComposerAidlCommandTest, SetLayerWhitePointNits) {
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ EXPECT_TRUE(layerStatus.isOk());
- mWriter.setLayerWhitePointNits(mPrimaryDisplay, layer, 200.f);
+ mWriter.setLayerWhitePointNits(getPrimaryDisplayId(), layer, /*whitePointNits*/ 200.f);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerWhitePointNits(mPrimaryDisplay, layer, 1000.f);
+ mWriter.setLayerWhitePointNits(getPrimaryDisplayId(), layer, /*whitePointNits*/ 1000.f);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerWhitePointNits(mPrimaryDisplay, layer, 0.f);
+ mWriter.setLayerWhitePointNits(getPrimaryDisplayId(), layer, /*whitePointNits*/ 0.f);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerWhitePointNits(mPrimaryDisplay, layer, -1.f);
+ mWriter.setLayerWhitePointNits(getPrimaryDisplayId(), layer, /*whitePointNits*/ -1.f);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
}
-TEST_P(GraphicsComposerAidlCommandTest, setActiveConfigWithConstraints) {
+TEST_P(GraphicsComposerAidlCommandTest, SetActiveConfigWithConstraints) {
Test_setActiveConfigWithConstraints({.delayForChange = 0, .refreshMiss = false});
}
-TEST_P(GraphicsComposerAidlCommandTest, setActiveConfigWithConstraints_Delayed) {
+TEST_P(GraphicsComposerAidlCommandTest, SetActiveConfigWithConstraints_Delayed) {
Test_setActiveConfigWithConstraints({.delayForChange = 300'000'000, // 300ms
.refreshMiss = false});
}
-TEST_P(GraphicsComposerAidlCommandTest, setActiveConfigWithConstraints_MissRefresh) {
+TEST_P(GraphicsComposerAidlCommandTest, SetActiveConfigWithConstraints_MissRefresh) {
Test_setActiveConfigWithConstraints({.delayForChange = 0, .refreshMiss = true});
}
-TEST_P(GraphicsComposerAidlCommandTest, getDisplayVsyncPeriod) {
+TEST_P(GraphicsComposerAidlCommandTest, GetDisplayVsyncPeriod) {
for (VtsDisplay& display : mDisplays) {
- std::vector<int32_t> configs;
- EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk());
- for (int32_t config : configs) {
- int32_t expectedVsyncPeriodNanos = -1;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config,
- DisplayAttribute::VSYNC_PERIOD,
- &expectedVsyncPeriodNanos)
- .isOk());
+ const auto& [status, configs] = mComposerClient->getDisplayConfigs(display.getDisplayId());
+ EXPECT_TRUE(status.isOk());
- VsyncPeriodChangeTimeline timeline;
+ for (int32_t config : configs) {
+ int32_t expectedVsyncPeriodNanos = display.getDisplayConfig(config).vsyncPeriod;
+
VsyncPeriodChangeConstraints constraints;
constraints.desiredTimeNanos = systemTime();
constraints.seamlessRequired = false;
- EXPECT_TRUE(mComposerClient
- ->setActiveConfigWithConstraints(display.get(), config, constraints,
- &timeline)
- .isOk());
+
+ const auto& [timelineStatus, timeline] =
+ mComposerClient->setActiveConfigWithConstraints(&display, config, constraints);
+ EXPECT_TRUE(timelineStatus.isOk());
if (timeline.refreshRequired) {
sendRefreshFrame(display, &timeline);
}
- waitForVsyncPeriodChange(display.get(), timeline, constraints.desiredTimeNanos, 0,
- expectedVsyncPeriodNanos);
+ waitForVsyncPeriodChange(display.getDisplayId(), timeline, constraints.desiredTimeNanos,
+ /*odPeriodNanos*/ 0, expectedVsyncPeriodNanos);
int32_t vsyncPeriodNanos;
int retryCount = 100;
do {
std::this_thread::sleep_for(10ms);
- vsyncPeriodNanos = 0;
- EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display.get(), &vsyncPeriodNanos)
- .isOk());
+ const auto& [vsyncPeriodNanosStatus, vsyncPeriodNanosValue] =
+ mComposerClient->getDisplayVsyncPeriod(display.getDisplayId());
+
+ EXPECT_TRUE(vsyncPeriodNanosStatus.isOk());
+ vsyncPeriodNanos = vsyncPeriodNanosValue;
--retryCount;
} while (vsyncPeriodNanos != expectedVsyncPeriodNanos && retryCount > 0);
@@ -2124,122 +1878,121 @@
std::this_thread::sleep_for(timeout);
timeout *= 2;
vsyncPeriodNanos = 0;
- EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display.get(), &vsyncPeriodNanos)
- .isOk());
+ const auto& [vsyncPeriodNanosStatus, vsyncPeriodNanosValue] =
+ mComposerClient->getDisplayVsyncPeriod(display.getDisplayId());
+
+ EXPECT_TRUE(vsyncPeriodNanosStatus.isOk());
+ vsyncPeriodNanos = vsyncPeriodNanosValue;
EXPECT_EQ(vsyncPeriodNanos, expectedVsyncPeriodNanos);
}
}
}
}
-TEST_P(GraphicsComposerAidlCommandTest, setActiveConfigWithConstraints_SeamlessNotAllowed) {
- VsyncPeriodChangeTimeline timeline;
+TEST_P(GraphicsComposerAidlCommandTest, SetActiveConfigWithConstraints_SeamlessNotAllowed) {
VsyncPeriodChangeConstraints constraints;
-
constraints.seamlessRequired = true;
constraints.desiredTimeNanos = systemTime();
for (VtsDisplay& display : mDisplays) {
- forEachTwoConfigs(display.get(), [&](int32_t config1, int32_t config2) {
- int32_t configGroup1;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config1,
- DisplayAttribute::CONFIG_GROUP, &configGroup1)
- .isOk());
- int32_t configGroup2;
- EXPECT_TRUE(mComposerClient
- ->getDisplayAttribute(display.get(), config2,
- DisplayAttribute::CONFIG_GROUP, &configGroup2)
- .isOk());
+ forEachTwoConfigs(display.getDisplayId(), [&](int32_t config1, int32_t config2) {
+ int32_t configGroup1 = display.getDisplayConfig(config1).configGroup;
+ int32_t configGroup2 = display.getDisplayConfig(config2).configGroup;
if (configGroup1 != configGroup2) {
- setActiveConfig(display, config1);
+ EXPECT_TRUE(mComposerClient->setActiveConfig(&display, config1).isOk());
sendRefreshFrame(display, nullptr);
+ const auto& [status, _] = mComposerClient->setActiveConfigWithConstraints(
+ &display, config2, constraints);
+ EXPECT_FALSE(status.isOk());
EXPECT_EQ(IComposerClient::EX_SEAMLESS_NOT_ALLOWED,
- setActiveConfigWithConstraints(display, config2, constraints, &timeline)
- .getServiceSpecificError());
+ status.getServiceSpecificError());
}
});
}
}
-TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_NoTimestamp) {
- ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(std::nullopt));
+TEST_P(GraphicsComposerAidlCommandTest, ExpectedPresentTime_NoTimestamp) {
+ ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(/*framesDelay*/ std::nullopt));
}
-TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_0) {
- ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(0));
+TEST_P(GraphicsComposerAidlCommandTest, ExpectedPresentTime_0) {
+ ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(/*framesDelay*/ 0));
}
-TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_5) {
- ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(5));
+TEST_P(GraphicsComposerAidlCommandTest, ExpectedPresentTime_5) {
+ ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(/*framesDelay*/ 5));
}
-TEST_P(GraphicsComposerAidlCommandTest, setIdleTimerEnabled_Unsupported) {
- const bool hasDisplayIdleTimerSupport = hasDisplayCapability(mPrimaryDisplay,
- DisplayCapability::DISPLAY_IDLE_TIMER);
+TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_Unsupported) {
+ const bool hasDisplayIdleTimerSupport =
+ hasDisplayCapability(getPrimaryDisplayId(), DisplayCapability::DISPLAY_IDLE_TIMER);
if (!hasDisplayIdleTimerSupport) {
- const auto error = mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, 0);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError());
+ const auto& status =
+ mComposerClient->setIdleTimerEnabled(getPrimaryDisplayId(), /*timeout*/ 0);
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError());
}
}
-TEST_P(GraphicsComposerAidlCommandTest, setIdleTimerEnabled_BadParameter) {
- const bool hasDisplayIdleTimerSupport = hasDisplayCapability(mPrimaryDisplay,
- DisplayCapability::DISPLAY_IDLE_TIMER);
+TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_BadParameter) {
+ const bool hasDisplayIdleTimerSupport =
+ hasDisplayCapability(getPrimaryDisplayId(), DisplayCapability::DISPLAY_IDLE_TIMER);
if (!hasDisplayIdleTimerSupport) {
GTEST_SUCCEED() << "DisplayCapability::DISPLAY_IDLE_TIMER is not supported";
return;
}
- const auto error = mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, -1);
- EXPECT_FALSE(error.isOk());
- EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError());
+ const auto& status =
+ mComposerClient->setIdleTimerEnabled(getPrimaryDisplayId(), /*timeout*/ -1);
+ EXPECT_FALSE(status.isOk());
+ EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError());
}
-TEST_P(GraphicsComposerAidlCommandTest, setIdleTimerEnabled_Disable) {
- const bool hasDisplayIdleTimerSupport = hasDisplayCapability(mPrimaryDisplay,
- DisplayCapability::DISPLAY_IDLE_TIMER);
+TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_Disable) {
+ const bool hasDisplayIdleTimerSupport =
+ hasDisplayCapability(getPrimaryDisplayId(), DisplayCapability::DISPLAY_IDLE_TIMER);
if (!hasDisplayIdleTimerSupport) {
GTEST_SUCCEED() << "DisplayCapability::DISPLAY_IDLE_TIMER is not supported";
return;
}
- EXPECT_TRUE(mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, 0).isOk());
+ EXPECT_TRUE(mComposerClient->setIdleTimerEnabled(getPrimaryDisplayId(), /*timeout*/ 0).isOk());
std::this_thread::sleep_for(1s);
- EXPECT_EQ(0, mComposerCallback->getVsyncIdleCount());
+ EXPECT_EQ(0, mComposerClient->getVsyncIdleCount());
}
-TEST_P(GraphicsComposerAidlCommandTest, setIdleTimerEnabled_Timeout_2) {
- const bool hasDisplayIdleTimerSupport = hasDisplayCapability(mPrimaryDisplay,
- DisplayCapability::DISPLAY_IDLE_TIMER);
+TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_Timeout_2) {
+ const bool hasDisplayIdleTimerSupport =
+ hasDisplayCapability(getPrimaryDisplayId(), DisplayCapability::DISPLAY_IDLE_TIMER);
if (!hasDisplayIdleTimerSupport) {
GTEST_SUCCEED() << "DisplayCapability::DISPLAY_IDLE_TIMER is not supported";
return;
}
- EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk());
- EXPECT_TRUE(mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, 0).isOk());
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk());
+ EXPECT_TRUE(mComposerClient->setIdleTimerEnabled(getPrimaryDisplayId(), /*timeout*/ 0).isOk());
const auto buffer = allocate();
ASSERT_NE(nullptr, buffer->handle);
const auto layer = createOnScreenLayer();
- mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, buffer->handle, -1);
- int32_t vsyncIdleCount = mComposerCallback->getVsyncIdleCount();
+ mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, buffer->handle,
+ /*acquireFence*/ -1);
+ int32_t vsyncIdleCount = mComposerClient->getVsyncIdleCount();
auto earlyVsyncIdleTime = systemTime() + std::chrono::nanoseconds(2s).count();
- EXPECT_TRUE(mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, 2000).isOk());
+ EXPECT_TRUE(
+ mComposerClient->setIdleTimerEnabled(getPrimaryDisplayId(), /*timeout*/ 2000).isOk());
const sp<::android::Fence> presentFence =
- presentAndGetFence(ComposerClientWriter::kNoTimestamp);
+ presentAndGetFence(ComposerClientWriter::kNoTimestamp);
presentFence->waitForever(LOG_TAG);
std::this_thread::sleep_for(3s);
- if (vsyncIdleCount < mComposerCallback->getVsyncIdleCount()) {
- EXPECT_GE(mComposerCallback->getVsyncIdleTime(), earlyVsyncIdleTime);
+ if (vsyncIdleCount < mComposerClient->getVsyncIdleCount()) {
+ EXPECT_GE(mComposerClient->getVsyncIdleTime(), earlyVsyncIdleTime);
}
- EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk());
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk());
}
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest);
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp
deleted file mode 100644
index df038db..0000000
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * Copyright (c) 2021, 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 {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "hardware_interfaces_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: ["hardware_interfaces_license"],
-}
-
-cc_library_static {
- name: "android.hardware.graphics.composer@3-vts",
- defaults: ["hidl_defaults"],
- srcs: [
- "GraphicsComposerCallback.cpp",
- "ReadbackVts.cpp",
- "RenderEngineVts.cpp",
- ],
- header_libs: [
- "android.hardware.graphics.composer3-command-buffer",
- ],
- static_libs: [
- "android.hardware.graphics.composer3-V1-ndk",
- "android.hardware.graphics.common-V3-ndk",
- "android.hardware.common-V2-ndk",
- "android.hardware.common.fmq-V1-ndk",
- "libarect",
- "libgtest",
- "libbase",
- "libfmq",
- "libsync",
- "libmath",
- "libaidlcommonsupport",
- "libnativewindow",
- "librenderengine",
- "libshaders",
- "libtonemap",
- "android.hardware.graphics.mapper@2.0-vts",
- "android.hardware.graphics.mapper@2.1-vts",
- "android.hardware.graphics.mapper@3.0-vts",
- "android.hardware.graphics.mapper@4.0-vts",
- ],
- shared_libs: [
- "libbinder_ndk",
- "libhidlbase",
- "libui",
- "android.hardware.graphics.composer3-V1-ndk",
- ],
- export_static_lib_headers: [
- "android.hardware.graphics.mapper@2.1-vts",
- "librenderengine",
- ],
- cflags: [
- "-O0",
- "-g",
- "-DLOG_TAG=\"ComposerVts\"",
- "-Wconversion",
- ],
- export_header_lib_headers: [
- "android.hardware.graphics.composer3-command-buffer",
- ],
- export_include_dirs: ["include"],
-}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp
index 587c523..1aca76f 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp
@@ -14,19 +14,12 @@
* limitations under the License.
*/
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wconversion"
-
#include "include/ReadbackVts.h"
#include <aidl/android/hardware/graphics/common/BufferUsage.h>
#include "include/RenderEngineVts.h"
#include "renderengine/ExternalTexture.h"
#include "renderengine/impl/ExternalTexture.h"
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic pop // ignored "-Wconversion
-
namespace aidl::android::hardware::graphics::composer3::vts {
const std::vector<ColorMode> ReadbackHelper::colorModes = {ColorMode::SRGB, ColorMode::DISPLAY_P3};
@@ -195,13 +188,12 @@
}
}
-ReadbackBuffer::ReadbackBuffer(int64_t display, const std::shared_ptr<IComposerClient>& client,
+ReadbackBuffer::ReadbackBuffer(int64_t display, const std::shared_ptr<VtsComposerClient>& client,
int32_t width, int32_t height, common::PixelFormat pixelFormat,
- common::Dataspace dataspace) {
+ common::Dataspace dataspace)
+ : mComposerClient(client) {
mDisplay = display;
- mComposerClient = client;
-
mPixelFormat = pixelFormat;
mDataspace = dataspace;
@@ -227,23 +219,22 @@
mGraphicBuffer = allocate();
ASSERT_NE(nullptr, mGraphicBuffer);
ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck());
- aidl::android::hardware::common::NativeHandle bufferHandle =
- ::android::dupToAidl(mGraphicBuffer->handle);
+ const auto& bufferHandle = mGraphicBuffer->handle;
::ndk::ScopedFileDescriptor fence = ::ndk::ScopedFileDescriptor(-1);
EXPECT_TRUE(mComposerClient->setReadbackBuffer(mDisplay, bufferHandle, fence).isOk());
}
-void ReadbackBuffer::checkReadbackBuffer(std::vector<Color> expectedColors) {
+void ReadbackBuffer::checkReadbackBuffer(const std::vector<Color>& expectedColors) {
ASSERT_NE(nullptr, mGraphicBuffer);
// lock buffer for reading
- ndk::ScopedFileDescriptor fenceHandle;
- EXPECT_TRUE(mComposerClient->getReadbackBufferFence(mDisplay, &fenceHandle).isOk());
+ const auto& [fenceStatus, bufferFence] = mComposerClient->getReadbackBufferFence(mDisplay);
+ EXPECT_TRUE(fenceStatus.isOk());
int bytesPerPixel = -1;
int bytesPerStride = -1;
void* bufData = nullptr;
- auto status = mGraphicBuffer->lockAsync(mUsage, mAccessRegion, &bufData, dup(fenceHandle.get()),
+ auto status = mGraphicBuffer->lockAsync(mUsage, mAccessRegion, &bufData, dup(bufferFence.get()),
&bytesPerPixel, &bytesPerStride);
EXPECT_EQ(::android::OK, status);
ASSERT_TRUE(mPixelFormat == PixelFormat::RGB_888 || mPixelFormat == PixelFormat::RGBA_8888);
@@ -270,7 +261,7 @@
return layerSettings;
}
-TestBufferLayer::TestBufferLayer(const std::shared_ptr<IComposerClient>& client,
+TestBufferLayer::TestBufferLayer(const std::shared_ptr<VtsComposerClient>& client,
const ::android::sp<::android::GraphicBuffer>& graphicBuffer,
TestRenderEngine& renderEngine, int64_t display, uint32_t width,
uint32_t height, common::PixelFormat format,
@@ -318,8 +309,8 @@
const float translateY = mSourceCrop.top / (static_cast<float>(mHeight));
layerSettings.source.buffer.textureTransform =
- ::android::mat4::translate(::android::vec4(translateX, translateY, 0, 1.0)) *
- ::android::mat4::scale(::android::vec4(scaleX, scaleY, 1.0, 1.0));
+ ::android::mat4::translate(::android::vec4(translateX, translateY, 0.0f, 1.0f)) *
+ ::android::mat4::scale(::android::vec4(scaleX, scaleY, 1.0f, 1.0f));
return layerSettings;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp
new file mode 100644
index 0000000..8c882d0
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp
@@ -0,0 +1,502 @@
+/**
+ * Copyright (c) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "include/VtsComposerClient.h"
+#include <aidlcommonsupport/NativeHandle.h>
+#include <android-base/logging.h>
+#include <log/log_main.h>
+
+#undef LOG_TAG
+#define LOG_TAG "VtsComposerClient"
+
+using namespace std::chrono_literals;
+
+namespace aidl::android::hardware::graphics::composer3::vts {
+
+VtsComposerClient::VtsComposerClient(const std::string& name) {
+ SpAIBinder binder(AServiceManager_waitForService(name.c_str()));
+ ALOGE_IF(binder == nullptr, "Could not initialize the service binder");
+ if (binder != nullptr) {
+ mComposer = IComposer::fromBinder(binder);
+ ALOGE_IF(mComposer == nullptr, "Failed to acquire the composer from the binder");
+ }
+}
+
+ScopedAStatus VtsComposerClient::createClient() {
+ if (mComposer == nullptr) {
+ ALOGE("IComposer not initialized");
+ return ScopedAStatus::fromServiceSpecificError(IComposerClient::INVALID_CONFIGURATION);
+ }
+ auto status = mComposer->createClient(&mComposerClient);
+ if (!status.isOk() || mComposerClient == nullptr) {
+ ALOGE("Failed to create client for IComposerClient with %s",
+ status.getDescription().c_str());
+ return status;
+ }
+ mComposerCallback = SharedRefBase::make<GraphicsComposerCallback>();
+ if (mComposerCallback == nullptr) {
+ ALOGE("Unable to create ComposerCallback");
+ return ScopedAStatus::fromServiceSpecificError(IComposerClient::INVALID_CONFIGURATION);
+ }
+ return mComposerClient->registerCallback(mComposerCallback);
+}
+
+bool VtsComposerClient::tearDown() {
+ return verifyComposerCallbackParams() && destroyAllLayers();
+}
+
+std::pair<ScopedAStatus, VirtualDisplay> VtsComposerClient::createVirtualDisplay(
+ int32_t width, int32_t height, PixelFormat pixelFormat, int32_t bufferSlotCount) {
+ VirtualDisplay outVirtualDisplay;
+ auto status = mComposerClient->createVirtualDisplay(width, height, pixelFormat, bufferSlotCount,
+ &outVirtualDisplay);
+ if (!status.isOk()) {
+ return {std::move(status), outVirtualDisplay};
+ }
+ return {addDisplayToDisplayResources(outVirtualDisplay.display, /*isVirtual*/ true),
+ outVirtualDisplay};
+}
+
+ScopedAStatus VtsComposerClient::destroyVirtualDisplay(int64_t display) {
+ auto status = mComposerClient->destroyVirtualDisplay(display);
+ if (!status.isOk()) {
+ return status;
+ }
+ mDisplayResources.erase(display);
+ return status;
+}
+
+std::pair<ScopedAStatus, int64_t> VtsComposerClient::createLayer(int64_t display,
+ int32_t bufferSlotCount) {
+ int64_t outLayer;
+ auto status = mComposerClient->createLayer(display, bufferSlotCount, &outLayer);
+
+ if (!status.isOk()) {
+ return {std::move(status), outLayer};
+ }
+ return {addLayerToDisplayResources(display, outLayer), outLayer};
+}
+
+ScopedAStatus VtsComposerClient::destroyLayer(int64_t display, int64_t layer) {
+ auto status = mComposerClient->destroyLayer(display, layer);
+
+ if (!status.isOk()) {
+ return status;
+ }
+ removeLayerFromDisplayResources(display, layer);
+ return status;
+}
+
+std::pair<ScopedAStatus, int32_t> VtsComposerClient::getActiveConfig(int64_t display) {
+ int32_t outConfig;
+ return {mComposerClient->getActiveConfig(display, &outConfig), outConfig};
+}
+
+ScopedAStatus VtsComposerClient::setActiveConfig(VtsDisplay* vtsDisplay, int32_t config) {
+ auto status = mComposerClient->setActiveConfig(vtsDisplay->getDisplayId(), config);
+ if (!status.isOk()) {
+ return status;
+ }
+ return updateDisplayProperties(vtsDisplay, config);
+}
+
+std::pair<ScopedAStatus, int32_t> VtsComposerClient::getDisplayAttribute(
+ int64_t display, int32_t config, DisplayAttribute displayAttribute) {
+ int32_t outDisplayAttribute;
+ return {mComposerClient->getDisplayAttribute(display, config, displayAttribute,
+ &outDisplayAttribute),
+ outDisplayAttribute};
+}
+
+ScopedAStatus VtsComposerClient::setPowerMode(int64_t display, PowerMode powerMode) {
+ return mComposerClient->setPowerMode(display, powerMode);
+}
+
+ScopedAStatus VtsComposerClient::setVsync(int64_t display, bool enable) {
+ return mComposerClient->setVsyncEnabled(display, enable);
+}
+
+void VtsComposerClient::setVsyncAllowed(bool isAllowed) {
+ mComposerCallback->setVsyncAllowed(isAllowed);
+}
+
+std::pair<ScopedAStatus, std::vector<float>> VtsComposerClient::getDataspaceSaturationMatrix(
+ Dataspace dataspace) {
+ std::vector<float> outMatrix;
+ return {mComposerClient->getDataspaceSaturationMatrix(dataspace, &outMatrix), outMatrix};
+}
+
+std::pair<ScopedAStatus, std::vector<CommandResultPayload>> VtsComposerClient::executeCommands(
+ const std::vector<DisplayCommand>& commands) {
+ std::vector<CommandResultPayload> outResultPayload;
+ return {mComposerClient->executeCommands(commands, &outResultPayload),
+ std::move(outResultPayload)};
+}
+
+std::optional<VsyncPeriodChangeTimeline> VtsComposerClient::takeLastVsyncPeriodChangeTimeline() {
+ return mComposerCallback->takeLastVsyncPeriodChangeTimeline();
+}
+
+ScopedAStatus VtsComposerClient::setContentType(int64_t display, ContentType contentType) {
+ return mComposerClient->setContentType(display, contentType);
+}
+
+std::pair<ScopedAStatus, VsyncPeriodChangeTimeline>
+VtsComposerClient::setActiveConfigWithConstraints(VtsDisplay* vtsDisplay, int32_t config,
+ const VsyncPeriodChangeConstraints& constraints) {
+ VsyncPeriodChangeTimeline outTimeline;
+ auto status = mComposerClient->setActiveConfigWithConstraints(
+ vtsDisplay->getDisplayId(), config, constraints, &outTimeline);
+ if (!status.isOk()) {
+ return {std::move(status), outTimeline};
+ }
+ return {updateDisplayProperties(vtsDisplay, config), outTimeline};
+}
+
+std::pair<ScopedAStatus, std::vector<DisplayCapability>> VtsComposerClient::getDisplayCapabilities(
+ int64_t display) {
+ std::vector<DisplayCapability> outCapabilities;
+ return {mComposerClient->getDisplayCapabilities(display, &outCapabilities), outCapabilities};
+}
+
+ScopedAStatus VtsComposerClient::dumpDebugInfo() {
+ std::string debugInfo;
+ return mComposer->dumpDebugInfo(&debugInfo);
+}
+
+std::pair<ScopedAStatus, DisplayIdentification> VtsComposerClient::getDisplayIdentificationData(
+ int64_t display) {
+ DisplayIdentification outDisplayIdentification;
+ return {mComposerClient->getDisplayIdentificationData(display, &outDisplayIdentification),
+ outDisplayIdentification};
+}
+
+std::pair<ScopedAStatus, HdrCapabilities> VtsComposerClient::getHdrCapabilities(int64_t display) {
+ HdrCapabilities outHdrCapabilities;
+ return {mComposerClient->getHdrCapabilities(display, &outHdrCapabilities), outHdrCapabilities};
+}
+
+std::pair<ScopedAStatus, std::vector<PerFrameMetadataKey>>
+VtsComposerClient::getPerFrameMetadataKeys(int64_t display) {
+ std::vector<PerFrameMetadataKey> outPerFrameMetadataKeys;
+ return {mComposerClient->getPerFrameMetadataKeys(display, &outPerFrameMetadataKeys),
+ outPerFrameMetadataKeys};
+}
+
+std::pair<ScopedAStatus, ReadbackBufferAttributes> VtsComposerClient::getReadbackBufferAttributes(
+ int64_t display) {
+ ReadbackBufferAttributes outReadbackBufferAttributes;
+ return {mComposerClient->getReadbackBufferAttributes(display, &outReadbackBufferAttributes),
+ outReadbackBufferAttributes};
+}
+
+ScopedAStatus VtsComposerClient::setReadbackBuffer(int64_t display, const native_handle_t* buffer,
+ const ScopedFileDescriptor& releaseFence) {
+ return mComposerClient->setReadbackBuffer(display, ::android::dupToAidl(buffer), releaseFence);
+}
+
+std::pair<ScopedAStatus, ScopedFileDescriptor> VtsComposerClient::getReadbackBufferFence(
+ int64_t display) {
+ ScopedFileDescriptor outReleaseFence;
+ return {mComposerClient->getReadbackBufferFence(display, &outReleaseFence),
+ std::move(outReleaseFence)};
+}
+
+std::pair<ScopedAStatus, std::vector<ColorMode>> VtsComposerClient::getColorModes(int64_t display) {
+ std::vector<ColorMode> outColorModes;
+ return {mComposerClient->getColorModes(display, &outColorModes), outColorModes};
+}
+
+std::pair<ScopedAStatus, std::vector<RenderIntent>> VtsComposerClient::getRenderIntents(
+ int64_t display, ColorMode colorMode) {
+ std::vector<RenderIntent> outRenderIntents;
+ return {mComposerClient->getRenderIntents(display, colorMode, &outRenderIntents),
+ outRenderIntents};
+}
+
+ScopedAStatus VtsComposerClient::setColorMode(int64_t display, ColorMode colorMode,
+ RenderIntent renderIntent) {
+ return mComposerClient->setColorMode(display, colorMode, renderIntent);
+}
+
+std::pair<ScopedAStatus, DisplayContentSamplingAttributes>
+VtsComposerClient::getDisplayedContentSamplingAttributes(int64_t display) {
+ DisplayContentSamplingAttributes outAttributes;
+ return {mComposerClient->getDisplayedContentSamplingAttributes(display, &outAttributes),
+ outAttributes};
+}
+
+ScopedAStatus VtsComposerClient::setDisplayedContentSamplingEnabled(
+ int64_t display, bool isEnabled, FormatColorComponent formatColorComponent,
+ int64_t maxFrames) {
+ return mComposerClient->setDisplayedContentSamplingEnabled(display, isEnabled,
+ formatColorComponent, maxFrames);
+}
+
+std::pair<ScopedAStatus, DisplayContentSample> VtsComposerClient::getDisplayedContentSample(
+ int64_t display, int64_t maxFrames, int64_t timestamp) {
+ DisplayContentSample outDisplayContentSample;
+ return {mComposerClient->getDisplayedContentSample(display, maxFrames, timestamp,
+ &outDisplayContentSample),
+ outDisplayContentSample};
+}
+
+std::pair<ScopedAStatus, DisplayConnectionType> VtsComposerClient::getDisplayConnectionType(
+ int64_t display) {
+ DisplayConnectionType outDisplayConnectionType;
+ return {mComposerClient->getDisplayConnectionType(display, &outDisplayConnectionType),
+ outDisplayConnectionType};
+}
+
+std::pair<ScopedAStatus, std::vector<int32_t>> VtsComposerClient::getDisplayConfigs(
+ int64_t display) {
+ std::vector<int32_t> outConfigs;
+ return {mComposerClient->getDisplayConfigs(display, &outConfigs), outConfigs};
+}
+
+std::pair<ScopedAStatus, int32_t> VtsComposerClient::getDisplayVsyncPeriod(int64_t display) {
+ int32_t outVsyncPeriodNanos;
+ return {mComposerClient->getDisplayVsyncPeriod(display, &outVsyncPeriodNanos),
+ outVsyncPeriodNanos};
+}
+
+ScopedAStatus VtsComposerClient::setAutoLowLatencyMode(int64_t display, bool isEnabled) {
+ return mComposerClient->setAutoLowLatencyMode(display, isEnabled);
+}
+
+std::pair<ScopedAStatus, std::vector<ContentType>> VtsComposerClient::getSupportedContentTypes(
+ int64_t display) {
+ std::vector<ContentType> outContentTypes;
+ return {mComposerClient->getSupportedContentTypes(display, &outContentTypes), outContentTypes};
+}
+
+std::pair<ScopedAStatus, int32_t> VtsComposerClient::getMaxVirtualDisplayCount() {
+ int32_t outMaxVirtualDisplayCount;
+ return {mComposerClient->getMaxVirtualDisplayCount(&outMaxVirtualDisplayCount),
+ outMaxVirtualDisplayCount};
+}
+
+std::pair<ScopedAStatus, std::string> VtsComposerClient::getDisplayName(int64_t display) {
+ std::string outDisplayName;
+ return {mComposerClient->getDisplayName(display, &outDisplayName), outDisplayName};
+}
+
+ScopedAStatus VtsComposerClient::setClientTargetSlotCount(int64_t display,
+ int32_t bufferSlotCount) {
+ return mComposerClient->setClientTargetSlotCount(display, bufferSlotCount);
+}
+
+std::pair<ScopedAStatus, std::vector<Capability>> VtsComposerClient::getCapabilities() {
+ std::vector<Capability> outCapabilities;
+ return {mComposer->getCapabilities(&outCapabilities), outCapabilities};
+}
+
+ScopedAStatus VtsComposerClient::setBootDisplayConfig(int64_t display, int32_t config) {
+ return mComposerClient->setBootDisplayConfig(display, config);
+}
+
+ScopedAStatus VtsComposerClient::clearBootDisplayConfig(int64_t display) {
+ return mComposerClient->clearBootDisplayConfig(display);
+}
+
+std::pair<ScopedAStatus, int32_t> VtsComposerClient::getPreferredBootDisplayConfig(
+ int64_t display) {
+ int32_t outConfig;
+ return {mComposerClient->getPreferredBootDisplayConfig(display, &outConfig), outConfig};
+}
+
+std::pair<ScopedAStatus, common::Transform> VtsComposerClient::getDisplayPhysicalOrientation(
+ int64_t display) {
+ common::Transform outDisplayOrientation;
+ return {mComposerClient->getDisplayPhysicalOrientation(display, &outDisplayOrientation),
+ outDisplayOrientation};
+}
+
+ScopedAStatus VtsComposerClient::setIdleTimerEnabled(int64_t display, int32_t timeoutMs) {
+ return mComposerClient->setIdleTimerEnabled(display, timeoutMs);
+}
+
+int32_t VtsComposerClient::getVsyncIdleCount() {
+ return mComposerCallback->getVsyncIdleCount();
+}
+
+int64_t VtsComposerClient::getVsyncIdleTime() {
+ return mComposerCallback->getVsyncIdleTime();
+}
+
+int64_t VtsComposerClient::getInvalidDisplayId() {
+ // returns an invalid display id (one that has not been registered to a
+ // display. Currently assuming that a device will never have close to
+ // std::numeric_limit<uint64_t>::max() displays registered while running tests
+ int64_t id = std::numeric_limits<int64_t>::max();
+ std::vector<int64_t> displays = mComposerCallback->getDisplays();
+ while (id > 0) {
+ if (std::none_of(displays.begin(), displays.end(),
+ [id](const auto& display) { return id == display; })) {
+ return id;
+ }
+ id--;
+ }
+
+ // Although 0 could be an invalid display, a return value of 0
+ // from getInvalidDisplayId means all other ids are in use, a condition which
+ // we are assuming a device will never have
+ EXPECT_NE(0, id);
+ return id;
+}
+
+std::pair<ScopedAStatus, std::vector<VtsDisplay>> VtsComposerClient::getDisplays() {
+ while (true) {
+ // Sleep for a small period of time to allow all built-in displays
+ // to post hotplug events
+ std::this_thread::sleep_for(5ms);
+ std::vector<int64_t> displays = mComposerCallback->getDisplays();
+ if (displays.empty()) {
+ continue;
+ }
+
+ std::vector<VtsDisplay> vtsDisplays;
+ vtsDisplays.reserve(displays.size());
+ for (int64_t display : displays) {
+ auto vtsDisplay = VtsDisplay{display};
+ auto configs = getDisplayConfigs(display);
+ if (!configs.first.isOk()) {
+ ALOGE("Unable to get the displays for test, failed to get the configs "
+ "for display %" PRId64,
+ display);
+ return {std::move(configs.first), vtsDisplays};
+ }
+ for (int config : configs.second) {
+ auto status = updateDisplayProperties(&vtsDisplay, config);
+ if (!status.isOk()) {
+ ALOGE("Unable to get the displays for test, failed to update the properties "
+ "for display %" PRId64,
+ display);
+ return {std::move(status), vtsDisplays};
+ }
+ }
+ vtsDisplays.emplace_back(vtsDisplay);
+ addDisplayToDisplayResources(display, /*isVirtual*/ false);
+ }
+
+ return {ScopedAStatus::ok(), vtsDisplays};
+ }
+}
+
+ScopedAStatus VtsComposerClient::updateDisplayProperties(VtsDisplay* vtsDisplay, int32_t config) {
+ const auto width =
+ getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::WIDTH);
+ const auto height =
+ getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::HEIGHT);
+ const auto vsyncPeriod =
+ getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::VSYNC_PERIOD);
+ const auto configGroup =
+ getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::CONFIG_GROUP);
+ if (width.first.isOk() && height.first.isOk() && vsyncPeriod.first.isOk() &&
+ configGroup.first.isOk()) {
+ vtsDisplay->setDimensions(width.second, height.second);
+ vtsDisplay->addDisplayConfig(config, {vsyncPeriod.second, configGroup.second});
+ return ScopedAStatus::ok();
+ }
+
+ LOG(ERROR) << "Failed to update display property for width: " << width.first.isOk()
+ << ", height: " << height.first.isOk() << ", vsync: " << vsyncPeriod.first.isOk()
+ << ", config: " << configGroup.first.isOk();
+ return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_CONFIG);
+}
+
+ScopedAStatus VtsComposerClient::addDisplayToDisplayResources(int64_t display, bool isVirtual) {
+ if (mDisplayResources.insert({display, DisplayResource(isVirtual)}).second) {
+ return ScopedAStatus::ok();
+ }
+
+ ALOGE("Duplicate display id %" PRId64, display);
+ return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_DISPLAY);
+}
+
+ScopedAStatus VtsComposerClient::addLayerToDisplayResources(int64_t display, int64_t layer) {
+ auto resource = mDisplayResources.find(display);
+ if (resource == mDisplayResources.end()) {
+ resource = mDisplayResources.insert({display, DisplayResource(false)}).first;
+ }
+
+ if (!resource->second.layers.insert(layer).second) {
+ ALOGE("Duplicate layer id %" PRId64, layer);
+ return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_LAYER);
+ }
+ return ScopedAStatus::ok();
+}
+
+void VtsComposerClient::removeLayerFromDisplayResources(int64_t display, int64_t layer) {
+ auto resource = mDisplayResources.find(display);
+ if (resource != mDisplayResources.end()) {
+ resource->second.layers.erase(layer);
+ }
+}
+
+bool VtsComposerClient::verifyComposerCallbackParams() {
+ bool isValid = true;
+ if (mComposerCallback != nullptr) {
+ if (mComposerCallback->getInvalidHotplugCount() != 0) {
+ ALOGE("Invalid hotplug count");
+ isValid = false;
+ }
+ if (mComposerCallback->getInvalidRefreshCount() != 0) {
+ ALOGE("Invalid refresh count");
+ isValid = false;
+ }
+ if (mComposerCallback->getInvalidVsyncCount() != 0) {
+ ALOGE("Invalid vsync count");
+ isValid = false;
+ }
+ if (mComposerCallback->getInvalidVsyncPeriodChangeCount() != 0) {
+ ALOGE("Invalid vsync period change count");
+ isValid = false;
+ }
+ if (mComposerCallback->getInvalidSeamlessPossibleCount() != 0) {
+ ALOGE("Invalid seamless possible count");
+ isValid = false;
+ }
+ }
+ return isValid;
+}
+
+bool VtsComposerClient::destroyAllLayers() {
+ for (const auto& it : mDisplayResources) {
+ const auto& [display, resource] = it;
+
+ for (auto layer : resource.layers) {
+ const auto status = destroyLayer(display, layer);
+ if (!status.isOk()) {
+ ALOGE("Unable to destroy all the layers, failed at layer %" PRId64 " with error %s",
+ layer, status.getDescription().c_str());
+ return false;
+ }
+ }
+
+ if (resource.isVirtual) {
+ const auto status = destroyVirtualDisplay(display);
+ if (!status.isOk()) {
+ ALOGE("Unable to destroy the display %" PRId64 " failed with error %s", display,
+ status.getDescription().c_str());
+ return false;
+ }
+ }
+ }
+ mDisplayResources.clear();
+ return true;
+}
+} // namespace aidl::android::hardware::graphics::composer3::vts
\ No newline at end of file
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h
index f25f36d..ced1020 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h
@@ -15,18 +15,11 @@
*/
#pragma once
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wconversion"
-
#include <aidl/android/hardware/graphics/composer3/BnComposerCallback.h>
#include <android-base/thread_annotations.h>
#include <mutex>
#include <unordered_set>
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic pop // ignored "-Wconversion
-
namespace aidl::android::hardware::graphics::composer3::vts {
class GraphicsComposerCallback : public BnComposerCallback {
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h
index a3ce795..7135dca 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h
@@ -16,11 +16,6 @@
#pragma once
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wconversion"
-
-#include <GraphicsComposerCallback.h>
#include <aidl/android/hardware/graphics/composer3/IComposerClient.h>
#include <android-base/unique_fd.h>
#include <android/hardware/graphics/composer3/ComposerClientReader.h>
@@ -28,11 +23,9 @@
#include <mapper-vts/2.1/MapperVts.h>
#include <renderengine/RenderEngine.h>
#include <ui/GraphicBuffer.h>
-
#include <memory>
-
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic pop // ignored "-Wconversion
+#include "GraphicsComposerCallback.h"
+#include "VtsComposerClient.h"
namespace aidl::android::hardware::graphics::composer3::vts {
@@ -56,9 +49,11 @@
class TestLayer {
public:
- TestLayer(const std::shared_ptr<IComposerClient>& client, int64_t display)
- : mDisplay(display), mComposerClient(client) {
- client->createLayer(display, kBufferSlotCount, &mLayer);
+ TestLayer(const std::shared_ptr<VtsComposerClient>& client, int64_t display)
+ : mDisplay(display) {
+ const auto& [status, layer] = client->createLayer(display, kBufferSlotCount);
+ EXPECT_TRUE(status.isOk());
+ mLayer = layer;
}
// ComposerClient will take care of destroying layers, no need to explicitly
@@ -103,14 +98,11 @@
float mAlpha = 1.0;
BlendMode mBlendMode = BlendMode::NONE;
uint32_t mZOrder = 0;
-
- private:
- std::shared_ptr<IComposerClient> const mComposerClient;
};
class TestColorLayer : public TestLayer {
public:
- TestColorLayer(const std::shared_ptr<IComposerClient>& client, int64_t display)
+ TestColorLayer(const std::shared_ptr<VtsComposerClient>& client, int64_t display)
: TestLayer{client, display} {}
void write(ComposerClientWriter& writer) override;
@@ -125,7 +117,7 @@
class TestBufferLayer : public TestLayer {
public:
- TestBufferLayer(const std::shared_ptr<IComposerClient>& client,
+ TestBufferLayer(const std::shared_ptr<VtsComposerClient>& client,
const ::android::sp<::android::GraphicBuffer>& graphicBuffer,
TestRenderEngine& renderEngine, int64_t display, uint32_t width,
uint32_t height, common::PixelFormat format,
@@ -195,12 +187,12 @@
class ReadbackBuffer {
public:
- ReadbackBuffer(int64_t display, const std::shared_ptr<IComposerClient>& client, int32_t width,
+ ReadbackBuffer(int64_t display, const std::shared_ptr<VtsComposerClient>& client, int32_t width,
int32_t height, common::PixelFormat pixelFormat, common::Dataspace dataspace);
void setReadbackBuffer();
- void checkReadbackBuffer(std::vector<Color> expectedColors);
+ void checkReadbackBuffer(const std::vector<Color>& expectedColors);
::android::sp<::android::GraphicBuffer> allocate();
@@ -213,7 +205,7 @@
Dataspace mDataspace;
int64_t mDisplay;
::android::sp<::android::GraphicBuffer> mGraphicBuffer;
- std::shared_ptr<IComposerClient> mComposerClient;
+ std::shared_ptr<VtsComposerClient> mComposerClient;
::android::Rect mAccessRegion;
native_handle_t mBufferHandle;
};
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h
index a776a27..43d3a42 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h
@@ -15,11 +15,6 @@
*/
#pragma once
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wconversion"
-
-#include <ReadbackVts.h>
#include <mapper-vts/2.1/MapperVts.h>
#include <math/half.h>
#include <math/vec3.h>
@@ -30,9 +25,7 @@
#include <ui/PixelFormat.h>
#include <ui/Rect.h>
#include <ui/Region.h>
-
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic pop // ignored "-Wconversion
+#include "ReadbackVts.h"
namespace aidl::android::hardware::graphics::composer3::vts {
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h
new file mode 100644
index 0000000..b53edf8
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h
@@ -0,0 +1,240 @@
+/**
+ * Copyright (c) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include <aidl/android/hardware/graphics/common/BlendMode.h>
+#include <aidl/android/hardware/graphics/common/BufferUsage.h>
+#include <aidl/android/hardware/graphics/common/FRect.h>
+#include <aidl/android/hardware/graphics/common/Rect.h>
+#include <aidl/android/hardware/graphics/composer3/Composition.h>
+#include <aidl/android/hardware/graphics/composer3/IComposer.h>
+#include <android-base/properties.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <android/hardware/graphics/composer3/ComposerClientReader.h>
+#include <binder/ProcessState.h>
+#include <gtest/gtest.h>
+#include <ui/Fence.h>
+#include <ui/GraphicBuffer.h>
+#include <ui/PixelFormat.h>
+#include <algorithm>
+#include <numeric>
+#include <string>
+#include <thread>
+#include <unordered_map>
+#include "GraphicsComposerCallback.h"
+
+using aidl::android::hardware::graphics::common::Dataspace;
+using aidl::android::hardware::graphics::common::FRect;
+using aidl::android::hardware::graphics::common::PixelFormat;
+using aidl::android::hardware::graphics::common::Rect;
+using namespace ::ndk;
+
+namespace aidl::android::hardware::graphics::composer3::vts {
+
+class VtsDisplay;
+/**
+ * A wrapper to IComposerClient.
+ * This wrapper manages the IComposerClient instance and manages the resources for
+ * the tests with respect to the IComposerClient calls.
+ */
+class VtsComposerClient {
+ public:
+ VtsComposerClient(const std::string& name);
+
+ ScopedAStatus createClient();
+
+ bool tearDown();
+
+ std::pair<ScopedAStatus, VirtualDisplay> createVirtualDisplay(int32_t width, int32_t height,
+ PixelFormat pixelFormat,
+ int32_t bufferSlotCount);
+
+ ScopedAStatus destroyVirtualDisplay(int64_t display);
+
+ std::pair<ScopedAStatus, int64_t> createLayer(int64_t display, int32_t bufferSlotCount);
+
+ ScopedAStatus destroyLayer(int64_t display, int64_t layer);
+
+ std::pair<ScopedAStatus, int32_t> getActiveConfig(int64_t display);
+
+ ScopedAStatus setActiveConfig(VtsDisplay* vtsDisplay, int32_t config);
+
+ std::pair<ScopedAStatus, int32_t> getDisplayAttribute(int64_t display, int32_t config,
+ DisplayAttribute displayAttribute);
+
+ ScopedAStatus setPowerMode(int64_t display, PowerMode powerMode);
+
+ ScopedAStatus setVsync(int64_t display, bool enable);
+
+ void setVsyncAllowed(bool isAllowed);
+
+ std::pair<ScopedAStatus, std::vector<float>> getDataspaceSaturationMatrix(Dataspace dataspace);
+
+ std::pair<ScopedAStatus, std::vector<CommandResultPayload>> executeCommands(
+ const std::vector<DisplayCommand>& commands);
+
+ std::optional<VsyncPeriodChangeTimeline> takeLastVsyncPeriodChangeTimeline();
+
+ ScopedAStatus setContentType(int64_t display, ContentType contentType);
+
+ std::pair<ScopedAStatus, VsyncPeriodChangeTimeline> setActiveConfigWithConstraints(
+ VtsDisplay* vtsDisplay, int32_t config,
+ const VsyncPeriodChangeConstraints& constraints);
+
+ std::pair<ScopedAStatus, std::vector<DisplayCapability>> getDisplayCapabilities(
+ int64_t display);
+
+ ScopedAStatus dumpDebugInfo();
+
+ std::pair<ScopedAStatus, DisplayIdentification> getDisplayIdentificationData(int64_t display);
+
+ std::pair<ScopedAStatus, HdrCapabilities> getHdrCapabilities(int64_t display);
+
+ std::pair<ScopedAStatus, std::vector<PerFrameMetadataKey>> getPerFrameMetadataKeys(
+ int64_t display);
+
+ std::pair<ScopedAStatus, ReadbackBufferAttributes> getReadbackBufferAttributes(int64_t display);
+
+ ScopedAStatus setReadbackBuffer(int64_t display, const native_handle_t* buffer,
+ const ScopedFileDescriptor& releaseFence);
+
+ std::pair<ScopedAStatus, ScopedFileDescriptor> getReadbackBufferFence(int64_t display);
+
+ std::pair<ScopedAStatus, std::vector<ColorMode>> getColorModes(int64_t display);
+
+ std::pair<ScopedAStatus, std::vector<RenderIntent>> getRenderIntents(int64_t display,
+ ColorMode colorMode);
+
+ ScopedAStatus setColorMode(int64_t display, ColorMode colorMode, RenderIntent renderIntent);
+
+ std::pair<ScopedAStatus, DisplayContentSamplingAttributes>
+ getDisplayedContentSamplingAttributes(int64_t display);
+
+ ScopedAStatus setDisplayedContentSamplingEnabled(int64_t display, bool isEnabled,
+ FormatColorComponent formatColorComponent,
+ int64_t maxFrames);
+
+ std::pair<ScopedAStatus, DisplayContentSample> getDisplayedContentSample(int64_t display,
+ int64_t maxFrames,
+ int64_t timestamp);
+
+ std::pair<ScopedAStatus, DisplayConnectionType> getDisplayConnectionType(int64_t display);
+
+ std::pair<ScopedAStatus, std::vector<int32_t>> getDisplayConfigs(int64_t display);
+
+ std::pair<ScopedAStatus, int32_t> getDisplayVsyncPeriod(int64_t display);
+
+ ScopedAStatus setAutoLowLatencyMode(int64_t display, bool isEnabled);
+
+ std::pair<ScopedAStatus, std::vector<ContentType>> getSupportedContentTypes(int64_t display);
+
+ std::pair<ScopedAStatus, int32_t> getMaxVirtualDisplayCount();
+
+ std::pair<ScopedAStatus, std::string> getDisplayName(int64_t display);
+
+ ScopedAStatus setClientTargetSlotCount(int64_t display, int32_t bufferSlotCount);
+
+ std::pair<ScopedAStatus, std::vector<Capability>> getCapabilities();
+
+ ScopedAStatus setBootDisplayConfig(int64_t display, int32_t config);
+
+ ScopedAStatus clearBootDisplayConfig(int64_t display);
+
+ std::pair<ScopedAStatus, int32_t> getPreferredBootDisplayConfig(int64_t display);
+
+ std::pair<ScopedAStatus, common::Transform> getDisplayPhysicalOrientation(int64_t display);
+
+ ScopedAStatus setIdleTimerEnabled(int64_t display, int32_t timeoutMs);
+
+ int32_t getVsyncIdleCount();
+
+ int64_t getVsyncIdleTime();
+
+ int64_t getInvalidDisplayId();
+
+ std::pair<ScopedAStatus, std::vector<VtsDisplay>> getDisplays();
+
+ private:
+ ScopedAStatus updateDisplayProperties(VtsDisplay* vtsDisplay, int32_t config);
+
+ ScopedAStatus addDisplayToDisplayResources(int64_t display, bool isVirtual);
+
+ ScopedAStatus addLayerToDisplayResources(int64_t display, int64_t layer);
+
+ void removeLayerFromDisplayResources(int64_t display, int64_t layer);
+
+ bool destroyAllLayers();
+
+ bool verifyComposerCallbackParams();
+
+ // Keep track of displays and layers. When a test fails/ends,
+ // the VtsComposerClient::tearDown should be called from the
+ // test tearDown to clean up the resources for the test.
+ struct DisplayResource {
+ DisplayResource(bool isVirtual_) : isVirtual(isVirtual_) {}
+
+ bool isVirtual;
+ std::unordered_set<int64_t> layers;
+ };
+
+ std::shared_ptr<IComposer> mComposer;
+ std::shared_ptr<IComposerClient> mComposerClient;
+ std::shared_ptr<GraphicsComposerCallback> mComposerCallback;
+ std::unordered_map<int64_t, DisplayResource> mDisplayResources;
+};
+
+class VtsDisplay {
+ public:
+ VtsDisplay(int64_t displayId) : mDisplayId(displayId) {}
+
+ int64_t getDisplayId() const { return mDisplayId; }
+
+ FRect getCrop() const {
+ return {0, 0, static_cast<float>(mDisplayWidth), static_cast<float>(mDisplayHeight)};
+ }
+
+ Rect getFrameRect() const { return {0, 0, mDisplayWidth, mDisplayHeight}; }
+
+ void setDimensions(int32_t displayWidth, int32_t displayHeight) {
+ mDisplayWidth = displayWidth;
+ mDisplayHeight = displayHeight;
+ }
+
+ int32_t getDisplayWidth() const { return mDisplayWidth; }
+
+ int32_t getDisplayHeight() const { return mDisplayHeight; }
+
+ struct DisplayConfig {
+ DisplayConfig(int32_t vsyncPeriod_, int32_t configGroup_)
+ : vsyncPeriod(vsyncPeriod_), configGroup(configGroup_) {}
+ int32_t vsyncPeriod;
+ int32_t configGroup;
+ };
+
+ void addDisplayConfig(int32_t config, DisplayConfig displayConfig) {
+ displayConfigs.insert({config, displayConfig});
+ }
+
+ DisplayConfig getDisplayConfig(int32_t config) { return displayConfigs.find(config)->second; }
+
+ private:
+ int64_t mDisplayId;
+ int32_t mDisplayWidth;
+ int32_t mDisplayHeight;
+ std::unordered_map<int32_t, DisplayConfig> displayConfigs;
+};
+} // namespace aidl::android::hardware::graphics::composer3::vts
\ No newline at end of file
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
index d429b76..02405ba 100644
--- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
+++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
@@ -194,7 +194,7 @@
void setLayerZOrder(int64_t display, int64_t layer, uint32_t z) {
ZOrder zorder;
- zorder.z = z;
+ zorder.z = static_cast<int32_t>(z);
getLayerCommand(display, layer).z.emplace(std::move(zorder));
}
@@ -233,9 +233,9 @@
std::optional<LayerCommand> mLayerCommand;
std::vector<DisplayCommand> mCommands;
- Buffer getBuffer(int slot, const native_handle_t* bufferHandle, int fence) {
+ Buffer getBuffer(uint32_t slot, const native_handle_t* bufferHandle, int fence) {
Buffer bufferCommand;
- bufferCommand.slot = slot;
+ bufferCommand.slot = static_cast<int32_t>(slot);
if (bufferHandle) bufferCommand.handle.emplace(::android::dupToAidl(bufferHandle));
if (fence > 0) bufferCommand.fence = ::ndk::ScopedFileDescriptor(fence);
return bufferCommand;
diff --git a/identity/aidl/android/hardware/identity/IIdentityCredential.aidl b/identity/aidl/android/hardware/identity/IIdentityCredential.aidl
index 84d6ed0..82b0a83 100644
--- a/identity/aidl/android/hardware/identity/IIdentityCredential.aidl
+++ b/identity/aidl/android/hardware/identity/IIdentityCredential.aidl
@@ -438,8 +438,9 @@
* If the method is called on an instance obtained via IPresentationSession.getCredential(),
* STATUS_FAILED must be returned.
*
- * @param challenge a challenge set by the issuer to ensure freshness. Maximum size is 32 bytes
- * and it may be empty. Fails with STATUS_INVALID_DATA if bigger than 32 bytes.
+ * @param challenge a challenge set by the issuer to ensure freshness. Implementations must
+ * support challenges that are at least 32 bytes. Fails with STATUS_INVALID_DATA if bigger
+ * than 32 bytes.
* @return a COSE_Sign1 signature described above.
*/
byte[] deleteCredentialWithChallenge(in byte[] challenge);
@@ -463,8 +464,9 @@
* If the method is called on an instance obtained via IPresentationSession.getCredential(),
* STATUS_FAILED must be returned.
*
- * @param challenge a challenge set by the issuer to ensure freshness. Maximum size is 32 bytes
- * and it may be empty. Fails with STATUS_INVALID_DATA if bigger than 32 bytes.
+ * @param challenge a challenge set by the issuer to ensure freshness. Implementations must
+ * support challenges that are at least 32 bytes. Fails with STATUS_INVALID_DATA if bigger
+ * than 32 bytes.
* @return a COSE_Sign1 signature described above.
*/
byte[] proveOwnership(in byte[] challenge);
diff --git a/identity/aidl/android/hardware/identity/IWritableIdentityCredential.aidl b/identity/aidl/android/hardware/identity/IWritableIdentityCredential.aidl
index 756b008..1c80cbb 100644
--- a/identity/aidl/android/hardware/identity/IWritableIdentityCredential.aidl
+++ b/identity/aidl/android/hardware/identity/IWritableIdentityCredential.aidl
@@ -127,7 +127,8 @@
* https://developer.android.com/training/articles/security-key-attestation#certificate_schema_attestationid
*
* @param attestationChallenge a challenge set by the issuer to ensure freshness. If
- * this is empty, the call fails with STATUS_INVALID_DATA.
+ * this is empty, the call fails with STATUS_INVALID_DATA. Implementations must
+ * support challenges of at least 32 bytes.
*
* @return the X.509 certificate chain for the credentialKey
*/
diff --git a/identity/aidl/vts/Android.bp b/identity/aidl/vts/Android.bp
index c5b84a1..20faeee 100644
--- a/identity/aidl/vts/Android.bp
+++ b/identity/aidl/vts/Android.bp
@@ -58,3 +58,16 @@
"vts",
],
}
+
+java_test_host {
+ name: "IdentityCredentialImplementedTest",
+ libs: [
+ "tradefed",
+ "vts-core-tradefed-harness",
+ ],
+ srcs: ["src/**/*.java"],
+ test_suites: [
+ "vts",
+ ],
+ test_config: "IdentityCredentialImplementedTest.xml",
+}
diff --git a/identity/aidl/vts/DeleteCredentialTests.cpp b/identity/aidl/vts/DeleteCredentialTests.cpp
index 7627c9c..a126463 100644
--- a/identity/aidl/vts/DeleteCredentialTests.cpp
+++ b/identity/aidl/vts/DeleteCredentialTests.cpp
@@ -146,7 +146,9 @@
credentialData_, &credential)
.isOk());
- vector<uint8_t> challenge = {65, 66, 67};
+ // Implementations must support at least 32 bytes.
+ string challengeString = "0123456789abcdef0123456789abcdef";
+ vector<uint8_t> challenge(challengeString.begin(), challengeString.end());
vector<uint8_t> proofOfDeletionSignature;
ASSERT_TRUE(
credential->deleteCredentialWithChallenge(challenge, &proofOfDeletionSignature).isOk());
@@ -154,8 +156,13 @@
support::coseSignGetPayload(proofOfDeletionSignature);
ASSERT_TRUE(proofOfDeletion);
string cborPretty = cppbor::prettyPrint(proofOfDeletion.value(), 32, {});
- EXPECT_EQ("['ProofOfDeletion', 'org.iso.18013-5.2019.mdl', {0x41, 0x42, 0x43}, true, ]",
- cborPretty);
+ EXPECT_EQ(
+ "['ProofOfDeletion', 'org.iso.18013-5.2019.mdl', {"
+ "0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, "
+ "0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, "
+ "0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, "
+ "0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66}, true, ]",
+ cborPretty);
EXPECT_TRUE(support::coseCheckEcDsaSignature(proofOfDeletionSignature, {}, // Additional data
credentialPubKey_));
}
diff --git a/identity/aidl/vts/IdentityCredentialImplementedTest.xml b/identity/aidl/vts/IdentityCredentialImplementedTest.xml
new file mode 100644
index 0000000..1d76a74
--- /dev/null
+++ b/identity/aidl/vts/IdentityCredentialImplementedTest.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2022 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Runs IdentityCredentialImplementedTest">
+ <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
+
+ <test class="com.android.tradefed.testtype.HostTest" >
+ <option name="jar" value="IdentityCredentialImplementedTest.jar" />
+ </test>
+</configuration>
diff --git a/identity/aidl/vts/ProveOwnershipTests.cpp b/identity/aidl/vts/ProveOwnershipTests.cpp
index c622193..f8ec670 100644
--- a/identity/aidl/vts/ProveOwnershipTests.cpp
+++ b/identity/aidl/vts/ProveOwnershipTests.cpp
@@ -125,14 +125,22 @@
credentialData_, &credential)
.isOk());
- vector<uint8_t> challenge = {17, 18};
+ // Implementations must support at least 32 bytes.
+ string challengeString = "0123456789abcdef0123456789abcdef";
+ vector<uint8_t> challenge(challengeString.begin(), challengeString.end());
vector<uint8_t> proofOfOwnershipSignature;
ASSERT_TRUE(credential->proveOwnership(challenge, &proofOfOwnershipSignature).isOk());
optional<vector<uint8_t>> proofOfOwnership =
support::coseSignGetPayload(proofOfOwnershipSignature);
ASSERT_TRUE(proofOfOwnership);
string cborPretty = cppbor::prettyPrint(proofOfOwnership.value(), 32, {});
- EXPECT_EQ("['ProofOfOwnership', 'org.iso.18013-5.2019.mdl', {0x11, 0x12}, true, ]", cborPretty);
+ EXPECT_EQ(
+ "['ProofOfOwnership', 'org.iso.18013-5.2019.mdl', {"
+ "0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, "
+ "0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, "
+ "0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, "
+ "0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66}, true, ]",
+ cborPretty);
EXPECT_TRUE(support::coseCheckEcDsaSignature(proofOfOwnershipSignature, {}, // Additional data
credentialPubKey_));
}
diff --git a/identity/aidl/vts/VtsAttestationTests.cpp b/identity/aidl/vts/VtsAttestationTests.cpp
index e12fe05..7caa259 100644
--- a/identity/aidl/vts/VtsAttestationTests.cpp
+++ b/identity/aidl/vts/VtsAttestationTests.cpp
@@ -66,7 +66,8 @@
ASSERT_TRUE(setupWritableCredential(writableCredential, credentialStore_,
false /* testCredential */));
- string challenge = "NotSoRandomChallenge1NotSoRandomChallenge1NotSoRandomChallenge1";
+ // Must support at least 32 bytes.
+ string challenge = "0123456789abcdef0123456789abcdef";
vector<uint8_t> attestationChallenge(challenge.begin(), challenge.end());
vector<Certificate> attestationCertificate;
string applicationId = "Attestation Verification";
diff --git a/identity/aidl/vts/src/com/android/tests/security/identity/IdentityCredentialImplementedTest.java b/identity/aidl/vts/src/com/android/tests/security/identity/IdentityCredentialImplementedTest.java
new file mode 100644
index 0000000..19568af
--- /dev/null
+++ b/identity/aidl/vts/src/com/android/tests/security/identity/IdentityCredentialImplementedTest.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2020 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 com.android.tests.security.identity;
+
+import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
+
+import android.platform.test.annotations.RequiresDevice;
+import com.android.tradefed.device.DeviceNotAvailableException;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
+import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
+public class IdentityCredentialImplementedTest extends BaseHostJUnit4Test {
+ // Returns the ro.vendor.api_level or 0 if not set.
+ //
+ // Throws NumberFormatException if ill-formatted.
+ //
+ // Throws DeviceNotAvailableException if device is not available.
+ //
+ private int getVendorApiLevel() throws NumberFormatException, DeviceNotAvailableException {
+ String vendorApiLevelString =
+ getDevice().executeShellCommand("getprop ro.vendor.api_level").trim();
+ if (vendorApiLevelString.isEmpty()) {
+ return 0;
+ }
+ return Integer.parseInt(vendorApiLevelString);
+ }
+
+ // As of Android 13 (API level 32), Identity Credential is required at feature version 202201
+ // or newer.
+ //
+ @RequiresDevice
+ @Test
+ public void testIdentityCredentialIsImplemented() throws Exception {
+ int vendorApiLevel = getVendorApiLevel();
+ assumeTrue(vendorApiLevel >= 32);
+
+ final String minimumFeatureVersionNeeded = "202201";
+
+ String result = getDevice().executeShellCommand(
+ "pm has-feature android.hardware.identity_credential "
+ + minimumFeatureVersionNeeded);
+ if (!result.trim().equals("true")) {
+ fail("Identity Credential feature version " + minimumFeatureVersionNeeded
+ + " required but not found");
+ }
+ }
+}
diff --git a/input/classifier/README.md b/input/classifier/README.md
new file mode 100644
index 0000000..a68d726
--- /dev/null
+++ b/input/classifier/README.md
@@ -0,0 +1 @@
+This HAL is deprecated. Do not use this HAL. Use IInputProcessor instead, located in `hardware/interfaces/input/processor`.
\ No newline at end of file
diff --git a/input/common/aidl/Android.bp b/input/common/aidl/Android.bp
index 6cf64a6..b96f4d0 100644
--- a/input/common/aidl/Android.bp
+++ b/input/common/aidl/Android.bp
@@ -9,6 +9,7 @@
aidl_interface {
name: "android.hardware.input.common",
+ vendor_available: true,
srcs: ["android/hardware/input/common/*.aidl"],
stability: "vintf",
backend: {
diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Source.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Source.aidl
index 24d02cd..396e06d 100644
--- a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Source.aidl
+++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Source.aidl
@@ -48,6 +48,7 @@
TOUCH_NAVIGATION = 2097152,
ROTARY_ENCODER = 4194304,
JOYSTICK = 16777232,
+ HDMI = 33554433,
SENSOR = 67108864,
ANY = -256,
}
diff --git a/input/common/aidl/android/hardware/input/common/Source.aidl b/input/common/aidl/android/hardware/input/common/Source.aidl
index 7eb6d66..c6a825a 100644
--- a/input/common/aidl/android/hardware/input/common/Source.aidl
+++ b/input/common/aidl/android/hardware/input/common/Source.aidl
@@ -38,6 +38,11 @@
TOUCH_NAVIGATION = (1 << 21) | SourceClass.NONE,
ROTARY_ENCODER = (1 << 22) | SourceClass.NONE,
JOYSTICK = (1 << 24) | SourceClass.JOYSTICK,
+ /**
+ * The input source is a device connected through HDMI-based bus.
+ * The keys come in through HDMI-CEC or MHL signal line.
+ */
+ HDMI = (1 << 25) | SourceClass.BUTTON,
SENSOR = (1 << 26) | SourceClass.NONE,
ANY = 0xFFFFFF00,
}
diff --git a/input/processor/aidl/Android.bp b/input/processor/aidl/Android.bp
new file mode 100644
index 0000000..f848a57
--- /dev/null
+++ b/input/processor/aidl/Android.bp
@@ -0,0 +1,26 @@
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+aidl_interface {
+ name: "android.hardware.input.processor",
+ vendor_available: true,
+ srcs: ["android/hardware/input/processor/*.aidl"],
+ imports: [
+ "android.hardware.input.common",
+ ],
+ stability: "vintf",
+ backend: {
+ cpp: {
+ enabled: false,
+ },
+ java: {
+ enabled: false,
+ },
+ },
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/input/processor/aidl/aidl_api/android.hardware.input.processor/current/android/hardware/input/processor/IInputProcessor.aidl
similarity index 84%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to input/processor/aidl/aidl_api/android.hardware.input.processor/current/android/hardware/input/processor/IInputProcessor.aidl
index 4f29c0b..9d00c70 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/input/processor/aidl/aidl_api/android.hardware.input.processor/current/android/hardware/input/processor/IInputProcessor.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.input.processor;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+interface IInputProcessor {
+ android.hardware.input.common.Classification classify(in android.hardware.input.common.MotionEvent event);
+ void reset();
+ void resetDevice(in int deviceId);
}
diff --git a/input/processor/aidl/android/hardware/input/processor/IInputProcessor.aidl b/input/processor/aidl/android/hardware/input/processor/IInputProcessor.aidl
new file mode 100644
index 0000000..635ff0a
--- /dev/null
+++ b/input/processor/aidl/android/hardware/input/processor/IInputProcessor.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.input.processor;
+
+@VintfStability
+interface IInputProcessor {
+ /**
+ * Upon receiving the current motion event, return the classification based on the current
+ * sequence of motion events.
+ * Once the classification has been determined, it should not change until a new gesture is
+ * started.
+ */
+ android.hardware.input.common.Classification classify(
+ in android.hardware.input.common.MotionEvent event);
+
+ /**
+ * Reset the HAL internal state. The reset may be called to prevent an inconsistent
+ * stream of events to be sent to the HAL.
+ */
+ void reset();
+
+ /**
+ * Called when an input device has been reset.
+ */
+ void resetDevice(in int deviceId);
+}
diff --git a/input/processor/aidl/default/Android.bp b/input/processor/aidl/default/Android.bp
new file mode 100644
index 0000000..f485597
--- /dev/null
+++ b/input/processor/aidl/default/Android.bp
@@ -0,0 +1,54 @@
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_library_static {
+ name: "libinputprocessorexampleimpl",
+ vendor: true,
+ shared_libs: [
+ "libbase",
+ "libbinder_ndk",
+ "liblog",
+ "libutils",
+ "android.hardware.input.common-V1-ndk",
+ "android.hardware.input.processor-V1-ndk",
+ ],
+ export_include_dirs: ["include"],
+ srcs: [
+ "InputProcessor.cpp",
+ ],
+ visibility: [
+ ":__subpackages__",
+ "//hardware/interfaces/tests/extension/input/processor:__subpackages__",
+ ],
+}
+
+filegroup {
+ name: "android.hardware.input.processor.xml",
+ srcs: ["android.hardware.input.processor.xml"],
+}
+
+cc_binary {
+ name: "android.hardware.input.processor-service.example",
+ relative_install_path: "hw",
+ init_rc: ["inputprocessor-default.rc"],
+ vintf_fragments: [":android.hardware.input.processor.xml"],
+ vendor: true,
+ shared_libs: [
+ "libbase",
+ "libbinder_ndk",
+ "liblog",
+ "libutils",
+ "android.hardware.input.common-V1-ndk",
+ "android.hardware.input.processor-V1-ndk",
+ ],
+ static_libs: [
+ "libinputprocessorexampleimpl",
+ ],
+ srcs: ["main.cpp"],
+}
diff --git a/input/processor/aidl/default/InputProcessor.cpp b/input/processor/aidl/default/InputProcessor.cpp
new file mode 100644
index 0000000..fb6bbd5
--- /dev/null
+++ b/input/processor/aidl/default/InputProcessor.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "inputprocessor-impl/InputProcessor.h"
+
+namespace aidl {
+namespace android {
+namespace hardware {
+namespace input {
+namespace processor {
+
+using ::aidl::android::hardware::input::common::Classification;
+using aidl::android::hardware::input::common::MotionEvent;
+
+::ndk::ScopedAStatus InputProcessor::classify(const MotionEvent& /*in_event*/,
+ Classification* _aidl_return) {
+ *_aidl_return = Classification::NONE;
+ return ndk::ScopedAStatus::ok();
+}
+::ndk::ScopedAStatus InputProcessor::reset() {
+ return ndk::ScopedAStatus::ok();
+}
+::ndk::ScopedAStatus InputProcessor::resetDevice(int32_t /*in_deviceId*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+} // namespace processor
+} // namespace input
+} // namespace hardware
+} // namespace android
+} // namespace aidl
\ No newline at end of file
diff --git a/input/processor/aidl/default/android.hardware.input.processor.xml b/input/processor/aidl/default/android.hardware.input.processor.xml
new file mode 100644
index 0000000..5ecbd2a
--- /dev/null
+++ b/input/processor/aidl/default/android.hardware.input.processor.xml
@@ -0,0 +1,7 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.input.processor</name>
+ <version>1</version>
+ <fqname>IInputProcessor/default</fqname>
+ </hal>
+</manifest>
\ No newline at end of file
diff --git a/input/processor/aidl/default/include/inputprocessor-impl/InputProcessor.h b/input/processor/aidl/default/include/inputprocessor-impl/InputProcessor.h
new file mode 100644
index 0000000..0d6bc58
--- /dev/null
+++ b/input/processor/aidl/default/include/inputprocessor-impl/InputProcessor.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/input/processor/BnInputProcessor.h>
+
+namespace aidl {
+namespace android {
+namespace hardware {
+namespace input {
+namespace processor {
+
+class InputProcessor : public ::aidl::android::hardware::input::processor::BnInputProcessor {
+ public:
+ ::ndk::ScopedAStatus classify(
+ const ::aidl::android::hardware::input::common::MotionEvent& in_event,
+ ::aidl::android::hardware::input::common::Classification* _aidl_return) override;
+ ::ndk::ScopedAStatus reset() override;
+ ::ndk::ScopedAStatus resetDevice(int32_t in_deviceId) override;
+};
+
+} // namespace processor
+} // namespace input
+} // namespace hardware
+} // namespace android
+} // namespace aidl
\ No newline at end of file
diff --git a/input/processor/aidl/default/inputprocessor-default.rc b/input/processor/aidl/default/inputprocessor-default.rc
new file mode 100644
index 0000000..bcc6c02
--- /dev/null
+++ b/input/processor/aidl/default/inputprocessor-default.rc
@@ -0,0 +1,4 @@
+service vendor.inputprocessor-default /vendor/bin/hw/android.hardware.input.processor-service.example
+ class hal
+ user nobody
+ group nobody
\ No newline at end of file
diff --git a/input/processor/aidl/default/main.cpp b/input/processor/aidl/default/main.cpp
new file mode 100644
index 0000000..7b519dd
--- /dev/null
+++ b/input/processor/aidl/default/main.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "inputprocessor-impl/InputProcessor.h"
+
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+
+using ::aidl::android::hardware::input::processor::IInputProcessor;
+using ::aidl::android::hardware::input::processor::InputProcessor;
+
+int main() {
+ ABinderProcess_setThreadPoolMaxThreadCount(0);
+
+ auto processor = ndk::SharedRefBase::make<InputProcessor>();
+ const std::string name = std::string() + InputProcessor::descriptor + "/default";
+ binder_status_t status = AServiceManager_addService(processor->asBinder().get(), name.c_str());
+ CHECK_EQ(status, STATUS_OK);
+
+ ABinderProcess_joinThreadPool();
+ return EXIT_FAILURE; // should not reach
+}
\ No newline at end of file
diff --git a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/BrightnessMode.aidl b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/BrightnessMode.aidl
index c4c6d64..8813907 100644
--- a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/BrightnessMode.aidl
+++ b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/BrightnessMode.aidl
@@ -1,14 +1,30 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
//
-// You must not make a backward incompatible changes to the AIDL files built
+// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
diff --git a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/FlashMode.aidl b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/FlashMode.aidl
index 349f9f3..0411f82 100644
--- a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/FlashMode.aidl
+++ b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/FlashMode.aidl
@@ -1,14 +1,30 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
//
-// You must not make a backward incompatible changes to the AIDL files built
+// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
diff --git a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLight.aidl b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLight.aidl
index c397f91..25a2dce 100644
--- a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLight.aidl
+++ b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLight.aidl
@@ -1,14 +1,30 @@
+/*
+ * 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.
+ */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
//
-// You must not make a backward incompatible changes to the AIDL files built
+// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
diff --git a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLightState.aidl b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLightState.aidl
index 44a0882..40e520b 100644
--- a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLightState.aidl
+++ b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLightState.aidl
@@ -1,14 +1,30 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
//
-// You must not make a backward incompatible changes to the AIDL files built
+// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
diff --git a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/ILights.aidl b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/ILights.aidl
index fc6c626..30bb3c3 100644
--- a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/ILights.aidl
+++ b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/ILights.aidl
@@ -1,14 +1,30 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
//
-// You must not make a backward incompatible changes to the AIDL files built
+// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
diff --git a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/LightType.aidl b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/LightType.aidl
index 77ab98c..2b978ab 100644
--- a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/LightType.aidl
+++ b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/LightType.aidl
@@ -1,14 +1,30 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
//
-// You must not make a backward incompatible changes to the AIDL files built
+// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
@@ -27,4 +43,5 @@
BLUETOOTH = 6,
WIFI = 7,
MICROPHONE = 8,
+ CAMERA = 9,
}
diff --git a/light/aidl/android/hardware/light/LightType.aidl b/light/aidl/android/hardware/light/LightType.aidl
index 9a7f656..f7161d0 100644
--- a/light/aidl/android/hardware/light/LightType.aidl
+++ b/light/aidl/android/hardware/light/LightType.aidl
@@ -32,4 +32,5 @@
BLUETOOTH = 6,
WIFI = 7,
MICROPHONE = 8,
+ CAMERA = 9,
}
diff --git a/light/aidl/default/Android.bp b/light/aidl/default/Android.bp
index 2ccf140..7920503 100644
--- a/light/aidl/default/Android.bp
+++ b/light/aidl/default/Android.bp
@@ -16,7 +16,7 @@
shared_libs: [
"libbase",
"libbinder_ndk",
- "android.hardware.light-V1-ndk",
+ "android.hardware.light-V2-ndk",
],
srcs: [
"Lights.cpp",
diff --git a/light/aidl/default/lights-default.xml b/light/aidl/default/lights-default.xml
index db604d6..abdd74e 100644
--- a/light/aidl/default/lights-default.xml
+++ b/light/aidl/default/lights-default.xml
@@ -1,6 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.light</name>
+ <version>2</version>
<fqname>ILights/default</fqname>
</hal>
</manifest>
diff --git a/media/1.0/Android.bp b/media/1.0/Android.bp
index 6e823f6..22a6d59 100644
--- a/media/1.0/Android.bp
+++ b/media/1.0/Android.bp
@@ -22,4 +22,8 @@
"android.hardware.graphics.common@1.0",
],
gen_java: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ ],
}
diff --git a/media/bufferpool/2.0/Android.bp b/media/bufferpool/2.0/Android.bp
index 01273c1..56597db 100644
--- a/media/bufferpool/2.0/Android.bp
+++ b/media/bufferpool/2.0/Android.bp
@@ -26,4 +26,8 @@
"android.hidl.base@1.0",
],
gen_java: false,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ ],
}
diff --git a/media/c2/1.0/Android.bp b/media/c2/1.0/Android.bp
index dc56fef..a591dc7 100644
--- a/media/c2/1.0/Android.bp
+++ b/media/c2/1.0/Android.bp
@@ -36,4 +36,9 @@
"android.hidl.safe_union@1.0",
],
gen_java: false,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ "test_com.android.media.swcodec",
+ ],
}
diff --git a/media/c2/1.1/Android.bp b/media/c2/1.1/Android.bp
index 885a4c8..bec3a06 100644
--- a/media/c2/1.1/Android.bp
+++ b/media/c2/1.1/Android.bp
@@ -30,4 +30,9 @@
"android.hidl.safe_union@1.0",
],
gen_java: false,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ "test_com.android.media.swcodec",
+ ],
}
diff --git a/media/omx/1.0/Android.bp b/media/omx/1.0/Android.bp
index e33bab3..ea63467 100644
--- a/media/omx/1.0/Android.bp
+++ b/media/omx/1.0/Android.bp
@@ -31,4 +31,8 @@
"android.hidl.base@1.0",
],
gen_java: false,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ ],
}
diff --git a/neuralnetworks/aidl/utils/src/Conversions.cpp b/neuralnetworks/aidl/utils/src/Conversions.cpp
index eb28db7..9b897c4 100644
--- a/neuralnetworks/aidl/utils/src/Conversions.cpp
+++ b/neuralnetworks/aidl/utils/src/Conversions.cpp
@@ -967,6 +967,11 @@
}
nn::GeneralResult<Model> unvalidatedConvert(const nn::Model& model) {
+ if (!hal::utils::hasNoPointerData(model)) {
+ return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT)
+ << "Model cannot be unvalidatedConverted because it contains pointer-based memory";
+ }
+
return Model{
.main = NN_TRY(unvalidatedConvert(model.main)),
.referenced = NN_TRY(unvalidatedConvert(model.referenced)),
@@ -982,6 +987,11 @@
}
nn::GeneralResult<Request> unvalidatedConvert(const nn::Request& request) {
+ if (!hal::utils::hasNoPointerData(request)) {
+ return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT)
+ << "Request cannot be unvalidatedConverted because it contains pointer-based memory";
+ }
+
return Request{
.inputs = NN_TRY(unvalidatedConvert(request.inputs)),
.outputs = NN_TRY(unvalidatedConvert(request.outputs)),
diff --git a/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h b/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h
index ae0d092..c04294a 100644
--- a/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h
+++ b/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h
@@ -20,6 +20,7 @@
#include <nnapi/Result.h>
#include <nnapi/SharedMemory.h>
#include <nnapi/Types.h>
+
#include <functional>
#include <vector>
@@ -47,81 +48,10 @@
const nn::Capabilities::PerformanceInfo& float32Performance,
const nn::Capabilities::PerformanceInfo& quantized8Performance);
-// Indicates if the object contains no pointer-based data that could be relocated to shared memory.
-bool hasNoPointerData(const nn::Model& model);
-bool hasNoPointerData(const nn::Request& request);
-
-// Relocate pointer-based data to shared memory. If `model` has no Operand::LifeTime::POINTER data,
-// the function returns with a reference to `model`. If `model` has Operand::LifeTime::POINTER data,
-// the model is copied to `maybeModelInSharedOut` with the POINTER data relocated to a memory pool,
-// and the function returns with a reference to `*maybeModelInSharedOut`.
-nn::GeneralResult<std::reference_wrapper<const nn::Model>> flushDataFromPointerToShared(
- const nn::Model* model, std::optional<nn::Model>* maybeModelInSharedOut);
-
-// Record a relocation mapping between pointer-based data and shared memory.
-// Only two specializations of this template may exist:
-// - RelocationInfo<const void*> for request inputs
-// - RelocationInfo<void*> for request outputs
-template <typename PointerType>
-struct RelocationInfo {
- PointerType data;
- size_t length;
- size_t offset;
-};
-using InputRelocationInfo = RelocationInfo<const void*>;
-using OutputRelocationInfo = RelocationInfo<void*>;
-
-// Keep track of the relocation mapping between pointer-based data and shared memory pool,
-// and provide method to copy the data between pointers and the shared memory pool.
-// Only two specializations of this template may exist:
-// - RelocationTracker<InputRelocationInfo> for request inputs
-// - RelocationTracker<OutputRelocationInfo> for request outputs
-template <typename RelocationInfoType>
-class RelocationTracker {
- public:
- static nn::GeneralResult<std::unique_ptr<RelocationTracker>> create(
- std::vector<RelocationInfoType> relocationInfos, nn::SharedMemory memory) {
- auto mapping = NN_TRY(map(memory));
- return std::make_unique<RelocationTracker<RelocationInfoType>>(
- std::move(relocationInfos), std::move(memory), std::move(mapping));
- }
-
- RelocationTracker(std::vector<RelocationInfoType> relocationInfos, nn::SharedMemory memory,
- nn::Mapping mapping)
- : kRelocationInfos(std::move(relocationInfos)),
- kMemory(std::move(memory)),
- kMapping(std::move(mapping)) {}
-
- // Specializations defined in CommonUtils.cpp.
- // For InputRelocationTracker, this method will copy pointer data to the shared memory pool.
- // For OutputRelocationTracker, this method will copy shared memory data to the pointers.
- void flush() const;
-
- private:
- const std::vector<RelocationInfoType> kRelocationInfos;
- const nn::SharedMemory kMemory;
- const nn::Mapping kMapping;
-};
-using InputRelocationTracker = RelocationTracker<InputRelocationInfo>;
-using OutputRelocationTracker = RelocationTracker<OutputRelocationInfo>;
-
-struct RequestRelocation {
- std::unique_ptr<InputRelocationTracker> input;
- std::unique_ptr<OutputRelocationTracker> output;
-};
-
-// Relocate pointer-based data to shared memory. If `request` has no
-// Request::Argument::LifeTime::POINTER data, the function returns with a reference to `request`. If
-// `request` has Request::Argument::LifeTime::POINTER data, the request is copied to
-// `maybeRequestInSharedOut` with the POINTER data relocated to a memory pool, and the function
-// returns with a reference to `*maybeRequestInSharedOut`. The `relocationOut` will be set to track
-// the input and output relocations.
-//
-// Unlike `flushDataFromPointerToShared`, this method will not copy the input pointer data to the
-// shared memory pool. Use `relocationOut` to flush the input or output data after the call.
-nn::GeneralResult<std::reference_wrapper<const nn::Request>> convertRequestFromPointerToShared(
- const nn::Request* request, uint32_t alignment, uint32_t padding,
- std::optional<nn::Request>* maybeRequestInSharedOut, RequestRelocation* relocationOut);
+using nn::convertRequestFromPointerToShared;
+using nn::flushDataFromPointerToShared;
+using nn::hasNoPointerData;
+using nn::RequestRelocation;
} // namespace android::hardware::neuralnetworks::utils
diff --git a/neuralnetworks/utils/common/src/CommonUtils.cpp b/neuralnetworks/utils/common/src/CommonUtils.cpp
index b249881..dd55add 100644
--- a/neuralnetworks/utils/common/src/CommonUtils.cpp
+++ b/neuralnetworks/utils/common/src/CommonUtils.cpp
@@ -31,59 +31,6 @@
#include <vector>
namespace android::hardware::neuralnetworks::utils {
-namespace {
-
-bool hasNoPointerData(const nn::Operand& operand);
-bool hasNoPointerData(const nn::Model::Subgraph& subgraph);
-bool hasNoPointerData(const nn::Request::Argument& argument);
-
-template <typename Type>
-bool hasNoPointerData(const std::vector<Type>& objects) {
- return std::all_of(objects.begin(), objects.end(),
- [](const auto& object) { return hasNoPointerData(object); });
-}
-
-bool hasNoPointerData(const nn::DataLocation& location) {
- return std::visit([](auto ptr) { return ptr == nullptr; }, location.pointer);
-}
-
-bool hasNoPointerData(const nn::Operand& operand) {
- return hasNoPointerData(operand.location);
-}
-
-bool hasNoPointerData(const nn::Model::Subgraph& subgraph) {
- return hasNoPointerData(subgraph.operands);
-}
-
-bool hasNoPointerData(const nn::Request::Argument& argument) {
- return hasNoPointerData(argument.location);
-}
-
-void copyPointersToSharedMemory(nn::Operand* operand, nn::ConstantMemoryBuilder* memoryBuilder) {
- CHECK(operand != nullptr);
- CHECK(memoryBuilder != nullptr);
-
- if (operand->lifetime != nn::Operand::LifeTime::POINTER) {
- return;
- }
-
- const void* data = std::visit([](auto ptr) { return static_cast<const void*>(ptr); },
- operand->location.pointer);
- CHECK(data != nullptr);
- operand->lifetime = nn::Operand::LifeTime::CONSTANT_REFERENCE;
- operand->location = memoryBuilder->append(data, operand->location.length);
-}
-
-void copyPointersToSharedMemory(nn::Model::Subgraph* subgraph,
- nn::ConstantMemoryBuilder* memoryBuilder) {
- CHECK(subgraph != nullptr);
- std::for_each(subgraph->operands.begin(), subgraph->operands.end(),
- [memoryBuilder](auto& operand) {
- copyPointersToSharedMemory(&operand, memoryBuilder);
- });
-}
-
-} // anonymous namespace
nn::Capabilities::OperandPerformanceTable makeQuantized8PerformanceConsistentWithP(
const nn::Capabilities::PerformanceInfo& float32Performance,
@@ -104,131 +51,4 @@
.value();
}
-bool hasNoPointerData(const nn::Model& model) {
- return hasNoPointerData(model.main) && hasNoPointerData(model.referenced);
-}
-
-bool hasNoPointerData(const nn::Request& request) {
- return hasNoPointerData(request.inputs) && hasNoPointerData(request.outputs);
-}
-
-nn::GeneralResult<std::reference_wrapper<const nn::Model>> flushDataFromPointerToShared(
- const nn::Model* model, std::optional<nn::Model>* maybeModelInSharedOut) {
- CHECK(model != nullptr);
- CHECK(maybeModelInSharedOut != nullptr);
-
- if (hasNoPointerData(*model)) {
- return *model;
- }
-
- // Make a copy of the model in order to make modifications. The modified model is returned to
- // the caller through `maybeModelInSharedOut` if the function succeeds.
- nn::Model modelInShared = *model;
-
- nn::ConstantMemoryBuilder memoryBuilder(modelInShared.pools.size());
- copyPointersToSharedMemory(&modelInShared.main, &memoryBuilder);
- std::for_each(modelInShared.referenced.begin(), modelInShared.referenced.end(),
- [&memoryBuilder](auto& subgraph) {
- copyPointersToSharedMemory(&subgraph, &memoryBuilder);
- });
-
- if (!memoryBuilder.empty()) {
- auto memory = NN_TRY(memoryBuilder.finish());
- modelInShared.pools.push_back(std::move(memory));
- }
-
- *maybeModelInSharedOut = modelInShared;
- return **maybeModelInSharedOut;
-}
-
-template <>
-void InputRelocationTracker::flush() const {
- // Copy from pointers to shared memory.
- uint8_t* memoryPtr = static_cast<uint8_t*>(std::get<void*>(kMapping.pointer));
- for (const auto& [data, length, offset] : kRelocationInfos) {
- std::memcpy(memoryPtr + offset, data, length);
- }
-}
-
-template <>
-void OutputRelocationTracker::flush() const {
- // Copy from shared memory to pointers.
- const uint8_t* memoryPtr = static_cast<const uint8_t*>(
- std::visit([](auto ptr) { return static_cast<const void*>(ptr); }, kMapping.pointer));
- for (const auto& [data, length, offset] : kRelocationInfos) {
- std::memcpy(data, memoryPtr + offset, length);
- }
-}
-
-nn::GeneralResult<std::reference_wrapper<const nn::Request>> convertRequestFromPointerToShared(
- const nn::Request* request, uint32_t alignment, uint32_t padding,
- std::optional<nn::Request>* maybeRequestInSharedOut, RequestRelocation* relocationOut) {
- CHECK(request != nullptr);
- CHECK(maybeRequestInSharedOut != nullptr);
- CHECK(relocationOut != nullptr);
-
- if (hasNoPointerData(*request)) {
- return *request;
- }
-
- // Make a copy of the request in order to make modifications. The modified request is returned
- // to the caller through `maybeRequestInSharedOut` if the function succeeds.
- nn::Request requestInShared = *request;
-
- RequestRelocation relocation;
-
- // Change input pointers to shared memory.
- nn::MutableMemoryBuilder inputBuilder(requestInShared.pools.size());
- std::vector<InputRelocationInfo> inputRelocationInfos;
- for (auto& input : requestInShared.inputs) {
- const auto& location = input.location;
- if (input.lifetime != nn::Request::Argument::LifeTime::POINTER) {
- continue;
- }
-
- input.lifetime = nn::Request::Argument::LifeTime::POOL;
- const void* data = std::visit([](auto ptr) { return static_cast<const void*>(ptr); },
- location.pointer);
- CHECK(data != nullptr);
- input.location = inputBuilder.append(location.length, alignment, padding);
- inputRelocationInfos.push_back({data, input.location.length, input.location.offset});
- }
-
- // Allocate input memory.
- if (!inputBuilder.empty()) {
- auto memory = NN_TRY(inputBuilder.finish());
- requestInShared.pools.push_back(memory);
- relocation.input = NN_TRY(
- InputRelocationTracker::create(std::move(inputRelocationInfos), std::move(memory)));
- }
-
- // Change output pointers to shared memory.
- nn::MutableMemoryBuilder outputBuilder(requestInShared.pools.size());
- std::vector<OutputRelocationInfo> outputRelocationInfos;
- for (auto& output : requestInShared.outputs) {
- const auto& location = output.location;
- if (output.lifetime != nn::Request::Argument::LifeTime::POINTER) {
- continue;
- }
-
- output.lifetime = nn::Request::Argument::LifeTime::POOL;
- void* data = std::get<void*>(location.pointer);
- CHECK(data != nullptr);
- output.location = outputBuilder.append(location.length, alignment, padding);
- outputRelocationInfos.push_back({data, output.location.length, output.location.offset});
- }
-
- // Allocate output memory.
- if (!outputBuilder.empty()) {
- auto memory = NN_TRY(outputBuilder.finish());
- requestInShared.pools.push_back(memory);
- relocation.output = NN_TRY(OutputRelocationTracker::create(std::move(outputRelocationInfos),
- std::move(memory)));
- }
-
- *maybeRequestInSharedOut = requestInShared;
- *relocationOut = std::move(relocation);
- return **maybeRequestInSharedOut;
-}
-
} // namespace android::hardware::neuralnetworks::utils
diff --git a/radio/1.0/Android.bp b/radio/1.0/Android.bp
index cd64bca..8d0d782 100644
--- a/radio/1.0/Android.bp
+++ b/radio/1.0/Android.bp
@@ -23,5 +23,9 @@
interfaces: [
"android.hidl.base@1.0",
],
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.bluetooth",
+ ],
gen_java: true,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl
index c8efea0..02bbf21 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl
@@ -53,7 +53,7 @@
boolean preferred;
boolean persistent;
boolean alwaysOn;
- @nullable android.hardware.radio.data.TrafficDescriptor trafficDescriptor;
+ android.hardware.radio.data.TrafficDescriptor trafficDescriptor;
const int ID_DEFAULT = 0;
const int ID_TETHERED = 1;
const int ID_IMS = 2;
@@ -62,6 +62,6 @@
const int ID_OEM_BASE = 1000;
const int ID_INVALID = -1;
const int TYPE_COMMON = 0;
- const int TYPE_THREE_GPP = 1;
- const int TYPE_THREE_GPP2 = 2;
+ const int TYPE_3GPP = 1;
+ const int TYPE_3GPP2 = 2;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl
index dc6092a..7b572f1 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl
@@ -44,7 +44,7 @@
oneway void setDataAllowed(in int serial, in boolean allow);
oneway void setDataProfile(in int serial, in android.hardware.radio.data.DataProfileInfo[] profiles);
oneway void setDataThrottling(in int serial, in android.hardware.radio.data.DataThrottlingAction dataThrottlingAction, in long completionDurationMillis);
- oneway void setInitialAttachApn(in int serial, in android.hardware.radio.data.DataProfileInfo dataProfileInfo);
+ oneway void setInitialAttachApn(in int serial, in @nullable android.hardware.radio.data.DataProfileInfo dataProfileInfo);
oneway void setResponseFunctions(in android.hardware.radio.data.IRadioDataResponse radioDataResponse, in android.hardware.radio.data.IRadioDataIndication radioDataIndication);
oneway void setupDataCall(in int serial, in android.hardware.radio.AccessNetwork accessNetwork, in android.hardware.radio.data.DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in android.hardware.radio.data.DataRequestReason reason, in android.hardware.radio.data.LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in @nullable android.hardware.radio.data.SliceInfo sliceInfo, in boolean matchAllRuleAllowed);
oneway void startHandover(in int serial, in int callId);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessaging.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessaging.aidl
index b0fc349..dfec59a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessaging.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessaging.aidl
@@ -37,7 +37,6 @@
oneway void acknowledgeIncomingGsmSmsWithPdu(in int serial, in boolean success, in String ackPdu);
oneway void acknowledgeLastIncomingCdmaSms(in int serial, in android.hardware.radio.messaging.CdmaSmsAck smsAck);
oneway void acknowledgeLastIncomingGsmSms(in int serial, in boolean success, in android.hardware.radio.messaging.SmsAcknowledgeFailCause cause);
- oneway void cancelPendingUssd(in int serial);
oneway void deleteSmsOnRuim(in int serial, in int index);
oneway void deleteSmsOnSim(in int serial, in int index);
oneway void getCdmaBroadcastConfig(in int serial);
@@ -50,7 +49,6 @@
oneway void sendImsSms(in int serial, in android.hardware.radio.messaging.ImsSmsMessage message);
oneway void sendSms(in int serial, in android.hardware.radio.messaging.GsmSmsMessage message);
oneway void sendSmsExpectMore(in int serial, in android.hardware.radio.messaging.GsmSmsMessage message);
- oneway void sendUssd(in int serial, in String ussd);
oneway void setCdmaBroadcastActivation(in int serial, in boolean activate);
oneway void setCdmaBroadcastConfig(in int serial, in android.hardware.radio.messaging.CdmaBroadcastSmsConfigInfo[] configInfo);
oneway void setGsmBroadcastActivation(in int serial, in boolean activate);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingIndication.aidl
index 89a0f3b..8f7824f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingIndication.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingIndication.aidl
@@ -40,6 +40,5 @@
oneway void newSms(in android.hardware.radio.RadioIndicationType type, in byte[] pdu);
oneway void newSmsOnSim(in android.hardware.radio.RadioIndicationType type, in int recordNumber);
oneway void newSmsStatusReport(in android.hardware.radio.RadioIndicationType type, in byte[] pdu);
- oneway void onUssd(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.messaging.UssdModeType modeType, in String msg);
oneway void simSmsStorageFull(in android.hardware.radio.RadioIndicationType type);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
index 156f24b..c3af7a6 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
@@ -38,7 +38,6 @@
oneway void acknowledgeLastIncomingCdmaSmsResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void acknowledgeLastIncomingGsmSmsResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void acknowledgeRequest(in int serial);
- oneway void cancelPendingUssdResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void deleteSmsOnRuimResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void deleteSmsOnSimResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void getCdmaBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.CdmaBroadcastSmsConfigInfo[] configs);
@@ -50,7 +49,6 @@
oneway void sendImsSmsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms);
oneway void sendSmsExpectMoreResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms);
oneway void sendSmsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms);
- oneway void sendUssdResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void setCdmaBroadcastActivationResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void setCdmaBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void setGsmBroadcastActivationResponse(in android.hardware.radio.RadioResponseInfo info);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl
index ef9c779..85cf86e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl
@@ -36,6 +36,5 @@
parcelable CarrierRestrictions {
android.hardware.radio.sim.Carrier[] allowedCarriers;
android.hardware.radio.sim.Carrier[] excludedCarriers;
- boolean priority;
boolean allowedCarriersPrioritized;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoice.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoice.aidl
index 34d155a..603b1d6 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoice.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoice.aidl
@@ -35,6 +35,7 @@
@VintfStability
interface IRadioVoice {
oneway void acceptCall(in int serial);
+ oneway void cancelPendingUssd(in int serial);
oneway void conference(in int serial);
oneway void dial(in int serial, in android.hardware.radio.voice.Dial dialInfo);
oneway void emergencyDial(in int serial, in android.hardware.radio.voice.Dial dialInfo, in int categories, in String[] urns, in android.hardware.radio.voice.EmergencyCallRouting routing, in boolean hasKnownUserIntentEmergency, in boolean isTesting);
@@ -59,6 +60,7 @@
oneway void sendBurstDtmf(in int serial, in String dtmf, in int on, in int off);
oneway void sendCdmaFeatureCode(in int serial, in String featureCode);
oneway void sendDtmf(in int serial, in String s);
+ oneway void sendUssd(in int serial, in String ussd);
oneway void separateConnection(in int serial, in int gsmIndex);
oneway void setCallForward(in int serial, in android.hardware.radio.voice.CallForwardInfo callInfo);
oneway void setCallWaiting(in int serial, in boolean enable, in int serviceClass);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceIndication.aidl
index af3417d..189ed43 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceIndication.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceIndication.aidl
@@ -44,6 +44,7 @@
oneway void exitEmergencyCallbackMode(in android.hardware.radio.RadioIndicationType type);
oneway void indicateRingbackTone(in android.hardware.radio.RadioIndicationType type, in boolean start);
oneway void onSupplementaryServiceIndication(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.StkCcUnsolSsResult ss);
+ oneway void onUssd(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.UssdModeType modeType, in String msg);
oneway void resendIncallMute(in android.hardware.radio.RadioIndicationType type);
oneway void srvccStateNotify(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.SrvccState state);
oneway void stkCallControlAlphaNotify(in android.hardware.radio.RadioIndicationType type, in String alpha);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceResponse.aidl
index a3b5e58..7acc044 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceResponse.aidl
@@ -36,6 +36,7 @@
interface IRadioVoiceResponse {
oneway void acceptCallResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void acknowledgeRequest(in int serial);
+ oneway void cancelPendingUssdResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void conferenceResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void dialResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void emergencyDialResponse(in android.hardware.radio.RadioResponseInfo info);
@@ -59,6 +60,7 @@
oneway void sendBurstDtmfResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void sendCdmaFeatureCodeResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void sendDtmfResponse(in android.hardware.radio.RadioResponseInfo info);
+ oneway void sendUssdResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void separateConnectionResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void setCallForwardResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void setCallWaitingResponse(in android.hardware.radio.RadioResponseInfo info);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl
similarity index 97%
rename from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
rename to radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl
index 5395b11..9a9d723 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl
@@ -31,7 +31,7 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.radio.voice;
@Backing(type="int") @VintfStability
enum UssdModeType {
NOTIFY = 0,
diff --git a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl
index 7360202..123b3ed 100644
--- a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl
+++ b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl
@@ -16,9 +16,7 @@
package android.hardware.radio.data;
-import android.hardware.radio.RadioAccessFamily;
import android.hardware.radio.data.ApnAuthType;
-import android.hardware.radio.data.ApnTypes;
import android.hardware.radio.data.PdpProtocolType;
import android.hardware.radio.data.TrafficDescriptor;
@@ -36,8 +34,8 @@
const int ID_INVALID = 0xFFFFFFFF;
const int TYPE_COMMON = 0;
- const int TYPE_THREE_GPP = 1;
- const int TYPE_THREE_GPP2 = 2;
+ const int TYPE_3GPP = 1;
+ const int TYPE_3GPP2 = 2;
/**
* ID of the data profile.
@@ -130,5 +128,5 @@
* it does not specify the end point to be used for the data call. The end point is specified by
* apn; apn must be used as the end point if one is not specified through URSP rules.
*/
- @nullable TrafficDescriptor trafficDescriptor;
+ TrafficDescriptor trafficDescriptor;
}
diff --git a/radio/aidl/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/android/hardware/radio/data/IRadioData.aidl
index 54a045c..e1ba568 100644
--- a/radio/aidl/android/hardware/radio/data/IRadioData.aidl
+++ b/radio/aidl/android/hardware/radio/data/IRadioData.aidl
@@ -159,14 +159,15 @@
in long completionDurationMillis);
/**
- * Set an APN to initial attach network.
+ * Set an APN to initial attach network or clear the existing initial attach APN.
*
* @param serial Serial number of request.
- * @param dataProfileInfo data profile containing APN settings
+ * @param dataProfileInfo Data profile containing APN settings or null to clear the existing
+ * initial attach APN.
*
* Response function is IRadioDataResponse.setInitialAttachApnResponse()
*/
- void setInitialAttachApn(in int serial, in DataProfileInfo dataProfileInfo);
+ void setInitialAttachApn(in int serial, in @nullable DataProfileInfo dataProfileInfo);
/**
* Set response functions for data radio requests and indications.
diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl
index 1dbaed3..8bd84a3 100644
--- a/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl
@@ -79,15 +79,6 @@
in int serial, in boolean success, in SmsAcknowledgeFailCause cause);
/**
- * Cancel the current USSD session if one exists.
- *
- * @param serial Serial number of request.
- *
- * Response function is IRadioMessagingResponse.cancelPendingUssdResponse()
- */
- void cancelPendingUssd(in int serial);
-
- /**
* Deletes a CDMA SMS message from RUIM memory.
*
* @param serial Serial number of request.
@@ -212,23 +203,6 @@
void sendSmsExpectMore(in int serial, in GsmSmsMessage message);
/**
- * Send a USSD message. If a USSD session already exists, the message must be sent in the
- * context of that session. Otherwise, a new session must be created. The network reply must be
- * reported via unsolOnUssd.
- *
- * Only one USSD session must exist at a time, and the session is assumed to exist until:
- * a) The android system invokes cancelUssd()
- * b) The implementation sends a unsolOnUssd() with a type code of
- * "0" (USSD-Notify/no further action) or "2" (session terminated)
- *
- * @param serial Serial number of request.
- * @param ussd string containing the USSD request in UTF-8 format
- *
- * Response function is IRadioMessagingResponse.sendUssdResponse()
- */
- void sendUssd(in int serial, in String ussd);
-
- /**
* Enable or disable the reception of CDMA Cell Broadcast SMS
*
* @param serial Serial number of request.
diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl
index 4b40bfb..8834cd9 100644
--- a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl
@@ -18,7 +18,6 @@
import android.hardware.radio.RadioIndicationType;
import android.hardware.radio.messaging.CdmaSmsMessage;
-import android.hardware.radio.messaging.UssdModeType;
/**
* Interface declaring unsolicited radio indications for messaging APIs.
@@ -86,16 +85,6 @@
void newSmsStatusReport(in RadioIndicationType type, in byte[] pdu);
/**
- * Indicates when a new USSD message is received. The USSD session is assumed to persist if the
- * type code is REQUEST, otherwise the current session (if any) is assumed to have terminated.
- *
- * @param type Type of radio indication
- * @param modeType USSD type code
- * @param msg Message string in UTF-8, if applicable
- */
- void onUssd(in RadioIndicationType type, in UssdModeType modeType, in String msg);
-
- /**
* Indicates that SMS storage on the SIM is full. Sent when the network attempts to deliver a
* new SMS message. Messages cannot be saved on the SIM until space is freed. In particular,
* incoming Class 2 messages must not be stored.
diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
index 75fa390..492755f 100644
--- a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
@@ -92,27 +92,6 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:SIM_BUSY
- * RadioError:OPERATION_NOT_ALLOWED
- * RadioError:MODEM_ERR
- * RadioError:INTERNAL_ERR
- * RadioError:NO_MEMORY
- * RadioError:INVALID_STATE
- * RadioError:INVALID_ARGUMENTS
- * RadioError:SYSTEM_ERR
- * RadioError:REQUEST_NOT_SUPPORTED
- * RadioError:INVALID_MODEM_STATE
- * RadioError:NO_RESOURCES
- * RadioError:CANCELLED
- */
- void cancelPendingUssdResponse(in RadioResponseInfo info);
-
- /**
- * @param info Response info struct containing response type, serial no. and error
- *
- * Valid errors returned:
- * RadioError:NONE
- * RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
* RadioError:NO_MEMORY
* RadioError:SYSTEM_ERR
@@ -407,32 +386,6 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:FDN_CHECK_FAILURE
- * RadioError:USSD_MODIFIED_TO_DIAL
- * RadioError:USSD_MODIFIED_TO_SS
- * RadioError:USSD_MODIFIED_TO_USSD
- * RadioError:SIM_BUSY
- * RadioError:OPERATION_NOT_ALLOWED
- * RadioError:INVALID_ARGUMENTS
- * RadioError:NO_MEMORY
- * RadioError:MODEM_ERR
- * RadioError:INTERNAL_ERR
- * RadioError:ABORTED
- * RadioError:SYSTEM_ERR
- * RadioError:INVALID_STATE
- * RadioError:REQUEST_NOT_SUPPORTED
- * RadioError:INVALID_MODEM_STATE
- * RadioError:NO_RESOURCES
- * RadioError:CANCELLED
- */
- void sendUssdResponse(in RadioResponseInfo info);
-
- /**
- * @param info Response info struct containing response type, serial no. and error
- *
- * Valid errors returned:
- * RadioError:NONE
- * RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
* RadioError:INVALID_STATE
* RadioError:NO_MEMORY
diff --git a/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl b/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl
index 9bd5f21..96b9d0d 100644
--- a/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl
+++ b/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl
@@ -16,8 +16,6 @@
package android.hardware.radio.modem;
-import android.hardware.radio.RadioAccessFamily;
-
@VintfStability
parcelable RadioCapability {
/**
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
index 7a22a9a..cce52ff 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
@@ -17,7 +17,6 @@
package android.hardware.radio.network;
import android.hardware.radio.AccessNetwork;
-import android.hardware.radio.RadioAccessFamily;
import android.hardware.radio.network.CdmaRoamingType;
import android.hardware.radio.network.IRadioNetworkIndication;
import android.hardware.radio.network.IRadioNetworkResponse;
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
index 6863ac3..f471433 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
@@ -21,7 +21,6 @@
import android.hardware.radio.network.BarringInfo;
import android.hardware.radio.network.CellIdentity;
import android.hardware.radio.network.CellInfo;
-import android.hardware.radio.network.Domain;
import android.hardware.radio.network.LinkCapacityEstimate;
import android.hardware.radio.network.NetworkScanResult;
import android.hardware.radio.network.PhoneRestrictedState;
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
index e650321..dcf0004 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
@@ -16,7 +16,6 @@
package android.hardware.radio.network;
-import android.hardware.radio.RadioAccessFamily;
import android.hardware.radio.RadioResponseInfo;
import android.hardware.radio.RadioTechnology;
import android.hardware.radio.RadioTechnologyFamily;
@@ -24,8 +23,6 @@
import android.hardware.radio.network.CdmaRoamingType;
import android.hardware.radio.network.CellIdentity;
import android.hardware.radio.network.CellInfo;
-import android.hardware.radio.network.LceDataInfo;
-import android.hardware.radio.network.NeighboringCell;
import android.hardware.radio.network.OperatorInfo;
import android.hardware.radio.network.RadioAccessSpecifier;
import android.hardware.radio.network.RadioBandMode;
diff --git a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
index 12df138..ef38fdc 100644
--- a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
+++ b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
@@ -31,11 +31,6 @@
*/
Carrier[] excludedCarriers;
/**
- * Whether this is a carrier restriction with priority or not.
- * If this is false, allowedCarriersPrioritized is not applicable.
- */
- boolean priority;
- /**
* True means that only carriers included in the allowed list and not in the excluded list
* are permitted. Eg. allowedCarriers match mcc/mnc, excludedCarriers has same mcc/mnc and
* gid1 is ABCD. It means except the carrier whose gid1 is ABCD, all carriers with the
diff --git a/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl b/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl
index ddc5d76..9fed78e 100644
--- a/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl
+++ b/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl
@@ -16,8 +16,6 @@
package android.hardware.radio.voice;
-import android.hardware.radio.voice.EmergencyServiceCategory;
-
/**
* Emergency number contains information of number, one or more service category(s), zero or more
* emergency uniform resource names, mobile country code (mcc), mobile network country (mnc) and
diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl
index b25e63d..c05d237 100644
--- a/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl
+++ b/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl
@@ -19,7 +19,6 @@
import android.hardware.radio.voice.CallForwardInfo;
import android.hardware.radio.voice.Dial;
import android.hardware.radio.voice.EmergencyCallRouting;
-import android.hardware.radio.voice.EmergencyServiceCategory;
import android.hardware.radio.voice.IRadioVoiceIndication;
import android.hardware.radio.voice.IRadioVoiceResponse;
import android.hardware.radio.voice.TtyMode;
@@ -45,6 +44,15 @@
void acceptCall(in int serial);
/**
+ * Cancel the current USSD session if one exists.
+ *
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioVoiceResponse.cancelPendingUssdResponse()
+ */
+ void cancelPendingUssd(in int serial);
+
+ /**
* Conference holding and active (like AT+CHLD=3)
*
* @param serial Serial number of request.
@@ -325,6 +333,23 @@
void sendDtmf(in int serial, in String s);
/**
+ * Send a USSD message. If a USSD session already exists, the message must be sent in the
+ * context of that session. Otherwise, a new session must be created. The network reply must be
+ * reported via unsolOnUssd.
+ *
+ * Only one USSD session must exist at a time, and the session is assumed to exist until:
+ * a) The android system invokes cancelUssd()
+ * b) The implementation sends a unsolOnUssd() with a type code of
+ * "0" (USSD-Notify/no further action) or "2" (session terminated)
+ *
+ * @param serial Serial number of request.
+ * @param ussd string containing the USSD request in UTF-8 format
+ *
+ * Response function is IRadioVoiceResponse.sendUssdResponse()
+ */
+ void sendUssd(in int serial, in String ussd);
+
+ /**
* Separate a party from a multiparty call placing the multiparty call (less the specified
* party) on hold and leaving the specified party as the only other member of the current
* (active) call. Like AT+CHLD=2x.
diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl
index 25e87b3..437fef6 100644
--- a/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl
+++ b/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl
@@ -24,6 +24,7 @@
import android.hardware.radio.voice.EmergencyNumber;
import android.hardware.radio.voice.SrvccState;
import android.hardware.radio.voice.StkCcUnsolSsResult;
+import android.hardware.radio.voice.UssdModeType;
/**
* Interface declaring unsolicited radio indications for voice APIs.
@@ -138,6 +139,16 @@
void onSupplementaryServiceIndication(in RadioIndicationType type, in StkCcUnsolSsResult ss);
/**
+ * Indicates when a new USSD message is received. The USSD session is assumed to persist if the
+ * type code is REQUEST, otherwise the current session (if any) is assumed to have terminated.
+ *
+ * @param type Type of radio indication
+ * @param modeType USSD type code
+ * @param msg Message string in UTF-8, if applicable
+ */
+ void onUssd(in RadioIndicationType type, in UssdModeType modeType, in String msg);
+
+ /**
* Indicates that framework/application must reset the uplink mute state.
*
* @param type Type of radio indication
diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl
index d126fc1..cf1b953 100644
--- a/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl
+++ b/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl
@@ -62,6 +62,27 @@
*
* Valid errors returned:
* RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:SIM_BUSY
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:INVALID_STATE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:SYSTEM_ERR
+ * RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ */
+ void cancelPendingUssdResponse(in RadioResponseInfo info);
+
+ /**
+ * @param info Response info struct containing response type, serial no. and error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:NO_MEMORY
* RadioError:MODEM_ERR
@@ -569,6 +590,32 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:FDN_CHECK_FAILURE
+ * RadioError:USSD_MODIFIED_TO_DIAL
+ * RadioError:USSD_MODIFIED_TO_SS
+ * RadioError:USSD_MODIFIED_TO_USSD
+ * RadioError:SIM_BUSY
+ * RadioError:OPERATION_NOT_ALLOWED
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INTERNAL_ERR
+ * RadioError:ABORTED
+ * RadioError:SYSTEM_ERR
+ * RadioError:INVALID_STATE
+ * RadioError:REQUEST_NOT_SUPPORTED
+ * RadioError:INVALID_MODEM_STATE
+ * RadioError:NO_RESOURCES
+ * RadioError:CANCELLED
+ */
+ void sendUssdResponse(in RadioResponseInfo info);
+
+ /**
+ * @param info Response info struct containing response type, serial no. and error
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
* RadioError:INVALID_STATE
* RadioError:NO_RESOURCES
diff --git a/radio/aidl/android/hardware/radio/messaging/UssdModeType.aidl b/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl
similarity index 95%
rename from radio/aidl/android/hardware/radio/messaging/UssdModeType.aidl
rename to radio/aidl/android/hardware/radio/voice/UssdModeType.aidl
index c3c111e..48d1fca 100644
--- a/radio/aidl/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package android.hardware.radio.messaging;
+package android.hardware.radio.voice;
@VintfStability
@Backing(type="int")
diff --git a/radio/aidl/compat/libradiocompat/data/RadioData.cpp b/radio/aidl/compat/libradiocompat/data/RadioData.cpp
index d2f3687..51f5543 100644
--- a/radio/aidl/compat/libradiocompat/data/RadioData.cpp
+++ b/radio/aidl/compat/libradiocompat/data/RadioData.cpp
@@ -122,9 +122,10 @@
return ok();
}
-ScopedAStatus RadioData::setInitialAttachApn(int32_t serial, const aidl::DataProfileInfo& info) {
+ScopedAStatus RadioData::setInitialAttachApn(int32_t serial,
+ const std::optional<aidl::DataProfileInfo>& info) {
LOG_CALL << serial;
- mHal1_5->setInitialAttachApn_1_5(serial, toHidl(info));
+ mHal1_5->setInitialAttachApn_1_5(serial, toHidl(info.value()));
return ok();
}
@@ -136,14 +137,15 @@
return ok();
}
-ScopedAStatus RadioData::setupDataCall( //
- int32_t serial, aidlCommon::AccessNetwork accessNetwork,
- const aidl::DataProfileInfo& dataProfileInfo, bool roamingAllowed,
- aidl::DataRequestReason reason, const std::vector<aidl::LinkAddress>& addresses,
- const std::vector<std::string>& dnses, int32_t pduSessId,
- const std::optional<aidl::SliceInfo>& sliceInfo, bool matchAllRuleAllowed) {
+ScopedAStatus RadioData::setupDataCall(int32_t serial, aidlCommon::AccessNetwork accessNetwork,
+ const aidl::DataProfileInfo& dataProfileInfo,
+ bool roamingAllowed, aidl::DataRequestReason reason,
+ const std::vector<aidl::LinkAddress>& addresses,
+ const std::vector<std::string>& dnses, int32_t pduSessId,
+ const std::optional<aidl::SliceInfo>& sliceInfo,
+ bool matchAllRuleAllowed) {
if (mHal1_6) {
- mHal1_6->setupDataCall_1_6( //
+ mHal1_6->setupDataCall_1_6(
serial, V1_5::AccessNetwork(accessNetwork), toHidl(dataProfileInfo), roamingAllowed,
V1_2::DataRequestReason(reason), toHidl(addresses), toHidl(dnses), pduSessId,
toHidl<V1_6::OptionalSliceInfo>(sliceInfo),
@@ -151,7 +153,7 @@
matchAllRuleAllowed);
mContext->addDataProfile(dataProfileInfo);
} else {
- mHal1_5->setupDataCall_1_5( //
+ mHal1_5->setupDataCall_1_5(
serial, V1_5::AccessNetwork(accessNetwork), toHidl(dataProfileInfo), roamingAllowed,
V1_2::DataRequestReason(reason), toHidl(addresses), toHidl(dnses));
}
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
index bbfff61..89ddea0 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
@@ -39,8 +39,6 @@
const sp<RadioConfigResponse> mRadioConfigResponse;
const sp<RadioConfigIndication> mRadioConfigIndication;
- std::shared_ptr<::aidl::android::hardware::radio::config::IRadioConfigResponse> respond();
-
::ndk::ScopedAStatus getHalDeviceCapabilities(int32_t serial) override;
::ndk::ScopedAStatus getNumOfLiveModems(int32_t serial) override;
::ndk::ScopedAStatus getPhoneCapability(int32_t serial) override;
@@ -57,6 +55,9 @@
const std::vector<aidl::android::hardware::radio::config::SlotPortMapping>& slotMap)
override;
+ protected:
+ std::shared_ptr<::aidl::android::hardware::radio::config::IRadioConfigResponse> respond();
+
public:
/**
* Constructs AIDL IRadioConfig instance wrapping existing HIDL IRadioConfig instance.
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h
index c617ec2..da19811 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h
@@ -22,8 +22,6 @@
namespace android::hardware::radio::compat {
class RadioData : public RadioCompatBase, public aidl::android::hardware::radio::data::BnRadioData {
- std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> respond();
-
::ndk::ScopedAStatus allocatePduSessionId(int32_t serial) override;
::ndk::ScopedAStatus cancelHandover(int32_t serial, int32_t callId) override;
::ndk::ScopedAStatus deactivateDataCall(
@@ -44,7 +42,8 @@
int64_t completionDurationMillis) override;
::ndk::ScopedAStatus setInitialAttachApn(
int32_t serial,
- const ::aidl::android::hardware::radio::data::DataProfileInfo& dpInfo) override;
+ const std::optional<::aidl::android::hardware::radio::data::DataProfileInfo>& dpInfo)
+ override;
::ndk::ScopedAStatus setResponseFunctions(
const std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse>&
radioDataResponse,
@@ -64,6 +63,9 @@
const ::aidl::android::hardware::radio::data::KeepaliveRequest& keepalive) override;
::ndk::ScopedAStatus stopKeepalive(int32_t serial, int32_t sessionHandle) override;
+ protected:
+ std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> respond();
+
public:
using RadioCompatBase::RadioCompatBase;
};
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h
index 419e9fb..1af406a 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h
@@ -23,8 +23,6 @@
class RadioMessaging : public RadioCompatBase,
public aidl::android::hardware::radio::messaging::BnRadioMessaging {
- std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> respond();
-
::ndk::ScopedAStatus acknowledgeIncomingGsmSmsWithPdu(int32_t serial, bool success,
const std::string& ackPdu) override;
::ndk::ScopedAStatus acknowledgeLastIncomingCdmaSms(
@@ -33,7 +31,6 @@
::ndk::ScopedAStatus acknowledgeLastIncomingGsmSms(
int32_t serial, bool success,
::aidl::android::hardware::radio::messaging::SmsAcknowledgeFailCause cause) override;
- ::ndk::ScopedAStatus cancelPendingUssd(int32_t serial) override;
::ndk::ScopedAStatus deleteSmsOnRuim(int32_t serial, int32_t index) override;
::ndk::ScopedAStatus deleteSmsOnSim(int32_t serial, int32_t index) override;
::ndk::ScopedAStatus getCdmaBroadcastConfig(int32_t serial) override;
@@ -56,7 +53,6 @@
::ndk::ScopedAStatus sendSmsExpectMore(
int32_t serial,
const ::aidl::android::hardware::radio::messaging::GsmSmsMessage& message) override;
- ::ndk::ScopedAStatus sendUssd(int32_t serial, const std::string& ussd) override;
::ndk::ScopedAStatus setCdmaBroadcastActivation(int32_t serial, bool activate) override;
::ndk::ScopedAStatus setCdmaBroadcastConfig(
int32_t serial,
@@ -84,6 +80,9 @@
int32_t serial,
const ::aidl::android::hardware::radio::messaging::SmsWriteArgs& smsWriteArgs) override;
+ protected:
+ std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> respond();
+
public:
using RadioCompatBase::RadioCompatBase;
};
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h
index fdca124..beb1fb0 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h
@@ -23,8 +23,6 @@
class RadioModem : public RadioCompatBase,
public aidl::android::hardware::radio::modem::BnRadioModem {
- std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> respond();
-
::ndk::ScopedAStatus enableModem(int32_t serial, bool on) override;
::ndk::ScopedAStatus getBasebandVersion(int32_t serial) override;
::ndk::ScopedAStatus getDeviceIdentity(int32_t serial) override;
@@ -54,6 +52,9 @@
const std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemIndication>&
radioModemIndication) override;
+ protected:
+ std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> respond();
+
public:
using RadioCompatBase::RadioCompatBase;
};
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h
index 1731b78..9784665 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h
@@ -23,8 +23,6 @@
class RadioNetwork : public RadioCompatBase,
public aidl::android::hardware::radio::network::BnRadioNetwork {
- std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> respond();
-
::ndk::ScopedAStatus getAllowedNetworkTypesBitmap(int32_t serial) override;
::ndk::ScopedAStatus getAvailableBandModes(int32_t serial) override;
::ndk::ScopedAStatus getAvailableNetworks(int32_t serial) override;
@@ -92,6 +90,9 @@
::aidl::android::hardware::radio::network::UsageSetting usageSetting) override;
::ndk::ScopedAStatus getUsageSetting(int32_t serial) override;
+ protected:
+ std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> respond();
+
public:
using RadioCompatBase::RadioCompatBase;
};
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h
index 84bb68b..ff91aef 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h
@@ -22,8 +22,6 @@
namespace android::hardware::radio::compat {
class RadioSim : public RadioCompatBase, public aidl::android::hardware::radio::sim::BnRadioSim {
- std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> respond();
-
::ndk::ScopedAStatus areUiccApplicationsEnabled(int32_t serial) override;
::ndk::ScopedAStatus changeIccPin2ForApp(int32_t serial, const std::string& oldPin2,
const std::string& newPin2,
@@ -102,6 +100,9 @@
int32_t serial,
const ::aidl::android::hardware::radio::sim::PhonebookRecordInfo& recordInfo) override;
+ protected:
+ std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> respond();
+
public:
using RadioCompatBase::RadioCompatBase;
};
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h
index a0e1e82..7bc998e 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h
@@ -23,9 +23,8 @@
class RadioVoice : public RadioCompatBase,
public aidl::android::hardware::radio::voice::BnRadioVoice {
- std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> respond();
-
::ndk::ScopedAStatus acceptCall(int32_t serial) override;
+ ::ndk::ScopedAStatus cancelPendingUssd(int32_t serial) override;
::ndk::ScopedAStatus conference(int32_t serial) override;
::ndk::ScopedAStatus dial(
int32_t serial, const ::aidl::android::hardware::radio::voice::Dial& dialInfo) override;
@@ -58,6 +57,7 @@
int32_t off) override;
::ndk::ScopedAStatus sendCdmaFeatureCode(int32_t serial, const std::string& fcode) override;
::ndk::ScopedAStatus sendDtmf(int32_t serial, const std::string& s) override;
+ ::ndk::ScopedAStatus sendUssd(int32_t serial, const std::string& ussd) override;
::ndk::ScopedAStatus separateConnection(int32_t serial, int32_t gsmIndex) override;
::ndk::ScopedAStatus setCallForward(
int32_t serial,
@@ -78,6 +78,9 @@
::ndk::ScopedAStatus stopDtmf(int32_t serial) override;
::ndk::ScopedAStatus switchWaitingOrHoldingAndActive(int32_t serial) override;
+ protected:
+ std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> respond();
+
public:
using RadioCompatBase::RadioCompatBase;
};
diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp
index e5c33b3..eb87828 100644
--- a/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp
+++ b/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp
@@ -73,13 +73,6 @@
return {};
}
-Return<void> RadioIndication::onUssd(V1_0::RadioIndicationType type, V1_0::UssdModeType modeType,
- const hidl_string& msg) {
- LOG_CALL << type;
- messagingCb()->onUssd(toAidl(type), aidl::UssdModeType(modeType), msg);
- return {};
-}
-
Return<void> RadioIndication::simSmsStorageFull(V1_0::RadioIndicationType type) {
LOG_CALL << type;
messagingCb()->simSmsStorageFull(toAidl(type));
diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp
index 4d94e17..56d49f1 100644
--- a/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp
+++ b/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp
@@ -54,12 +54,6 @@
return ok();
}
-ScopedAStatus RadioMessaging::cancelPendingUssd(int32_t serial) {
- LOG_CALL << serial;
- mHal1_5->cancelPendingUssd(serial);
- return ok();
-}
-
ScopedAStatus RadioMessaging::deleteSmsOnRuim(int32_t serial, int32_t index) {
LOG_CALL << serial << ' ' << index;
mHal1_5->deleteSmsOnRuim(serial, index);
@@ -148,12 +142,6 @@
return ok();
}
-ScopedAStatus RadioMessaging::sendUssd(int32_t serial, const std::string& ussd) {
- LOG_CALL << serial << ' ' << ussd;
- mHal1_5->sendUssd(serial, ussd);
- return ok();
-}
-
ScopedAStatus RadioMessaging::setCdmaBroadcastActivation(int32_t serial, bool activate) {
LOG_CALL << serial << ' ' << activate;
mHal1_5->setCdmaBroadcastActivation(serial, activate);
diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp
index 24ad3d7..7a9273f 100644
--- a/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp
+++ b/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp
@@ -57,12 +57,6 @@
return {};
}
-Return<void> RadioResponse::cancelPendingUssdResponse(const V1_0::RadioResponseInfo& info) {
- LOG_CALL << info.serial;
- messagingCb()->cancelPendingUssdResponse(toAidl(info));
- return {};
-}
-
Return<void> RadioResponse::deleteSmsOnRuimResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
messagingCb()->deleteSmsOnRuimResponse(toAidl(info));
@@ -166,12 +160,6 @@
return {};
}
-Return<void> RadioResponse::sendUssdResponse(const V1_0::RadioResponseInfo& info) {
- LOG_CALL << info.serial;
- messagingCb()->sendUssdResponse(toAidl(info));
- return {};
-}
-
Return<void> RadioResponse::setCdmaBroadcastActivationResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
diff --git a/radio/aidl/compat/libradiocompat/network/structs.cpp b/radio/aidl/compat/libradiocompat/network/structs.cpp
index 87a021f..c1d9b35 100644
--- a/radio/aidl/compat/libradiocompat/network/structs.cpp
+++ b/radio/aidl/compat/libradiocompat/network/structs.cpp
@@ -650,13 +650,6 @@
};
}
-aidl::NeighboringCell toAidl(const V1_0::NeighboringCell& cell) {
- return {
- .cid = cell.cid,
- .rssi = cell.rssi,
- };
-}
-
aidl::LceDataInfo toAidl(const V1_0::LceDataInfo& info) {
return {
.lastHopCapacityKbps = static_cast<int32_t>(info.lastHopCapacityKbps),
diff --git a/radio/aidl/compat/libradiocompat/network/structs.h b/radio/aidl/compat/libradiocompat/network/structs.h
index 854cb38..aaa49a0 100644
--- a/radio/aidl/compat/libradiocompat/network/structs.h
+++ b/radio/aidl/compat/libradiocompat/network/structs.h
@@ -20,7 +20,6 @@
#include <aidl/android/hardware/radio/network/CellInfo.h>
#include <aidl/android/hardware/radio/network/LceDataInfo.h>
#include <aidl/android/hardware/radio/network/LinkCapacityEstimate.h>
-#include <aidl/android/hardware/radio/network/NeighboringCell.h>
#include <aidl/android/hardware/radio/network/NetworkScanRequest.h>
#include <aidl/android/hardware/radio/network/NetworkScanResult.h>
#include <aidl/android/hardware/radio/network/OperatorInfo.h>
@@ -92,8 +91,6 @@
::aidl::android::hardware::radio::network::RegStateResult toAidl(const V1_5::RegStateResult& res);
::aidl::android::hardware::radio::network::RegStateResult toAidl(const V1_6::RegStateResult& res);
-::aidl::android::hardware::radio::network::NeighboringCell toAidl(const V1_0::NeighboringCell& c);
-
::aidl::android::hardware::radio::network::LceDataInfo toAidl(const V1_0::LceDataInfo& info);
} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp
index 359fce0..23878ed 100644
--- a/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp
+++ b/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp
@@ -102,6 +102,13 @@
return {};
}
+Return<void> RadioIndication::onUssd(V1_0::RadioIndicationType type, V1_0::UssdModeType modeType,
+ const hidl_string& msg) {
+ LOG_CALL << type;
+ voiceCb()->onUssd(toAidl(type), aidl::UssdModeType(modeType), msg);
+ return {};
+}
+
Return<void> RadioIndication::resendIncallMute(V1_0::RadioIndicationType type) {
LOG_CALL << type;
voiceCb()->resendIncallMute(toAidl(type));
diff --git a/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp
index d233548..5307e11 100644
--- a/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp
+++ b/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp
@@ -42,6 +42,12 @@
return {};
}
+Return<void> RadioResponse::cancelPendingUssdResponse(const V1_0::RadioResponseInfo& info) {
+ LOG_CALL << info.serial;
+ voiceCb()->cancelPendingUssdResponse(toAidl(info));
+ return {};
+}
+
Return<void> RadioResponse::conferenceResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
voiceCb()->conferenceResponse(toAidl(info));
@@ -198,6 +204,12 @@
return {};
}
+Return<void> RadioResponse::sendUssdResponse(const V1_0::RadioResponseInfo& info) {
+ LOG_CALL << info.serial;
+ voiceCb()->sendUssdResponse(toAidl(info));
+ return {};
+}
+
Return<void> RadioResponse::separateConnectionResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
voiceCb()->separateConnectionResponse(toAidl(info));
diff --git a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp
index 71d1a56..9088f01 100644
--- a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp
+++ b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp
@@ -40,6 +40,12 @@
return ok();
}
+ScopedAStatus RadioVoice::cancelPendingUssd(int32_t serial) {
+ LOG_CALL << serial;
+ mHal1_5->cancelPendingUssd(serial);
+ return ok();
+}
+
ScopedAStatus RadioVoice::conference(int32_t serial) {
LOG_CALL << serial;
mHal1_5->conference(serial);
@@ -201,6 +207,12 @@
return ok();
}
+ScopedAStatus RadioVoice::sendUssd(int32_t serial, const std::string& ussd) {
+ LOG_CALL << serial << ' ' << ussd;
+ mHal1_5->sendUssd(serial, ussd);
+ return ok();
+}
+
ScopedAStatus RadioVoice::separateConnection(int32_t serial, int32_t gsmIndex) {
LOG_CALL << serial;
mHal1_5->separateConnection(serial, gsmIndex);
diff --git a/radio/aidl/vts/OWNERS b/radio/aidl/vts/OWNERS
new file mode 100644
index 0000000..e75c6c8
--- /dev/null
+++ b/radio/aidl/vts/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 20868
+include ../../1.0/vts/OWNERS
+
diff --git a/radio/aidl/vts/radio_config_response.cpp b/radio/aidl/vts/radio_config_response.cpp
index 1a152fb..8d81605 100644
--- a/radio/aidl/vts/radio_config_response.cpp
+++ b/radio/aidl/vts/radio_config_response.cpp
@@ -19,12 +19,15 @@
RadioConfigResponse::RadioConfigResponse(RadioServiceTest& parent) : parent_config(parent) {}
ndk::ScopedAStatus RadioConfigResponse::getSimSlotsStatusResponse(
- const RadioResponseInfo& /* info */, const std::vector<SimSlotStatus>& /* slotStatus */) {
+ const RadioResponseInfo& info, const std::vector<SimSlotStatus>& /* slotStatus */) {
+ rspInfo = info;
+ parent_config.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioConfigResponse::setSimSlotsMappingResponse(
- const RadioResponseInfo& /* info */) {
+ndk::ScopedAStatus RadioConfigResponse::setSimSlotsMappingResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_config.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -37,22 +40,28 @@
}
ndk::ScopedAStatus RadioConfigResponse::setPreferredDataModemResponse(
- const RadioResponseInfo& /* info */) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_config.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioConfigResponse::getNumOfLiveModemsResponse(
- const RadioResponseInfo& /* info */, const int8_t /* numOfLiveModems */) {
+ const RadioResponseInfo& info, const int8_t /* numOfLiveModems */) {
+ rspInfo = info;
+ parent_config.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioConfigResponse::setNumOfLiveModemsResponse(
- const RadioResponseInfo& /* info */) {
+ndk::ScopedAStatus RadioConfigResponse::setNumOfLiveModemsResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_config.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioConfigResponse::getHalDeviceCapabilitiesResponse(
const RadioResponseInfo& info, bool modemReducedFeatures) {
+ rspInfo = info;
modemReducedFeatureSet1 = modemReducedFeatures;
parent_config.notify(info.serial);
return ndk::ScopedAStatus::ok();
diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp
index 2d7fe01..a271b8a 100644
--- a/radio/aidl/vts/radio_config_test.cpp
+++ b/radio/aidl/vts/radio_config_test.cpp
@@ -54,3 +54,102 @@
ALOGI("getHalDeviceCapabilities, rspInfo.error = %s\n",
toString(radioRsp_config->rspInfo.error).c_str());
}
+
+/*
+ * Test IRadioConfig.getSimSlotsStatus() for the response returned.
+ */
+TEST_P(RadioConfigTest, getSimSlotsStatus) {
+ serial = GetRandomSerialNumber();
+ ndk::ScopedAStatus res = radio_config->getSimSlotsStatus(serial);
+ ASSERT_OK(res);
+ ALOGI("getSimSlotsStatus, rspInfo.error = %s\n",
+ toString(radioRsp_config->rspInfo.error).c_str());
+}
+
+/*
+ * Test IRadioConfig.getPhoneCapability() for the response returned.
+ */
+TEST_P(RadioConfigTest, getPhoneCapability) {
+ serial = GetRandomSerialNumber();
+ ndk::ScopedAStatus res = radio_config->getPhoneCapability(serial);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_config->rspInfo.serial);
+ ALOGI("getPhoneCapability, rspInfo.error = %s\n",
+ toString(radioRsp_config->rspInfo.error).c_str());
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_config->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR}));
+
+ if (radioRsp_config->rspInfo.error == RadioError ::NONE) {
+ // maxActiveData should be greater than or equal to maxActiveInternetData.
+ EXPECT_GE(radioRsp_config->phoneCap.maxActiveData,
+ radioRsp_config->phoneCap.maxActiveInternetData);
+ // maxActiveData and maxActiveInternetData should be 0 or positive numbers.
+ EXPECT_GE(radioRsp_config->phoneCap.maxActiveInternetData, 0);
+ }
+}
+
+/*
+ * Test IRadioConfig.setPreferredDataModem() for the response returned.
+ */
+TEST_P(RadioConfigTest, setPreferredDataModem) {
+ serial = GetRandomSerialNumber();
+ ndk::ScopedAStatus res = radio_config->getPhoneCapability(serial);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_config->rspInfo.serial);
+ ALOGI("getPhoneCapability, rspInfo.error = %s\n",
+ toString(radioRsp_config->rspInfo.error).c_str());
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_config->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR}));
+
+ if (radioRsp_config->rspInfo.error != RadioError ::NONE) {
+ return;
+ }
+
+ if (radioRsp_config->phoneCap.logicalModemIds.size() == 0) {
+ return;
+ }
+
+ // We get phoneCapability. Send setPreferredDataModem command
+ serial = GetRandomSerialNumber();
+ uint8_t modemId = radioRsp_config->phoneCap.logicalModemIds[0];
+ res = radio_config->setPreferredDataModem(serial, modemId);
+
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_config->rspInfo.serial);
+ ALOGI("setPreferredDataModem, rspInfo.error = %s\n",
+ toString(radioRsp_config->rspInfo.error).c_str());
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_config->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR}));
+}
+
+/*
+ * Test IRadioConfig.setPreferredDataModem() with invalid arguments.
+ */
+TEST_P(RadioConfigTest, setPreferredDataModem_invalidArgument) {
+ serial = GetRandomSerialNumber();
+ uint8_t modemId = -1;
+ ndk::ScopedAStatus res = radio_config->setPreferredDataModem(serial, modemId);
+
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_config->rspInfo.serial);
+ ALOGI("setPreferredDataModem, rspInfo.error = %s\n",
+ toString(radioRsp_config->rspInfo.error).c_str());
+
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_config->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::INTERNAL_ERR}));
+}
diff --git a/radio/aidl/vts/radio_data_response.cpp b/radio/aidl/vts/radio_data_response.cpp
index 9b17bfb..8d51760 100644
--- a/radio/aidl/vts/radio_data_response.cpp
+++ b/radio/aidl/vts/radio_data_response.cpp
@@ -36,8 +36,9 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioDataResponse::deactivateDataCallResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioDataResponse::deactivateDataCallResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_data.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -61,11 +62,15 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioDataResponse::setDataAllowedResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioDataResponse::setDataAllowedResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_data.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioDataResponse::setDataProfileResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioDataResponse::setDataProfileResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_data.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -75,8 +80,9 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioDataResponse::setInitialAttachApnResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioDataResponse::setInitialAttachApnResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_data.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -94,11 +100,15 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioDataResponse::startKeepaliveResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioDataResponse::startKeepaliveResponse(const RadioResponseInfo& info,
const KeepaliveStatus& /*status*/) {
+ rspInfo = info;
+ parent_data.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioDataResponse::stopKeepaliveResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioDataResponse::stopKeepaliveResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_data.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
diff --git a/radio/aidl/vts/radio_data_test.cpp b/radio/aidl/vts/radio_data_test.cpp
index 8547e9d..f38a958 100644
--- a/radio/aidl/vts/radio_data_test.cpp
+++ b/radio/aidl/vts/radio_data_test.cpp
@@ -83,7 +83,7 @@
dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP;
dataProfileInfo.user = std::string("username");
dataProfileInfo.password = std::string("password");
- dataProfileInfo.type = DataProfileInfo::TYPE_THREE_GPP;
+ dataProfileInfo.type = DataProfileInfo::TYPE_3GPP;
dataProfileInfo.maxConnsTime = 300;
dataProfileInfo.maxConns = 20;
dataProfileInfo.waitTime = 0;
@@ -157,7 +157,7 @@
dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP;
dataProfileInfo.user = std::string("username");
dataProfileInfo.password = std::string("password");
- dataProfileInfo.type = DataProfileInfo::TYPE_THREE_GPP;
+ dataProfileInfo.type = DataProfileInfo::TYPE_3GPP;
dataProfileInfo.maxConnsTime = 300;
dataProfileInfo.maxConns = 20;
dataProfileInfo.waitTime = 0;
@@ -309,3 +309,280 @@
sleep(1);
}
+
+/*
+ * Test IRadioData.setInitialAttachApn() for the response returned.
+ */
+TEST_P(RadioDataTest, setInitialAttachApn) {
+ serial = GetRandomSerialNumber();
+
+ // Create a dataProfileInfo
+ DataProfileInfo dataProfileInfo;
+ memset(&dataProfileInfo, 0, sizeof(dataProfileInfo));
+ dataProfileInfo.profileId = DataProfileInfo::ID_DEFAULT;
+ dataProfileInfo.apn = std::string("internet");
+ dataProfileInfo.protocol = PdpProtocolType::IPV4V6;
+ dataProfileInfo.roamingProtocol = PdpProtocolType::IPV4V6;
+ dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP;
+ dataProfileInfo.user = std::string("username");
+ dataProfileInfo.password = std::string("password");
+ dataProfileInfo.type = DataProfileInfo::TYPE_3GPP;
+ dataProfileInfo.maxConnsTime = 300;
+ dataProfileInfo.maxConns = 20;
+ dataProfileInfo.waitTime = 0;
+ dataProfileInfo.enabled = true;
+ dataProfileInfo.supportedApnTypesBitmap = 320;
+ dataProfileInfo.bearerBitmap = 161543;
+ dataProfileInfo.mtuV4 = 0;
+ dataProfileInfo.mtuV6 = 0;
+ dataProfileInfo.preferred = true;
+ dataProfileInfo.persistent = false;
+
+ radio_data->setInitialAttachApn(serial, dataProfileInfo);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE}));
+ }
+}
+
+/*
+ * Test IRadioData.setDataProfile() for the response returned.
+ */
+TEST_P(RadioDataTest, setDataProfile) {
+ serial = GetRandomSerialNumber();
+
+ // Create a dataProfileInfo
+ DataProfileInfo dataProfileInfo;
+ memset(&dataProfileInfo, 0, sizeof(dataProfileInfo));
+ dataProfileInfo.profileId = DataProfileInfo::ID_DEFAULT;
+ dataProfileInfo.apn = std::string("internet");
+ dataProfileInfo.protocol = PdpProtocolType::IPV4V6;
+ dataProfileInfo.roamingProtocol = PdpProtocolType::IPV4V6;
+ dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP;
+ dataProfileInfo.user = std::string("username");
+ dataProfileInfo.password = std::string("password");
+ dataProfileInfo.type = DataProfileInfo::TYPE_3GPP;
+ dataProfileInfo.maxConnsTime = 300;
+ dataProfileInfo.maxConns = 20;
+ dataProfileInfo.waitTime = 0;
+ dataProfileInfo.enabled = true;
+ dataProfileInfo.supportedApnTypesBitmap = 320;
+ dataProfileInfo.bearerBitmap = 161543;
+ dataProfileInfo.mtuV4 = 0;
+ dataProfileInfo.mtuV6 = 0;
+ dataProfileInfo.preferred = true;
+ dataProfileInfo.persistent = true;
+
+ // Create a dataProfileInfoList
+ std::vector<DataProfileInfo> dataProfileInfoList = {dataProfileInfo};
+
+ radio_data->setDataProfile(serial, dataProfileInfoList);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE}));
+ }
+}
+
+/*
+ * Test IRadioData.deactivateDataCall() for the response returned.
+ */
+TEST_P(RadioDataTest, deactivateDataCall) {
+ serial = GetRandomSerialNumber();
+ int cid = 1;
+ DataRequestReason reason = DataRequestReason::NORMAL;
+
+ ndk::ScopedAStatus res = radio_data->deactivateDataCall(serial, cid, reason);
+ ASSERT_OK(res);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::INVALID_CALL_ID, RadioError::INVALID_STATE,
+ RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED,
+ RadioError::CANCELLED, RadioError::SIM_ABSENT}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_data->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_CALL_ID,
+ RadioError::INVALID_STATE, RadioError::INVALID_ARGUMENTS,
+ RadioError::REQUEST_NOT_SUPPORTED, RadioError::CANCELLED}));
+ }
+}
+
+/*
+ * Test IRadioData.startKeepalive() for the response returned.
+ */
+TEST_P(RadioDataTest, startKeepalive) {
+ std::vector<KeepaliveRequest> requests = {
+ {
+ // Invalid IPv4 source address
+ KeepaliveRequest::TYPE_NATT_IPV4,
+ {192, 168, 0 /*, 100*/},
+ 1234,
+ {8, 8, 4, 4},
+ 4500,
+ 20000,
+ 0xBAD,
+ },
+ {
+ // Invalid IPv4 destination address
+ KeepaliveRequest::TYPE_NATT_IPV4,
+ {192, 168, 0, 100},
+ 1234,
+ {8, 8, 4, 4, 1, 2, 3, 4},
+ 4500,
+ 20000,
+ 0xBAD,
+ },
+ {
+ // Invalid Keepalive Type
+ -1,
+ {192, 168, 0, 100},
+ 1234,
+ {8, 8, 4, 4},
+ 4500,
+ 20000,
+ 0xBAD,
+ },
+ {
+ // Invalid IPv6 source address
+ KeepaliveRequest::TYPE_NATT_IPV6,
+ {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE,
+ 0xED, 0xBE, 0xEF, 0xBD},
+ 1234,
+ {0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x88, 0x44},
+ 4500,
+ 20000,
+ 0xBAD,
+ },
+ {
+ // Invalid IPv6 destination address
+ KeepaliveRequest::TYPE_NATT_IPV6,
+ {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE,
+ 0xED, 0xBE, 0xEF},
+ 1234,
+ {0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x88,
+ /*0x44*/},
+ 4500,
+ 20000,
+ 0xBAD,
+ },
+ {
+ // Invalid Context ID (cid), this should survive the initial
+ // range checking and fail in the modem data layer
+ KeepaliveRequest::TYPE_NATT_IPV4,
+ {192, 168, 0, 100},
+ 1234,
+ {8, 8, 4, 4},
+ 4500,
+ 20000,
+ 0xBAD,
+ },
+ {
+ // Invalid Context ID (cid), this should survive the initial
+ // range checking and fail in the modem data layer
+ KeepaliveRequest::TYPE_NATT_IPV6,
+ {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE,
+ 0xED, 0xBE, 0xEF},
+ 1234,
+ {0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x88, 0x44},
+ 4500,
+ 20000,
+ 0xBAD,
+ }};
+
+ for (auto req = requests.begin(); req != requests.end(); req++) {
+ serial = GetRandomSerialNumber();
+ radio_data->startKeepalive(serial, *req);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_data->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_ARGUMENTS,
+ RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+}
+
+/*
+ * Test IRadioData.stopKeepalive() for the response returned.
+ */
+TEST_P(RadioDataTest, stopKeepalive) {
+ serial = GetRandomSerialNumber();
+
+ radio_data->stopKeepalive(serial, 0xBAD);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
+
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+}
+
+/*
+ * Test IRadioData.getDataCallList() for the response returned.
+ */
+TEST_P(RadioDataTest, getDataCallList) {
+ LOG(DEBUG) << "getDataCallList";
+ serial = GetRandomSerialNumber();
+
+ radio_data->getDataCallList(serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_data->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ABSENT}));
+ }
+ LOG(DEBUG) << "getDataCallList finished";
+}
+
+/*
+ * Test IRadioData.setDataAllowed() for the response returned.
+ */
+TEST_P(RadioDataTest, setDataAllowed) {
+ LOG(DEBUG) << "setDataAllowed";
+ serial = GetRandomSerialNumber();
+ bool allow = true;
+
+ radio_data->setDataAllowed(serial, allow);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp_data->rspInfo.error);
+ }
+ LOG(DEBUG) << "setDataAllowed finished";
+}
diff --git a/radio/aidl/vts/radio_messaging_indication.cpp b/radio/aidl/vts/radio_messaging_indication.cpp
index c69611f..481239e 100644
--- a/radio/aidl/vts/radio_messaging_indication.cpp
+++ b/radio/aidl/vts/radio_messaging_indication.cpp
@@ -48,12 +48,6 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioMessagingIndication::onUssd(RadioIndicationType /*type*/,
- UssdModeType /*modeType*/,
- const std::string& /*msg*/) {
- return ndk::ScopedAStatus::ok();
-}
-
ndk::ScopedAStatus RadioMessagingIndication::simSmsStorageFull(RadioIndicationType /*type*/) {
return ndk::ScopedAStatus::ok();
}
diff --git a/radio/aidl/vts/radio_messaging_response.cpp b/radio/aidl/vts/radio_messaging_response.cpp
index 718df7e..49c0806 100644
--- a/radio/aidl/vts/radio_messaging_response.cpp
+++ b/radio/aidl/vts/radio_messaging_response.cpp
@@ -20,17 +20,23 @@
: parent_messaging(parent) {}
ndk::ScopedAStatus RadioMessagingResponse::acknowledgeIncomingGsmSmsWithPduResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingCdmaSmsResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingGsmSmsResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -38,40 +44,43 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioMessagingResponse::cancelPendingUssdResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnRuimResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnRuimResponse(
- const RadioResponseInfo& /*info*/) {
- return ndk::ScopedAStatus::ok();
-}
-
-ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnSimResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnSimResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioMessagingResponse::getCdmaBroadcastConfigResponse(
- const RadioResponseInfo& /*info*/,
- const std::vector<CdmaBroadcastSmsConfigInfo>& /*configs*/) {
+ const RadioResponseInfo& info, const std::vector<CdmaBroadcastSmsConfigInfo>& /*configs*/) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioMessagingResponse::getGsmBroadcastConfigResponse(
- const RadioResponseInfo& /*info*/,
- const std::vector<GsmBroadcastSmsConfigInfo>& /*configs*/) {
+ const RadioResponseInfo& info, const std::vector<GsmBroadcastSmsConfigInfo>& /*configs*/) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioMessagingResponse::getSmscAddressResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioMessagingResponse::getSmscAddressResponse(const RadioResponseInfo& info,
const std::string& /*smsc*/) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioMessagingResponse::reportSmsMemoryStatusResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -91,8 +100,10 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioMessagingResponse::sendImsSmsResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioMessagingResponse::sendImsSmsResponse(const RadioResponseInfo& info,
const SendSmsResult& /*sms*/) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -112,41 +123,50 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioMessagingResponse::sendUssdResponse(const RadioResponseInfo& /*info*/) {
- return ndk::ScopedAStatus::ok();
-}
-
ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastActivationResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastConfigResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastActivationResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastConfigResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioMessagingResponse::setSmscAddressResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioMessagingResponse::setSmscAddressResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioMessagingResponse::writeSmsToRuimResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioMessagingResponse::writeSmsToRuimResponse(const RadioResponseInfo& info,
int32_t /*index*/) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioMessagingResponse::writeSmsToSimResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioMessagingResponse::writeSmsToSimResponse(const RadioResponseInfo& info,
int32_t /*index*/) {
+ rspInfo = info;
+ parent_messaging.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
diff --git a/radio/aidl/vts/radio_messaging_test.cpp b/radio/aidl/vts/radio_messaging_test.cpp
index 8abd91d..9f1718b 100644
--- a/radio/aidl/vts/radio_messaging_test.cpp
+++ b/radio/aidl/vts/radio_messaging_test.cpp
@@ -197,3 +197,535 @@
CHECK_GENERAL_ERROR));
}
}
+
+/*
+ * Test IRadioMessaging.setGsmBroadcastConfig() for the response returned.
+ */
+TEST_P(RadioMessagingTest, setGsmBroadcastConfig) {
+ LOG(DEBUG) << "setGsmBroadcastConfig";
+ serial = GetRandomSerialNumber();
+
+ // Create GsmBroadcastSmsConfigInfo #1
+ GsmBroadcastSmsConfigInfo gbSmsConfig1;
+ gbSmsConfig1.fromServiceId = 4352;
+ gbSmsConfig1.toServiceId = 4354;
+ gbSmsConfig1.fromCodeScheme = 0;
+ gbSmsConfig1.toCodeScheme = 255;
+ gbSmsConfig1.selected = true;
+
+ // Create GsmBroadcastSmsConfigInfo #2
+ GsmBroadcastSmsConfigInfo gbSmsConfig2;
+ gbSmsConfig2.fromServiceId = 4356;
+ gbSmsConfig2.toServiceId = 4356;
+ gbSmsConfig2.fromCodeScheme = 0;
+ gbSmsConfig2.toCodeScheme = 255;
+ gbSmsConfig2.selected = true;
+
+ // Create GsmBroadcastSmsConfigInfo #3
+ GsmBroadcastSmsConfigInfo gbSmsConfig3;
+ gbSmsConfig3.fromServiceId = 4370;
+ gbSmsConfig3.toServiceId = 4379;
+ gbSmsConfig3.fromCodeScheme = 0;
+ gbSmsConfig3.toCodeScheme = 255;
+ gbSmsConfig3.selected = true;
+
+ // Create GsmBroadcastSmsConfigInfo #4
+ GsmBroadcastSmsConfigInfo gbSmsConfig4;
+ gbSmsConfig4.fromServiceId = 4383;
+ gbSmsConfig4.toServiceId = 4391;
+ gbSmsConfig4.fromCodeScheme = 0;
+ gbSmsConfig4.toCodeScheme = 255;
+ gbSmsConfig4.selected = true;
+
+ // Create GsmBroadcastSmsConfigInfo #5
+ GsmBroadcastSmsConfigInfo gbSmsConfig5;
+ gbSmsConfig5.fromServiceId = 4392;
+ gbSmsConfig5.toServiceId = 4392;
+ gbSmsConfig5.fromCodeScheme = 0;
+ gbSmsConfig5.toCodeScheme = 255;
+ gbSmsConfig5.selected = true;
+
+ std::vector<GsmBroadcastSmsConfigInfo> gsmBroadcastSmsConfigsInfoList = {
+ gbSmsConfig1, gbSmsConfig2, gbSmsConfig3, gbSmsConfig4, gbSmsConfig5};
+
+ radio_messaging->setGsmBroadcastConfig(serial, gsmBroadcastSmsConfigsInfoList);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
+ RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "setGsmBroadcastConfig finished";
+}
+
+/*
+ * Test IRadioMessaging.getGsmBroadcastConfig() for the response returned.
+ */
+TEST_P(RadioMessagingTest, getGsmBroadcastConfig) {
+ LOG(DEBUG) << "getGsmBroadcastConfig";
+ serial = GetRandomSerialNumber();
+
+ radio_messaging->getGsmBroadcastConfig(serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_messaging->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "getGsmBroadcastConfig finished";
+}
+
+/*
+ * Test IRadioMessaging.setCdmaBroadcastConfig() for the response returned.
+ */
+TEST_P(RadioMessagingTest, setCdmaBroadcastConfig) {
+ LOG(DEBUG) << "setCdmaBroadcastConfig";
+ serial = GetRandomSerialNumber();
+
+ CdmaBroadcastSmsConfigInfo cbSmsConfig;
+ cbSmsConfig.serviceCategory = 4096;
+ cbSmsConfig.language = 1;
+ cbSmsConfig.selected = true;
+
+ std::vector<CdmaBroadcastSmsConfigInfo> cdmaBroadcastSmsConfigInfoList = {cbSmsConfig};
+
+ radio_messaging->setCdmaBroadcastConfig(serial, cdmaBroadcastSmsConfigInfoList);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_MODEM_STATE},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "setCdmaBroadcastConfig finished";
+}
+
+/*
+ * Test IRadioMessaging.getCdmaBroadcastConfig() for the response returned.
+ */
+TEST_P(RadioMessagingTest, getCdmaBroadcastConfig) {
+ LOG(DEBUG) << "getCdmaBroadcastConfig";
+ serial = GetRandomSerialNumber();
+
+ radio_messaging->getCdmaBroadcastConfig(serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, {RadioError::NONE},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "getCdmaBroadcastConfig finished";
+}
+
+/*
+ * Test IRadioMessaging.setCdmaBroadcastActivation() for the response returned.
+ */
+TEST_P(RadioMessagingTest, setCdmaBroadcastActivation) {
+ LOG(DEBUG) << "setCdmaBroadcastActivation";
+ serial = GetRandomSerialNumber();
+ bool activate = false;
+
+ radio_messaging->setCdmaBroadcastActivation(serial, activate);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "setCdmaBroadcastActivation finished";
+}
+
+/*
+ * Test IRadioMessaging.setGsmBroadcastActivation() for the response returned.
+ */
+TEST_P(RadioMessagingTest, setGsmBroadcastActivation) {
+ LOG(DEBUG) << "setGsmBroadcastActivation";
+ serial = GetRandomSerialNumber();
+ bool activate = false;
+
+ radio_messaging->setGsmBroadcastActivation(serial, activate);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_messaging->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::INVALID_MODEM_STATE,
+ RadioError::INVALID_STATE, RadioError::OPERATION_NOT_ALLOWED},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "setGsmBroadcastActivation finished";
+}
+
+/*
+ * Test IRadioMessaging.acknowledgeLastIncomingGsmSms() for the response returned.
+ */
+TEST_P(RadioMessagingTest, acknowledgeLastIncomingGsmSms) {
+ LOG(DEBUG) << "acknowledgeLastIncomingGsmSms";
+ serial = GetRandomSerialNumber();
+ bool success = true;
+
+ radio_messaging->acknowledgeLastIncomingGsmSms(
+ serial, success, SmsAcknowledgeFailCause::MEMORY_CAPACITY_EXCEEDED);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "acknowledgeLastIncomingGsmSms finished";
+}
+
+/*
+ * Test IRadioMessaging.acknowledgeIncomingGsmSmsWithPdu() for the response returned.
+ */
+TEST_P(RadioMessagingTest, acknowledgeIncomingGsmSmsWithPdu) {
+ LOG(DEBUG) << "acknowledgeIncomingGsmSmsWithPdu";
+ serial = GetRandomSerialNumber();
+ bool success = true;
+ std::string ackPdu = "";
+
+ radio_messaging->acknowledgeIncomingGsmSmsWithPdu(serial, success, ackPdu);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::NO_SMS_TO_ACK},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "acknowledgeIncomingGsmSmsWithPdu finished";
+}
+
+/*
+ * Test IRadioMessaging.acknowledgeLastIncomingCdmaSms() for the response returned.
+ */
+TEST_P(RadioMessagingTest, acknowledgeLastIncomingCdmaSms) {
+ LOG(DEBUG) << "acknowledgeLastIncomingCdmaSms";
+ serial = GetRandomSerialNumber();
+
+ // Create a CdmaSmsAck
+ CdmaSmsAck cdmaSmsAck;
+ cdmaSmsAck.errorClass = false;
+ cdmaSmsAck.smsCauseCode = 1;
+
+ radio_messaging->acknowledgeLastIncomingCdmaSms(serial, cdmaSmsAck);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::NO_SMS_TO_ACK},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "acknowledgeLastIncomingCdmaSms finished";
+}
+
+/*
+ * Test IRadioMessaging.sendImsSms() for the response returned.
+ */
+TEST_P(RadioMessagingTest, sendImsSms) {
+ LOG(DEBUG) << "sendImsSms";
+ serial = GetRandomSerialNumber();
+
+ // Create a CdmaSmsAddress
+ CdmaSmsAddress cdmaSmsAddress;
+ cdmaSmsAddress.digitMode = CdmaSmsAddress::DIGIT_MODE_FOUR_BIT;
+ cdmaSmsAddress.isNumberModeDataNetwork = false;
+ cdmaSmsAddress.numberType = CdmaSmsAddress::NUMBER_TYPE_UNKNOWN;
+ cdmaSmsAddress.numberPlan = CdmaSmsAddress::NUMBER_PLAN_UNKNOWN;
+ cdmaSmsAddress.digits = (std::vector<uint8_t>){11, 1, 6, 5, 10, 7, 7, 2, 10, 3, 10, 3};
+
+ // Create a CdmaSmsSubAddress
+ CdmaSmsSubaddress cdmaSmsSubaddress;
+ cdmaSmsSubaddress.subaddressType = CdmaSmsSubaddress::SUBADDRESS_TYPE_NSAP;
+ cdmaSmsSubaddress.odd = false;
+ cdmaSmsSubaddress.digits = (std::vector<uint8_t>){};
+
+ // Create a CdmaSmsMessage
+ CdmaSmsMessage cdmaSmsMessage;
+ cdmaSmsMessage.teleserviceId = 4098;
+ cdmaSmsMessage.isServicePresent = false;
+ cdmaSmsMessage.serviceCategory = 0;
+ cdmaSmsMessage.address = cdmaSmsAddress;
+ cdmaSmsMessage.subAddress = cdmaSmsSubaddress;
+ cdmaSmsMessage.bearerData =
+ (std::vector<uint8_t>){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0};
+
+ // Creata an ImsSmsMessage
+ ImsSmsMessage msg;
+ msg.tech = RadioTechnologyFamily::THREE_GPP2;
+ msg.retry = false;
+ msg.messageRef = 0;
+ msg.cdmaMessage = (std::vector<CdmaSmsMessage>){cdmaSmsMessage};
+ msg.gsmMessage = (std::vector<GsmSmsMessage>){};
+
+ radio_messaging->sendImsSms(serial, msg);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS}, CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "sendImsSms finished";
+}
+
+/*
+ * Test IRadioMessaging.getSmscAddress() for the response returned.
+ */
+TEST_P(RadioMessagingTest, getSmscAddress) {
+ LOG(DEBUG) << "getSmscAddress";
+ serial = GetRandomSerialNumber();
+
+ radio_messaging->getSmscAddress(serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error,
+ {RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE,
+ RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "getSmscAddress finished";
+}
+
+/*
+ * Test IRadioMessaging.setSmscAddress() for the response returned.
+ */
+TEST_P(RadioMessagingTest, setSmscAddress) {
+ LOG(DEBUG) << "setSmscAddress";
+ serial = GetRandomSerialNumber();
+ std::string address = std::string("smscAddress");
+
+ radio_messaging->setSmscAddress(serial, address);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_SMS_FORMAT,
+ RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "setSmscAddress finished";
+}
+
+/*
+ * Test IRadioMessaging.writeSmsToSim() for the response returned.
+ */
+TEST_P(RadioMessagingTest, writeSmsToSim) {
+ LOG(DEBUG) << "writeSmsToSim";
+ serial = GetRandomSerialNumber();
+ SmsWriteArgs smsWriteArgs;
+ smsWriteArgs.status = SmsWriteArgs::STATUS_REC_UNREAD;
+ smsWriteArgs.smsc = "";
+ smsWriteArgs.pdu = "01000b916105770203f3000006d4f29c3e9b01";
+
+ radio_messaging->writeSmsToSim(serial, smsWriteArgs);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_messaging->rspInfo.error,
+ {RadioError::NONE, RadioError::ENCODING_ERR, RadioError::INVALID_ARGUMENTS,
+ RadioError::INVALID_SMSC_ADDRESS, RadioError::MODEM_ERR,
+ RadioError::NETWORK_NOT_READY, RadioError::NO_RESOURCES, RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "writeSmsToSim finished";
+}
+
+/*
+ * Test IRadioMessaging.deleteSmsOnSim() for the response returned.
+ */
+TEST_P(RadioMessagingTest, deleteSmsOnSim) {
+ LOG(DEBUG) << "deleteSmsOnSim";
+ serial = GetRandomSerialNumber();
+ int index = 1;
+
+ radio_messaging->deleteSmsOnSim(serial, index);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_messaging->rspInfo.error,
+ {RadioError::NONE, RadioError::ENCODING_ERR, RadioError::INVALID_ARGUMENTS,
+ RadioError::INVALID_MODEM_STATE, RadioError::NO_SUCH_ENTRY, RadioError::MODEM_ERR,
+ RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "deleteSmsOnSim finished";
+}
+
+/*
+ * Test IRadioMessaging.writeSmsToRuim() for the response returned.
+ */
+TEST_P(RadioMessagingTest, writeSmsToRuim) {
+ LOG(DEBUG) << "writeSmsToRuim";
+ serial = GetRandomSerialNumber();
+
+ // Create a CdmaSmsAddress
+ CdmaSmsAddress cdmaSmsAddress;
+ cdmaSmsAddress.digitMode = CdmaSmsAddress::DIGIT_MODE_FOUR_BIT;
+ cdmaSmsAddress.isNumberModeDataNetwork = false;
+ cdmaSmsAddress.numberType = CdmaSmsAddress::NUMBER_TYPE_UNKNOWN;
+ cdmaSmsAddress.numberPlan = CdmaSmsAddress::NUMBER_PLAN_UNKNOWN;
+ cdmaSmsAddress.digits = (std::vector<uint8_t>){11, 1, 6, 5, 10, 7, 7, 2, 10, 3, 10, 3};
+
+ // Create a CdmaSmsSubAddress
+ CdmaSmsSubaddress cdmaSmsSubaddress;
+ cdmaSmsSubaddress.subaddressType = CdmaSmsSubaddress::SUBADDRESS_TYPE_NSAP;
+ cdmaSmsSubaddress.odd = false;
+ cdmaSmsSubaddress.digits = (std::vector<uint8_t>){};
+
+ // Create a CdmaSmsMessage
+ CdmaSmsMessage cdmaSmsMessage;
+ cdmaSmsMessage.teleserviceId = 4098;
+ cdmaSmsMessage.isServicePresent = false;
+ cdmaSmsMessage.serviceCategory = 0;
+ cdmaSmsMessage.address = cdmaSmsAddress;
+ cdmaSmsMessage.subAddress = cdmaSmsSubaddress;
+ cdmaSmsMessage.bearerData =
+ (std::vector<uint8_t>){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0};
+
+ // Create a CdmaSmsWriteArgs
+ CdmaSmsWriteArgs cdmaSmsWriteArgs;
+ cdmaSmsWriteArgs.status = CdmaSmsWriteArgs::STATUS_REC_UNREAD;
+ cdmaSmsWriteArgs.message = cdmaSmsMessage;
+
+ radio_messaging->writeSmsToRuim(serial, cdmaSmsWriteArgs);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_messaging->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::INVALID_SMS_FORMAT,
+ RadioError::INVALID_SMSC_ADDRESS, RadioError::INVALID_STATE, RadioError::MODEM_ERR,
+ RadioError::NO_SUCH_ENTRY, RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "writeSmsToRuim finished";
+}
+
+/*
+ * Test IRadioMessaging.deleteSmsOnRuim() for the response returned.
+ */
+TEST_P(RadioMessagingTest, deleteSmsOnRuim) {
+ LOG(DEBUG) << "deleteSmsOnRuim";
+ serial = GetRandomSerialNumber();
+ int index = 1;
+
+ // Create a CdmaSmsAddress
+ CdmaSmsAddress cdmaSmsAddress;
+ cdmaSmsAddress.digitMode = CdmaSmsAddress::DIGIT_MODE_FOUR_BIT;
+ cdmaSmsAddress.isNumberModeDataNetwork = false;
+ cdmaSmsAddress.numberType = CdmaSmsAddress::NUMBER_TYPE_UNKNOWN;
+ cdmaSmsAddress.numberPlan = CdmaSmsAddress::NUMBER_PLAN_UNKNOWN;
+ cdmaSmsAddress.digits = (std::vector<uint8_t>){11, 1, 6, 5, 10, 7, 7, 2, 10, 3, 10, 3};
+
+ // Create a CdmaSmsSubAddress
+ CdmaSmsSubaddress cdmaSmsSubaddress;
+ cdmaSmsSubaddress.subaddressType = CdmaSmsSubaddress::SUBADDRESS_TYPE_NSAP;
+ cdmaSmsSubaddress.odd = false;
+ cdmaSmsSubaddress.digits = (std::vector<uint8_t>){};
+
+ // Create a CdmaSmsMessage
+ CdmaSmsMessage cdmaSmsMessage;
+ cdmaSmsMessage.teleserviceId = 4098;
+ cdmaSmsMessage.isServicePresent = false;
+ cdmaSmsMessage.serviceCategory = 0;
+ cdmaSmsMessage.address = cdmaSmsAddress;
+ cdmaSmsMessage.subAddress = cdmaSmsSubaddress;
+ cdmaSmsMessage.bearerData =
+ (std::vector<uint8_t>){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0};
+
+ // Create a CdmaSmsWriteArgs
+ CdmaSmsWriteArgs cdmaSmsWriteArgs;
+ cdmaSmsWriteArgs.status = CdmaSmsWriteArgs::STATUS_REC_UNREAD;
+ cdmaSmsWriteArgs.message = cdmaSmsMessage;
+
+ radio_messaging->deleteSmsOnRuim(serial, index);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_messaging->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::INVALID_MODEM_STATE,
+ RadioError::MODEM_ERR, RadioError::NO_SUCH_ENTRY, RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "deleteSmsOnRuim finished";
+}
+
+/*
+ * Test IRadioMessaging.reportSmsMemoryStatus() for the response returned.
+ */
+TEST_P(RadioMessagingTest, reportSmsMemoryStatus) {
+ LOG(DEBUG) << "reportSmsMemoryStatus";
+ serial = GetRandomSerialNumber();
+ bool available = true;
+
+ radio_messaging->reportSmsMemoryStatus(serial, available);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE,
+ RadioError::MODEM_ERR, RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "reportSmsMemoryStatus finished";
+}
diff --git a/radio/aidl/vts/radio_messaging_utils.h b/radio/aidl/vts/radio_messaging_utils.h
index 7bb99cd..7b66192 100644
--- a/radio/aidl/vts/radio_messaging_utils.h
+++ b/radio/aidl/vts/radio_messaging_utils.h
@@ -49,8 +49,6 @@
virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
- virtual ndk::ScopedAStatus cancelPendingUssdResponse(const RadioResponseInfo& info) override;
-
virtual ndk::ScopedAStatus deleteSmsOnRuimResponse(const RadioResponseInfo& info) override;
virtual ndk::ScopedAStatus deleteSmsOnSimResponse(const RadioResponseInfo& info) override;
@@ -84,8 +82,6 @@
virtual ndk::ScopedAStatus sendSmsResponse(const RadioResponseInfo& info,
const SendSmsResult& sms) override;
- virtual ndk::ScopedAStatus sendUssdResponse(const RadioResponseInfo& info) override;
-
virtual ndk::ScopedAStatus setCdmaBroadcastActivationResponse(
const RadioResponseInfo& info) override;
@@ -132,9 +128,6 @@
virtual ndk::ScopedAStatus newSmsStatusReport(RadioIndicationType type,
const std::vector<uint8_t>& pdu) override;
- virtual ndk::ScopedAStatus onUssd(RadioIndicationType type, UssdModeType modeType,
- const std::string& msg) override;
-
virtual ndk::ScopedAStatus simSmsStorageFull(RadioIndicationType type) override;
};
diff --git a/radio/aidl/vts/radio_modem_response.cpp b/radio/aidl/vts/radio_modem_response.cpp
index 53bfab4..d2715a8 100644
--- a/radio/aidl/vts/radio_modem_response.cpp
+++ b/radio/aidl/vts/radio_modem_response.cpp
@@ -22,70 +22,99 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioModemResponse::enableModemResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioModemResponse::enableModemResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_modem.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioModemResponse::getBasebandVersionResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioModemResponse::getBasebandVersionResponse(const RadioResponseInfo& info,
const std::string& /*version*/) {
+ rspInfo = info;
+ parent_modem.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioModemResponse::getDeviceIdentityResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioModemResponse::getDeviceIdentityResponse(const RadioResponseInfo& info,
const std::string& /*imei*/,
const std::string& /*imeisv*/,
const std::string& /*esn*/,
const std::string& /*meid*/) {
+ rspInfo = info;
+ parent_modem.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioModemResponse::getHardwareConfigResponse(
- const RadioResponseInfo& /*info*/, const std::vector<HardwareConfig>& /*config*/) {
+ const RadioResponseInfo& info, const std::vector<HardwareConfig>& /*config*/) {
+ rspInfo = info;
+ parent_modem.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioModemResponse::getModemActivityInfoResponse(
- const RadioResponseInfo& /*info*/, const ActivityStatsInfo& /*activityInfo*/) {
+ const RadioResponseInfo& info, const ActivityStatsInfo& /*activityInfo*/) {
+ rspInfo = info;
+ parent_modem.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioModemResponse::getModemStackStatusResponse(
- const RadioResponseInfo& /*info*/, const bool /*enabled*/) {
+ndk::ScopedAStatus RadioModemResponse::getModemStackStatusResponse(const RadioResponseInfo& info,
+ const bool enabled) {
+ rspInfo = info;
+ isModemEnabled = enabled;
+ parent_modem.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioModemResponse::getRadioCapabilityResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioModemResponse::getRadioCapabilityResponse(const RadioResponseInfo& info,
const RadioCapability& /*rc*/) {
+ rspInfo = info;
+ parent_modem.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioModemResponse::nvReadItemResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioModemResponse::nvReadItemResponse(const RadioResponseInfo& info,
const std::string& /*result*/) {
+ rspInfo = info;
+ parent_modem.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioModemResponse::nvResetConfigResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioModemResponse::nvResetConfigResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_modem.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioModemResponse::nvWriteCdmaPrlResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioModemResponse::nvWriteCdmaPrlResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_modem.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioModemResponse::nvWriteItemResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioModemResponse::nvWriteItemResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_modem.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioModemResponse::requestShutdownResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioModemResponse::requestShutdownResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_modem.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioModemResponse::sendDeviceStateResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioModemResponse::sendDeviceStateResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_modem.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioModemResponse::setRadioCapabilityResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioModemResponse::setRadioCapabilityResponse(const RadioResponseInfo& info,
const RadioCapability& /*rc*/) {
+ rspInfo = info;
+ parent_modem.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
diff --git a/radio/aidl/vts/radio_modem_test.cpp b/radio/aidl/vts/radio_modem_test.cpp
index b40bb7b..f88da13 100644
--- a/radio/aidl/vts/radio_modem_test.cpp
+++ b/radio/aidl/vts/radio_modem_test.cpp
@@ -87,3 +87,301 @@
EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error);
}
+
+/*
+ * Test IRadioModem.enableModem() for the response returned.
+ */
+TEST_P(RadioModemTest, enableModem) {
+ serial = GetRandomSerialNumber();
+
+ if (isSsSsEnabled()) {
+ ALOGI("enableModem, no need to test in single SIM mode");
+ return;
+ }
+
+ bool responseToggle = radioRsp_modem->enableModemResponseToggle;
+ ndk::ScopedAStatus res = radio_modem->enableModem(serial, true);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+ ALOGI("getModemStackStatus, rspInfo.error = %s\n",
+ toString(radioRsp_modem->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::MODEM_ERR, RadioError::INVALID_STATE}));
+
+ // checking if getModemStackStatus returns true, as modem was enabled above
+ if (RadioError::NONE == radioRsp_modem->rspInfo.error) {
+ // wait until modem enabling is finished
+ while (responseToggle == radioRsp_modem->enableModemResponseToggle) {
+ sleep(1);
+ }
+ ndk::ScopedAStatus resEnabled = radio_modem->getModemStackStatus(serial);
+ ASSERT_OK(resEnabled);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+ ALOGI("getModemStackStatus, rspInfo.error = %s\n",
+ toString(radioRsp_modem->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::MODEM_ERR, RadioError::INVALID_STATE}));
+ // verify that enableModem did set isEnabled correctly
+ EXPECT_EQ(true, radioRsp_modem->isModemEnabled);
+ }
+}
+
+/*
+ * Test IRadioModem.getModemStackStatus() for the response returned.
+ */
+TEST_P(RadioModemTest, getModemStackStatus) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = radio_modem->getModemStackStatus(serial);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+ ALOGI("getModemStackStatus, rspInfo.error = %s\n",
+ toString(radioRsp_modem->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_modem->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
+}
+
+/*
+ * Test IRadioModem.getBasebandVersion() for the response returned.
+ */
+TEST_P(RadioModemTest, getBasebandVersion) {
+ LOG(DEBUG) << "getBasebandVersion";
+ serial = GetRandomSerialNumber();
+
+ radio_modem->getBasebandVersion(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error);
+ }
+ LOG(DEBUG) << "getBasebandVersion finished";
+}
+
+/*
+ * Test IRadioModem.getDeviceIdentity() for the response returned.
+ */
+TEST_P(RadioModemTest, getDeviceIdentity) {
+ LOG(DEBUG) << "getDeviceIdentity";
+ serial = GetRandomSerialNumber();
+
+ radio_modem->getDeviceIdentity(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error,
+ {RadioError::NONE, RadioError::EMPTY_RECORD}));
+ }
+ LOG(DEBUG) << "getDeviceIdentity finished";
+}
+
+/*
+ * Test IRadioModem.nvReadItem() for the response returned.
+ */
+TEST_P(RadioModemTest, nvReadItem) {
+ LOG(DEBUG) << "nvReadItem";
+ serial = GetRandomSerialNumber();
+
+ radio_modem->nvReadItem(serial, NvItem::LTE_BAND_ENABLE_25);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "nvReadItem finished";
+}
+
+/*
+ * Test IRadioModem.nvWriteItem() for the response returned.
+ */
+TEST_P(RadioModemTest, nvWriteItem) {
+ LOG(DEBUG) << "nvWriteItem";
+ serial = GetRandomSerialNumber();
+ NvWriteItem item;
+ memset(&item, 0, sizeof(item));
+ item.value = std::string();
+
+ radio_modem->nvWriteItem(serial, item);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "nvWriteItem finished";
+}
+
+/*
+ * Test IRadioModem.nvWriteCdmaPrl() for the response returned.
+ */
+TEST_P(RadioModemTest, nvWriteCdmaPrl) {
+ LOG(DEBUG) << "nvWriteCdmaPrl";
+ serial = GetRandomSerialNumber();
+ std::vector<uint8_t> prl = {1, 2, 3, 4, 5};
+
+ radio_modem->nvWriteCdmaPrl(serial, std::vector<uint8_t>(prl));
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "nvWriteCdmaPrl finished";
+}
+
+/*
+ * Test IRadioModem.nvResetConfig() for the response returned.
+ */
+TEST_P(RadioModemTest, nvResetConfig) {
+ LOG(DEBUG) << "nvResetConfig";
+ serial = GetRandomSerialNumber();
+
+ radio_modem->nvResetConfig(serial, ResetNvType::FACTORY_RESET);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+ LOG(DEBUG) << "nvResetConfig finished";
+}
+
+/*
+ * Test IRadioModem.getHardwareConfig() for the response returned.
+ */
+TEST_P(RadioModemTest, getHardwareConfig) {
+ LOG(DEBUG) << "getHardwareConfig";
+ serial = GetRandomSerialNumber();
+
+ radio_modem->getHardwareConfig(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "getHardwareConfig finished";
+}
+
+/*
+ * The following test is disabled due to b/64734869
+ *
+ * Test IRadioModem.requestShutdown() for the response returned.
+ */
+TEST_P(RadioModemTest, DISABLED_requestShutdown) {
+ serial = GetRandomSerialNumber();
+
+ radio_modem->requestShutdown(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE},
+ CHECK_GENERAL_ERROR));
+ }
+}
+
+/*
+ * Test IRadioModem.getRadioCapability() for the response returned.
+ */
+TEST_P(RadioModemTest, getRadioCapability) {
+ LOG(DEBUG) << "getRadioCapability";
+ serial = GetRandomSerialNumber();
+
+ radio_modem->getRadioCapability(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error);
+ }
+ LOG(DEBUG) << "getRadioCapability finished";
+}
+
+/*
+ * Test IRadioModem.setRadioCapability() for the response returned.
+ */
+TEST_P(RadioModemTest, setRadioCapability) {
+ LOG(DEBUG) << "setRadioCapability";
+ serial = GetRandomSerialNumber();
+ RadioCapability rc;
+ memset(&rc, 0, sizeof(rc));
+ rc.logicalModemUuid = std::string();
+
+ radio_modem->setRadioCapability(serial, rc);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "setRadioCapability finished";
+}
+
+/*
+ * Test IRadioModem.getModemActivityInfo() for the response returned.
+ */
+TEST_P(RadioModemTest, getModemActivityInfo) {
+ LOG(DEBUG) << "getModemActivityInfo";
+ serial = GetRandomSerialNumber();
+
+ radio_modem->getModemActivityInfo(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+ LOG(DEBUG) << "getModemActivityInfo finished";
+}
+
+/*
+ * Test IRadioModem.sendDeviceState() for the response returned.
+ */
+TEST_P(RadioModemTest, sendDeviceState) {
+ LOG(DEBUG) << "sendDeviceState";
+ serial = GetRandomSerialNumber();
+
+ radio_modem->sendDeviceState(serial, DeviceStateType::POWER_SAVE_MODE, true);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+
+ std::cout << static_cast<int>(radioRsp_modem->rspInfo.error) << std::endl;
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+ LOG(DEBUG) << "sendDeviceState finished";
+}
diff --git a/radio/aidl/vts/radio_network_response.cpp b/radio/aidl/vts/radio_network_response.cpp
index ccae0f3..666d617 100644
--- a/radio/aidl/vts/radio_network_response.cpp
+++ b/radio/aidl/vts/radio_network_response.cpp
@@ -31,7 +31,10 @@
}
ndk::ScopedAStatus RadioNetworkResponse::getAvailableBandModesResponse(
- const RadioResponseInfo& /*info*/, const std::vector<RadioBandMode>& /*bandModes*/) {
+ const RadioResponseInfo& info, const std::vector<RadioBandMode>& bandModes) {
+ rspInfo = info;
+ radioBandModes = bandModes;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -44,48 +47,64 @@
}
ndk::ScopedAStatus RadioNetworkResponse::getBarringInfoResponse(
- const RadioResponseInfo& /*info*/, const CellIdentity& /*cellIdentity*/,
- const std::vector<BarringInfo>& /*barringInfos*/) {
+ const RadioResponseInfo& info, const CellIdentity& cellIdentity,
+ const std::vector<BarringInfo>& barringInfos) {
+ rspInfo = info;
+ barringCellIdentity = cellIdentity;
+ barringInfoList = barringInfos;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::getCdmaRoamingPreferenceResponse(
- const RadioResponseInfo& /*info*/, CdmaRoamingType /*type*/) {
- return ndk::ScopedAStatus::ok();
-}
-
-ndk::ScopedAStatus RadioNetworkResponse::getCellInfoListResponse(
- const RadioResponseInfo& /*info*/, const std::vector<CellInfo>& /*cellInfo*/) {
- return ndk::ScopedAStatus::ok();
-}
-
-ndk::ScopedAStatus RadioNetworkResponse::getDataRegistrationStateResponse(
- const RadioResponseInfo& info, const RegStateResult& /*regResponse*/) {
+ const RadioResponseInfo& info, CdmaRoamingType /*type*/) {
rspInfo = info;
parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus RadioNetworkResponse::getCellInfoListResponse(
+ const RadioResponseInfo& info, const std::vector<CellInfo>& /*cellInfo*/) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getDataRegistrationStateResponse(
+ const RadioResponseInfo& info, const RegStateResult& regResponse) {
+ rspInfo = info;
+ dataRegResp = regResponse;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
ndk::ScopedAStatus RadioNetworkResponse::getImsRegistrationStateResponse(
- const RadioResponseInfo& /*info*/, bool /*isRegistered*/,
- RadioTechnologyFamily /*ratFamily*/) {
+ const RadioResponseInfo& info, bool /*isRegistered*/, RadioTechnologyFamily /*ratFamily*/) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::getNetworkSelectionModeResponse(
- const RadioResponseInfo& /*info*/, bool /*manual*/) {
+ const RadioResponseInfo& info, bool /*manual*/) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioNetworkResponse::getOperatorResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioNetworkResponse::getOperatorResponse(const RadioResponseInfo& info,
const std::string& /*longName*/,
const std::string& /*shortName*/,
const std::string& /*numeric*/) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::getSignalStrengthResponse(
- const RadioResponseInfo& /*info*/, const SignalStrength& /*sig_strength*/) {
+ const RadioResponseInfo& info, const SignalStrength& /*sig_strength*/) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -105,14 +124,16 @@
}
ndk::ScopedAStatus RadioNetworkResponse::getVoiceRadioTechnologyResponse(
- const RadioResponseInfo& /*info*/, RadioTechnology /*rat*/) {
+ const RadioResponseInfo& info, RadioTechnology /*rat*/) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::getVoiceRegistrationStateResponse(
const RadioResponseInfo& info, const RegStateResult& regResponse) {
rspInfo = info;
- voiceRegResp.regState = regResponse.regState;
+ voiceRegResp = regResponse;
parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -132,47 +153,63 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioNetworkResponse::setBandModeResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioNetworkResponse::setBandModeResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioNetworkResponse::setBarringPasswordResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioNetworkResponse::setBarringPasswordResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::setCdmaRoamingPreferenceResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::setCellInfoListRateResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::setIndicationFilterResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::setLinkCapacityReportingCriteriaResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioNetworkResponse::setLocationUpdatesResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioNetworkResponse::setLocationUpdatesResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::setNetworkSelectionModeAutomaticResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::setNetworkSelectionModeManualResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -184,17 +221,23 @@
}
ndk::ScopedAStatus RadioNetworkResponse::setSignalStrengthReportingCriteriaResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::setSuppServiceNotificationsResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::setSystemSelectionChannelsResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -204,17 +247,21 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioNetworkResponse::startNetworkScanResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioNetworkResponse::startNetworkScanResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioNetworkResponse::stopNetworkScanResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioNetworkResponse::stopNetworkScanResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::supplyNetworkDepersonalizationResponse(
- const RadioResponseInfo& /*info*/, int32_t /*remainingRetries*/) {
+ const RadioResponseInfo& info, int32_t /*remainingRetries*/) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp
index 93c4c35..e1d508d 100644
--- a/radio/aidl/vts/radio_network_test.cpp
+++ b/radio/aidl/vts/radio_network_test.cpp
@@ -16,6 +16,7 @@
#include <aidl/android/hardware/radio/RadioAccessFamily.h>
#include <aidl/android/hardware/radio/config/IRadioConfig.h>
+#include <aidl/android/hardware/radio/network/IndicationFilter.h>
#include <android-base/logging.h>
#include <android/binder_manager.h>
@@ -58,6 +59,12 @@
ASSERT_NE(nullptr, radio_config.get());
}
+void RadioNetworkTest::stopNetworkScan() {
+ serial = GetRandomSerialNumber();
+ radio_network->stopNetworkScan(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+}
+
/*
* Test IRadioNetwork.setAllowedNetworkTypesBitmap for the response returned.
*/
@@ -257,9 +264,1473 @@
[&](int serial) { return radio_network->setUsageSetting(serial, originalSetting); },
{RadioError::NONE});
+ // After resetting the value to its original value, update the local cache, which must
+ // always succeed.
+ invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); },
+ {RadioError::NONE});
+
// Check that indeed the updated setting was set. We do this after resetting to original
// conditions to avoid early-exiting the test and leaving the device in a modified state.
- ASSERT_TRUE(expectedSetting == updatedSetting);
+ EXPECT_EQ(expectedSetting, updatedSetting);
// Check that indeed the original setting was reset.
- ASSERT_TRUE(originalSetting == radioRsp_network->usageSetting);
+ EXPECT_EQ(originalSetting, radioRsp_network->usageSetting);
+}
+
+/*
+ * Test IRadioNetwork.setSignalStrengthReportingCriteria() with invalid hysteresisDb
+ */
+TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_invalidHysteresisDb) {
+ serial = GetRandomSerialNumber();
+
+ SignalThresholdInfo signalThresholdInfo;
+ signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSI;
+ signalThresholdInfo.hysteresisMs = 5000;
+ signalThresholdInfo.hysteresisDb = 10; // hysteresisDb too large given threshold list deltas
+ signalThresholdInfo.thresholds = {-109, -103, -97, -89};
+ signalThresholdInfo.isEnabled = true;
+ signalThresholdInfo.ran = AccessNetwork::GERAN;
+
+ ndk::ScopedAStatus res =
+ radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setSignalStrengthReportingCriteria_invalidHysteresisDb, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
+}
+
+/*
+ * Test IRadioNetwork.setSignalStrengthReportingCriteria() with empty thresholds
+ */
+TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_EmptyThresholds) {
+ serial = GetRandomSerialNumber();
+
+ SignalThresholdInfo signalThresholdInfo;
+ signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSI;
+ signalThresholdInfo.hysteresisMs = 0;
+ signalThresholdInfo.hysteresisDb = 0;
+ signalThresholdInfo.isEnabled = true;
+ signalThresholdInfo.ran = AccessNetwork::GERAN;
+
+ ndk::ScopedAStatus res =
+ radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setSignalStrengthReportingCriteria_EmptyParams, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE}));
+}
+
+/*
+ * Test IRadioNetwork.setSignalStrengthReportingCriteria() for GERAN
+ */
+TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Geran) {
+ serial = GetRandomSerialNumber();
+
+ SignalThresholdInfo signalThresholdInfo;
+ signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSI;
+ signalThresholdInfo.hysteresisMs = 5000;
+ signalThresholdInfo.hysteresisDb = 2;
+ signalThresholdInfo.thresholds = {-109, -103, -97, -89};
+ signalThresholdInfo.isEnabled = true;
+ signalThresholdInfo.ran = AccessNetwork::GERAN;
+
+ ndk::ScopedAStatus res =
+ radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setSignalStrengthReportingCriteria_Geran, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE}));
+}
+
+/*
+ * Test IRadioNetwork.setSignalStrengthReportingCriteria() for UTRAN
+ */
+TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Utran) {
+ serial = GetRandomSerialNumber();
+
+ SignalThresholdInfo signalThresholdInfo;
+ signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSCP;
+ signalThresholdInfo.hysteresisMs = 5000;
+ signalThresholdInfo.hysteresisDb = 2;
+ signalThresholdInfo.thresholds = {-110, -97, -73, -49, -25};
+ signalThresholdInfo.isEnabled = true;
+ signalThresholdInfo.ran = AccessNetwork::UTRAN;
+
+ ndk::ScopedAStatus res =
+ radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setSignalStrengthReportingCriteria_Utran, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE}));
+}
+
+/*
+ * Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN
+ */
+TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Eutran_RSRP) {
+ serial = GetRandomSerialNumber();
+
+ SignalThresholdInfo signalThresholdInfo;
+ signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSRP;
+ signalThresholdInfo.hysteresisMs = 5000;
+ signalThresholdInfo.hysteresisDb = 2;
+ signalThresholdInfo.thresholds = {-128, -108, -88, -68};
+ signalThresholdInfo.isEnabled = true;
+ signalThresholdInfo.ran = AccessNetwork::EUTRAN;
+
+ ndk::ScopedAStatus res =
+ radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setSignalStrengthReportingCriteria_Eutran, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE}));
+}
+
+/*
+ * Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN
+ */
+TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Eutran_RSRQ) {
+ serial = GetRandomSerialNumber();
+
+ SignalThresholdInfo signalThresholdInfo;
+ signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSRQ;
+ signalThresholdInfo.hysteresisMs = 5000;
+ signalThresholdInfo.hysteresisDb = 2;
+ signalThresholdInfo.thresholds = {-27, -20, -13, -6};
+ signalThresholdInfo.isEnabled = true;
+ signalThresholdInfo.ran = AccessNetwork::EUTRAN;
+
+ ndk::ScopedAStatus res =
+ radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setSignalStrengthReportingCriteria_Eutran, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE}));
+}
+
+/*
+ * Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN
+ */
+TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Eutran_RSSNR) {
+ serial = GetRandomSerialNumber();
+
+ SignalThresholdInfo signalThresholdInfo;
+ signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSNR;
+ signalThresholdInfo.hysteresisMs = 5000;
+ signalThresholdInfo.hysteresisDb = 2;
+ signalThresholdInfo.thresholds = {-10, 0, 10, 20};
+ signalThresholdInfo.isEnabled = true;
+ signalThresholdInfo.ran = AccessNetwork::EUTRAN;
+
+ ndk::ScopedAStatus res =
+ radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+}
+
+/*
+ * Test IRadioNetwork.setSignalStrengthReportingCriteria() for CDMA2000
+ */
+TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Cdma2000) {
+ serial = GetRandomSerialNumber();
+
+ SignalThresholdInfo signalThresholdInfo;
+ signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSI;
+ signalThresholdInfo.hysteresisMs = 5000;
+ signalThresholdInfo.hysteresisDb = 2;
+ signalThresholdInfo.thresholds = {-105, -90, -75, -65};
+ signalThresholdInfo.isEnabled = true;
+ signalThresholdInfo.ran = AccessNetwork::CDMA2000;
+
+ ndk::ScopedAStatus res =
+ radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setSignalStrengthReportingCriteria_Cdma2000, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE}));
+}
+
+/*
+ * Test IRadioNetwork.setSignalStrengthReportingCriteria() for NGRAN_SSRSRP
+ */
+TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_NGRAN_SSRSRP) {
+ serial = GetRandomSerialNumber();
+
+ SignalThresholdInfo signalThresholdInfo;
+ signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_SSRSRP;
+ signalThresholdInfo.hysteresisMs = 5000;
+ signalThresholdInfo.hysteresisDb = 0;
+ signalThresholdInfo.thresholds = {-105, -90, -75, -65};
+ signalThresholdInfo.isEnabled = true;
+ signalThresholdInfo.ran = AccessNetwork::NGRAN;
+
+ ndk::ScopedAStatus res =
+ radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setSignalStrengthReportingCriteria_NGRAN_SSRSRP, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+
+ // Allow REQUEST_NOT_SUPPORTED because some non-5G device may not support NGRAN for
+ // setSignalStrengthReportingCriteria()
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+}
+
+/*
+ * Test IRadioNetwork.setSignalStrengthReportingCriteria() for NGRAN_SSRSRQ
+ */
+TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_NGRAN_SSRSRQ) {
+ serial = GetRandomSerialNumber();
+
+ SignalThresholdInfo signalThresholdInfo;
+ signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_SSRSRQ;
+ signalThresholdInfo.hysteresisMs = 5000;
+ signalThresholdInfo.hysteresisDb = 0;
+ signalThresholdInfo.thresholds = {-43, -20, 0, 20};
+ signalThresholdInfo.isEnabled = true;
+ signalThresholdInfo.ran = AccessNetwork::NGRAN;
+
+ ndk::ScopedAStatus res =
+ radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setSignalStrengthReportingCriteria_NGRAN_SSRSRQ, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+
+ // Allow REQUEST_NOT_SUPPORTED because some non-5G device may not support NGRAN for
+ // setSignalStrengthReportingCriteria()
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+}
+
+/*
+ * Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN
+ */
+TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Disable_RSSNR) {
+ serial = GetRandomSerialNumber();
+
+ SignalThresholdInfo signalThresholdInfo;
+ signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSNR;
+ signalThresholdInfo.hysteresisMs = 5000;
+ signalThresholdInfo.hysteresisDb = 2;
+ signalThresholdInfo.thresholds = {-10, 0, 10, 20};
+ signalThresholdInfo.isEnabled = false;
+ signalThresholdInfo.ran = AccessNetwork::EUTRAN;
+
+ ndk::ScopedAStatus res =
+ radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+}
+
+/*
+ * Test IRadioNetwork.setSignalStrengthReportingCriteria() for NGRAN_SSSINR
+ */
+TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_NGRAN_SSSINR) {
+ serial = GetRandomSerialNumber();
+
+ SignalThresholdInfo signalThresholdInfo;
+ signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_SSSINR;
+ signalThresholdInfo.hysteresisMs = 5000;
+ signalThresholdInfo.hysteresisDb = 0;
+ signalThresholdInfo.thresholds = {-10, 3, 16, 18};
+ signalThresholdInfo.isEnabled = true;
+ signalThresholdInfo.ran = AccessNetwork::NGRAN;
+
+ ndk::ScopedAStatus res =
+ radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setSignalStrengthReportingCriteria_NGRAN_SSSINR, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+
+ // Allow REQUEST_NOT_SUPPORTED because some non-5G device may not support NGRAN for
+ // setSignalStrengthReportingCriteria()
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+}
+
+/*
+ * Test IRadioNetwork.setLinkCapacityReportingCriteria() invalid hysteresisDlKbps
+ */
+TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_invalidHysteresisDlKbps) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
+ serial, 5000,
+ 5000, // hysteresisDlKbps too big for thresholds delta
+ 100, {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000}, AccessNetwork::GERAN);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setLinkCapacityReportingCriteria_invalidHysteresisDlKbps, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ // Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria() may not be supported
+ // for GERAN
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+}
+
+/*
+ * Test IRadioNetwork.setLinkCapacityReportingCriteria() invalid hysteresisUlKbps
+ */
+TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_invalidHysteresisUlKbps) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
+ serial, 5000, 500, 1000, // hysteresisUlKbps too big for thresholds delta
+ {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000}, AccessNetwork::GERAN);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setLinkCapacityReportingCriteria_invalidHysteresisUlKbps, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ // Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria() may not be supported
+ // for GERAN
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+}
+
+/*
+ * Test IRadioNetwork.setLinkCapacityReportingCriteria() empty params
+ */
+TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_emptyParams) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
+ serial, 0, 0, 0, {}, {}, AccessNetwork::GERAN);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setLinkCapacityReportingCriteria_emptyParams, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ // Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria() may not be supported
+ // for GERAN
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+}
+
+/*
+ * Test IRadioNetwork.setLinkCapacityReportingCriteria() for GERAN
+ */
+TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_Geran) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
+ serial, 5000, 500, 100, {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000},
+ AccessNetwork::GERAN);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setLinkCapacityReportingCriteria_Geran, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ // Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria() may not be supported
+ // for GERAN
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+}
+
+/*
+ * Test IRadioNetwork.setSystemSelectionChannels() for the response returned.
+ */
+TEST_P(RadioNetworkTest, setSystemSelectionChannels) {
+ serial = GetRandomSerialNumber();
+
+ RadioAccessSpecifierBands bandP900 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_P900});
+ RadioAccessSpecifierBands band850 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_850});
+ RadioAccessSpecifier specifierP900 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
+ RadioAccessSpecifier specifier850 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
+
+ ndk::ScopedAStatus res =
+ radio_network->setSystemSelectionChannels(serial, true, {specifierP900, specifier850});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ALOGI("setSystemSelectionChannels, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR}));
+
+ if (radioRsp_network->rspInfo.error == RadioError::NONE) {
+ serial = GetRandomSerialNumber();
+ ndk::ScopedAStatus res = radio_network->setSystemSelectionChannels(
+ serial, false, {specifierP900, specifier850});
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ALOGI("setSystemSelectionChannels, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadioNetwork.startNetworkScan() for the response returned.
+ */
+TEST_P(RadioNetworkTest, startNetworkScan) {
+ serial = GetRandomSerialNumber();
+
+ RadioAccessSpecifierBands bandP900 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_P900});
+ RadioAccessSpecifierBands band850 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_850});
+ RadioAccessSpecifier specifierP900 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
+ RadioAccessSpecifier specifier850 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
+
+ NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
+ .interval = 60,
+ .specifiers = {specifierP900, specifier850},
+ .maxSearchTime = 60,
+ .incrementalResults = false,
+ .incrementalResultsPeriodicity = 1};
+
+ ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ALOGI("startNetworkScan, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::SIM_ABSENT}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ // OPERATION_NOT_ALLOWED should not be allowed; however, some vendors do
+ // not support the required manual GSM search functionality. This is
+ // tracked in b/112206766. Modems have "GSM" rat scan need to
+ // support scanning requests combined with some parameters.
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED}));
+ }
+
+ if (radioRsp_network->rspInfo.error == RadioError::NONE) {
+ ALOGI("Stop Network Scan");
+ stopNetworkScan();
+ }
+}
+
+/*
+ * Test IRadioNetwork.startNetworkScan() with invalid specifier.
+ */
+TEST_P(RadioNetworkTest, startNetworkScan_InvalidArgument) {
+ serial = GetRandomSerialNumber();
+
+ NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT, .interval = 60};
+
+ ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ALOGI("startNetworkScan_InvalidArgument, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+}
+
+/*
+ * Test IRadioNetwork.startNetworkScan() with invalid interval (lower boundary).
+ */
+TEST_P(RadioNetworkTest, startNetworkScan_InvalidInterval1) {
+ serial = GetRandomSerialNumber();
+
+ RadioAccessSpecifierBands bandP900 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_P900});
+ RadioAccessSpecifierBands band850 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_850});
+ RadioAccessSpecifier specifierP900 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
+ RadioAccessSpecifier specifier850 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
+
+ NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
+ .interval = 4,
+ .specifiers = {specifierP900, specifier850},
+ .maxSearchTime = 60,
+ .incrementalResults = false,
+ .incrementalResultsPeriodicity = 1};
+
+ ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ALOGI("startNetworkScan_InvalidInterval1, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+}
+
+/*
+ * Test IRadioNetwork.startNetworkScan() with invalid interval (upper boundary).
+ */
+TEST_P(RadioNetworkTest, startNetworkScan_InvalidInterval2) {
+ serial = GetRandomSerialNumber();
+
+ RadioAccessSpecifierBands bandP900 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_P900});
+ RadioAccessSpecifierBands band850 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_850});
+ RadioAccessSpecifier specifierP900 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
+ RadioAccessSpecifier specifier850 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
+
+ NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
+ .interval = 301,
+ .specifiers = {specifierP900, specifier850},
+ .maxSearchTime = 60,
+ .incrementalResults = false,
+ .incrementalResultsPeriodicity = 1};
+
+ ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ALOGI("startNetworkScan_InvalidInterval2, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+}
+
+/*
+ * Test IRadioNetwork.startNetworkScan() with invalid max search time (lower boundary).
+ */
+TEST_P(RadioNetworkTest, startNetworkScan_InvalidMaxSearchTime1) {
+ serial = GetRandomSerialNumber();
+
+ RadioAccessSpecifierBands bandP900 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_P900});
+ RadioAccessSpecifierBands band850 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_850});
+ RadioAccessSpecifier specifierP900 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
+ RadioAccessSpecifier specifier850 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
+
+ NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
+ .interval = 60,
+ .specifiers = {specifierP900, specifier850},
+ .maxSearchTime = 59,
+ .incrementalResults = false,
+ .incrementalResultsPeriodicity = 1};
+
+ ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ALOGI("startNetworkScan_InvalidMaxSearchTime1, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+}
+
+/*
+ * Test IRadioNetwork.startNetworkScan() with invalid max search time (upper boundary).
+ */
+TEST_P(RadioNetworkTest, startNetworkScan_InvalidMaxSearchTime2) {
+ serial = GetRandomSerialNumber();
+
+ RadioAccessSpecifierBands bandP900 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_P900});
+ RadioAccessSpecifierBands band850 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_850});
+ RadioAccessSpecifier specifierP900 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
+ RadioAccessSpecifier specifier850 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
+
+ NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
+ .interval = 60,
+ .specifiers = {specifierP900, specifier850},
+ .maxSearchTime = 3601,
+ .incrementalResults = false,
+ .incrementalResultsPeriodicity = 1};
+
+ ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ALOGI("startNetworkScan_InvalidMaxSearchTime2, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+}
+
+/*
+ * Test IRadioNetwork.startNetworkScan() with invalid periodicity (lower boundary).
+ */
+TEST_P(RadioNetworkTest, startNetworkScan_InvalidPeriodicity1) {
+ serial = GetRandomSerialNumber();
+
+ RadioAccessSpecifierBands bandP900 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_P900});
+ RadioAccessSpecifierBands band850 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_850});
+ RadioAccessSpecifier specifierP900 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
+ RadioAccessSpecifier specifier850 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
+
+ NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
+ .interval = 60,
+ .specifiers = {specifierP900, specifier850},
+ .maxSearchTime = 600,
+ .incrementalResults = true,
+ .incrementalResultsPeriodicity = 0};
+
+ ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ALOGI("startNetworkScan_InvalidPeriodicity1, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+}
+
+/*
+ * Test IRadioNetwork.startNetworkScan() with invalid periodicity (upper boundary).
+ */
+TEST_P(RadioNetworkTest, startNetworkScan_InvalidPeriodicity2) {
+ serial = GetRandomSerialNumber();
+
+ RadioAccessSpecifierBands bandP900 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_P900});
+ RadioAccessSpecifierBands band850 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_850});
+ RadioAccessSpecifier specifierP900 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
+ RadioAccessSpecifier specifier850 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
+
+ NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
+ .interval = 60,
+ .specifiers = {specifierP900, specifier850},
+ .maxSearchTime = 600,
+ .incrementalResults = true,
+ .incrementalResultsPeriodicity = 11};
+
+ ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ALOGI("startNetworkScan_InvalidPeriodicity2, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+}
+
+/*
+ * Test IRadioNetwork.startNetworkScan() with valid periodicity
+ */
+TEST_P(RadioNetworkTest, startNetworkScan_GoodRequest1) {
+ serial = GetRandomSerialNumber();
+
+ RadioAccessSpecifierBands bandP900 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_P900});
+ RadioAccessSpecifierBands band850 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_850});
+ RadioAccessSpecifier specifierP900 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
+ RadioAccessSpecifier specifier850 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
+
+ NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
+ .interval = 60,
+ .specifiers = {specifierP900, specifier850},
+ .maxSearchTime = 360,
+ .incrementalResults = false,
+ .incrementalResultsPeriodicity = 10};
+
+ ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ALOGI("startNetworkScan_GoodRequest1, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::SIM_ABSENT}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
+ RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+
+ if (radioRsp_network->rspInfo.error == RadioError::NONE) {
+ ALOGI("Stop Network Scan");
+ stopNetworkScan();
+ }
+}
+
+/*
+ * Test IRadioNetwork.startNetworkScan() with valid periodicity and plmns
+ */
+TEST_P(RadioNetworkTest, startNetworkScan_GoodRequest2) {
+ serial = GetRandomSerialNumber();
+
+ RadioAccessSpecifierBands bandP900 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_P900});
+ RadioAccessSpecifierBands band850 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
+ {GeranBands::BAND_850});
+ RadioAccessSpecifier specifierP900 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
+ RadioAccessSpecifier specifier850 = {
+ .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
+
+ NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
+ .interval = 60,
+ .specifiers = {specifierP900, specifier850},
+ .maxSearchTime = 360,
+ .incrementalResults = false,
+ .incrementalResultsPeriodicity = 10,
+ .mccMncs = {"310410"}};
+
+ ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ALOGI("startNetworkScan_GoodRequest2, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::SIM_ABSENT}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
+ RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+
+ if (radioRsp_network->rspInfo.error == RadioError::NONE) {
+ ALOGI("Stop Network Scan");
+ stopNetworkScan();
+ }
+}
+
+/*
+ * Test IRadioNetwork.setNetworkSelectionModeManual() for the response returned.
+ */
+TEST_P(RadioNetworkTest, setNetworkSelectionModeManual) {
+ serial = GetRandomSerialNumber();
+
+ // can't camp on nonexistent MCCMNC, so we expect this to fail.
+ ndk::ScopedAStatus res =
+ radio_network->setNetworkSelectionModeManual(serial, "123456", AccessNetwork::GERAN);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::ILLEGAL_SIM_OR_ME,
+ RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE},
+ CHECK_GENERAL_ERROR));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE},
+ CHECK_GENERAL_ERROR));
+ }
+}
+
+/*
+ * Test IRadioNetwork.getBarringInfo() for the response returned.
+ */
+TEST_P(RadioNetworkTest, getBarringInfo) {
+ serial = GetRandomSerialNumber();
+ ndk::ScopedAStatus res = radio_network->getBarringInfo(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ASSERT_TRUE(radioRsp_network->barringInfoList.size() > 0);
+
+ std::set<int> reportedServices;
+
+ // validate that the service types are in range
+ for (const auto& info : radioRsp_network->barringInfoList) {
+ ASSERT_TRUE((info.serviceType >= BarringInfo::SERVICE_TYPE_CS_SERVICE &&
+ info.serviceType <= BarringInfo::SERVICE_TYPE_SMS) ||
+ (info.serviceType >= BarringInfo::SERVICE_TYPE_OPERATOR_1 &&
+ info.serviceType <= BarringInfo::SERVICE_TYPE_OPERATOR_32));
+ reportedServices.insert(info.serviceType);
+
+ // Any type that is "conditional" must have valid values for conditional barring
+ // factor and time.
+ switch (info.barringType) {
+ case BarringInfo::BARRING_TYPE_NONE: // fall through
+ case BarringInfo::BARRING_TYPE_UNCONDITIONAL:
+ break;
+ case BarringInfo::BARRING_TYPE_CONDITIONAL: {
+ const int32_t barringFactor = info.barringTypeSpecificInfo->factor;
+ ASSERT_TRUE(barringFactor >= 0 && barringFactor <= 100);
+ ASSERT_TRUE(info.barringTypeSpecificInfo->timeSeconds > 0);
+ break;
+ }
+ default:
+ FAIL();
+ }
+ }
+
+ // Certain types of barring are relevant for certain RANs. Ensure that only the right
+ // types are reported. Note that no types are required, simply that for a given technology
+ // only certain types are valid. This is one way to check that implementations are
+ // not providing information that they don't have.
+ static const std::set<int> UTRA_SERVICES{
+ BarringInfo::SERVICE_TYPE_CS_SERVICE, BarringInfo::SERVICE_TYPE_PS_SERVICE,
+ BarringInfo::SERVICE_TYPE_CS_VOICE, BarringInfo::SERVICE_TYPE_EMERGENCY,
+ BarringInfo::SERVICE_TYPE_SMS,
+ };
+
+ static const std::set<int> EUTRA_SERVICES{
+ BarringInfo::SERVICE_TYPE_MO_SIGNALLING, BarringInfo::SERVICE_TYPE_MO_DATA,
+ BarringInfo::SERVICE_TYPE_CS_FALLBACK, BarringInfo::SERVICE_TYPE_MMTEL_VOICE,
+ BarringInfo::SERVICE_TYPE_MMTEL_VIDEO, BarringInfo::SERVICE_TYPE_EMERGENCY,
+ BarringInfo::SERVICE_TYPE_SMS,
+ };
+
+ static const std::set<int> NGRA_SERVICES = {
+ BarringInfo::SERVICE_TYPE_MO_SIGNALLING, BarringInfo::SERVICE_TYPE_MO_DATA,
+ BarringInfo::SERVICE_TYPE_CS_FALLBACK, BarringInfo::SERVICE_TYPE_MMTEL_VOICE,
+ BarringInfo::SERVICE_TYPE_MMTEL_VIDEO, BarringInfo::SERVICE_TYPE_EMERGENCY,
+ BarringInfo::SERVICE_TYPE_SMS, BarringInfo::SERVICE_TYPE_OPERATOR_1,
+ BarringInfo::SERVICE_TYPE_OPERATOR_2, BarringInfo::SERVICE_TYPE_OPERATOR_3,
+ BarringInfo::SERVICE_TYPE_OPERATOR_4, BarringInfo::SERVICE_TYPE_OPERATOR_5,
+ BarringInfo::SERVICE_TYPE_OPERATOR_6, BarringInfo::SERVICE_TYPE_OPERATOR_7,
+ BarringInfo::SERVICE_TYPE_OPERATOR_8, BarringInfo::SERVICE_TYPE_OPERATOR_9,
+ BarringInfo::SERVICE_TYPE_OPERATOR_10, BarringInfo::SERVICE_TYPE_OPERATOR_11,
+ BarringInfo::SERVICE_TYPE_OPERATOR_12, BarringInfo::SERVICE_TYPE_OPERATOR_13,
+ BarringInfo::SERVICE_TYPE_OPERATOR_14, BarringInfo::SERVICE_TYPE_OPERATOR_15,
+ BarringInfo::SERVICE_TYPE_OPERATOR_16, BarringInfo::SERVICE_TYPE_OPERATOR_17,
+ BarringInfo::SERVICE_TYPE_OPERATOR_18, BarringInfo::SERVICE_TYPE_OPERATOR_19,
+ BarringInfo::SERVICE_TYPE_OPERATOR_20, BarringInfo::SERVICE_TYPE_OPERATOR_21,
+ BarringInfo::SERVICE_TYPE_OPERATOR_22, BarringInfo::SERVICE_TYPE_OPERATOR_23,
+ BarringInfo::SERVICE_TYPE_OPERATOR_24, BarringInfo::SERVICE_TYPE_OPERATOR_25,
+ BarringInfo::SERVICE_TYPE_OPERATOR_26, BarringInfo::SERVICE_TYPE_OPERATOR_27,
+ BarringInfo::SERVICE_TYPE_OPERATOR_28, BarringInfo::SERVICE_TYPE_OPERATOR_29,
+ BarringInfo::SERVICE_TYPE_OPERATOR_30, BarringInfo::SERVICE_TYPE_OPERATOR_31,
+ };
+
+ const std::set<int>* compareTo = nullptr;
+
+ switch (radioRsp_network->barringCellIdentity.getTag()) {
+ case CellIdentity::Tag::wcdma:
+ // fall through
+ case CellIdentity::Tag::tdscdma:
+ compareTo = &UTRA_SERVICES;
+ break;
+ case CellIdentity::Tag::lte:
+ compareTo = &EUTRA_SERVICES;
+ break;
+ case CellIdentity::Tag::nr:
+ compareTo = &NGRA_SERVICES;
+ break;
+ case CellIdentity::Tag::cdma:
+ // fall through
+ default:
+ FAIL();
+ break;
+ }
+
+ std::set<int> diff;
+
+ std::set_difference(reportedServices.begin(), reportedServices.end(), compareTo->begin(),
+ compareTo->end(), std::inserter(diff, diff.begin()));
+}
+
+/*
+ * Test IRadioNetwork.getSignalStrength() for the response returned.
+ */
+TEST_P(RadioNetworkTest, getSignalStrength) {
+ serial = GetRandomSerialNumber();
+
+ radio_network->getSignalStrength(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error);
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE}));
+ }
+}
+
+/*
+ * Test IRadioNetwork.getCellInfoList() for the response returned.
+ */
+TEST_P(RadioNetworkTest, getCellInfoList) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = radio_network->getCellInfoList(serial);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("getCellInfoList, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::NO_NETWORK_FOUND}));
+}
+
+/*
+ * Test IRadioNetwork.getVoiceRegistrationState() for the response returned.
+ */
+TEST_P(RadioNetworkTest, getVoiceRegistrationState) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = radio_network->getVoiceRegistrationState(serial);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("getVoiceRegistrationStateResponse, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE}));
+}
+
+/*
+ * Test IRadioNetwork.getDataRegistrationState() for the response returned.
+ */
+TEST_P(RadioNetworkTest, getDataRegistrationState) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = radio_network->getDataRegistrationState(serial);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("getDataRegistrationStateResponse, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::NOT_PROVISIONED}));
+
+ // Check the mcc [0, 999] and mnc [0, 999].
+ std::string mcc;
+ std::string mnc;
+ bool checkMccMnc = true;
+ CellIdentity cellIdentity = radioRsp_network->dataRegResp.cellIdentity;
+ switch (cellIdentity.getTag()) {
+ case CellIdentity::noinit: {
+ checkMccMnc = false;
+ break;
+ }
+ case CellIdentity::gsm: {
+ CellIdentityGsm cig = cellIdentity.get<CellIdentity::gsm>();
+ mcc = cig.mcc;
+ mnc = cig.mnc;
+ break;
+ }
+ case CellIdentity::wcdma: {
+ CellIdentityWcdma ciw = cellIdentity.get<CellIdentity::wcdma>();
+ mcc = ciw.mcc;
+ mnc = ciw.mnc;
+ break;
+ }
+ case CellIdentity::tdscdma: {
+ CellIdentityTdscdma cit = cellIdentity.get<CellIdentity::tdscdma>();
+ mcc = cit.mcc;
+ mnc = cit.mnc;
+ break;
+ }
+ case CellIdentity::cdma: {
+ // CellIdentityCdma has no mcc/mnc
+ CellIdentityCdma cic = cellIdentity.get<CellIdentity::cdma>();
+ checkMccMnc = false;
+ break;
+ }
+ case CellIdentity::lte: {
+ CellIdentityLte cil = cellIdentity.get<CellIdentity::lte>();
+ mcc = cil.mcc;
+ mnc = cil.mnc;
+ break;
+ }
+ case CellIdentity::nr: {
+ CellIdentityNr cin = cellIdentity.get<CellIdentity::nr>();
+ mcc = cin.mcc;
+ mnc = cin.mnc;
+ break;
+ }
+ }
+
+ // 32 bit system might return invalid mcc and mnc string "\xff\xff..."
+ if (checkMccMnc && mcc.size() < 4 && mnc.size() < 4) {
+ int mcc_int = stoi(mcc);
+ int mnc_int = stoi(mnc);
+ EXPECT_TRUE(mcc_int >= 0 && mcc_int <= 999);
+ EXPECT_TRUE(mnc_int >= 0 && mnc_int <= 999);
+ }
+
+ // Check for access technology specific info
+ AccessTechnologySpecificInfo info = radioRsp_network->dataRegResp.accessTechnologySpecificInfo;
+ RadioTechnology rat = radioRsp_network->dataRegResp.rat;
+ // TODO: add logic for cdmaInfo
+ if (rat == RadioTechnology::LTE || rat == RadioTechnology::LTE_CA) {
+ ASSERT_EQ(info.getTag(), AccessTechnologySpecificInfo::eutranInfo);
+ } else if (rat == RadioTechnology::NR) {
+ ASSERT_EQ(info.getTag(), AccessTechnologySpecificInfo::ngranNrVopsInfo);
+ }
+}
+
+/*
+ * Test IRadioNetwork.getAvailableBandModes() for the response returned.
+ */
+TEST_P(RadioNetworkTest, getAvailableBandModes) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = radio_network->getAvailableBandModes(serial);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ALOGI("getAvailableBandModes, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::MODEM_ERR, RadioError::INTERNAL_ERR,
+ // If REQUEST_NOT_SUPPORTED is returned, then it should also be
+ // returned for setBandMode().
+ RadioError::REQUEST_NOT_SUPPORTED}));
+ bool hasUnspecifiedBandMode = false;
+ if (radioRsp_network->rspInfo.error == RadioError::NONE) {
+ for (const RadioBandMode& mode : radioRsp_network->radioBandModes) {
+ // Automatic mode selection must be supported
+ if (mode == RadioBandMode::BAND_MODE_UNSPECIFIED) hasUnspecifiedBandMode = true;
+ }
+ ASSERT_TRUE(hasUnspecifiedBandMode);
+ }
+}
+
+/*
+ * Test IRadioNetwork.setIndicationFilter()
+ */
+TEST_P(RadioNetworkTest, setIndicationFilter) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res =
+ radio_network->setIndicationFilter(serial, static_cast<int>(IndicationFilter::ALL));
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ALOGI("setIndicationFilter, rspInfo.error = %s\n",
+ toString(radioRsp_network->rspInfo.error).c_str());
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE}));
+}
+
+/*
+ * Test IRadioNetwork.setBarringPassword() for the response returned.
+ */
+TEST_P(RadioNetworkTest, setBarringPassword) {
+ serial = GetRandomSerialNumber();
+ std::string facility = "";
+ std::string oldPassword = "";
+ std::string newPassword = "";
+
+ radio_network->setBarringPassword(serial, facility, oldPassword, newPassword);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::FDN_CHECK_FAILURE,
+ RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+}
+
+/*
+ * Test IRadioNetwork.setSuppServiceNotifications() for the response returned.
+ */
+TEST_P(RadioNetworkTest, setSuppServiceNotifications) {
+ serial = GetRandomSerialNumber();
+ bool enable = false;
+
+ radio_network->setSuppServiceNotifications(serial, enable);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::SIM_ABSENT}));
+ }
+}
+
+/*
+ * Test IRadioNetwork.getImsRegistrationState() for the response returned.
+ */
+TEST_P(RadioNetworkTest, getImsRegistrationState) {
+ serial = GetRandomSerialNumber();
+
+ radio_network->getImsRegistrationState(serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::MODEM_ERR, RadioError::INVALID_MODEM_STATE},
+ CHECK_GENERAL_ERROR));
+ }
+}
+
+/*
+ * Test IRadioNetwork.getOperator() for the response returned.
+ */
+TEST_P(RadioNetworkTest, getOperator) {
+ LOG(DEBUG) << "getOperator";
+ serial = GetRandomSerialNumber();
+
+ radio_network->getOperator(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error);
+ }
+ LOG(DEBUG) << "getOperator finished";
+}
+
+/*
+ * Test IRadioNetwork.getNetworkSelectionMode() for the response returned.
+ */
+TEST_P(RadioNetworkTest, getNetworkSelectionMode) {
+ LOG(DEBUG) << "getNetworkSelectionMode";
+ serial = GetRandomSerialNumber();
+
+ radio_network->getNetworkSelectionMode(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error);
+ }
+ LOG(DEBUG) << "getNetworkSelectionMode finished";
+}
+
+/*
+ * Test IRadioNetwork.setNetworkSelectionModeAutomatic() for the response returned.
+ */
+TEST_P(RadioNetworkTest, setNetworkSelectionModeAutomatic) {
+ LOG(DEBUG) << "setNetworkSelectionModeAutomatic";
+ serial = GetRandomSerialNumber();
+
+ radio_network->setNetworkSelectionModeAutomatic(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::ILLEGAL_SIM_OR_ME,
+ RadioError::OPERATION_NOT_ALLOWED},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "setNetworkSelectionModeAutomatic finished";
+}
+
+/*
+ * Test IRadioNetwork.getAvailableNetworks() for the response returned.
+ */
+TEST_P(RadioNetworkTest, getAvailableNetworks) {
+ LOG(DEBUG) << "getAvailableNetworks";
+ serial = GetRandomSerialNumber();
+
+ radio_network->getAvailableNetworks(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ASSERT_TRUE(radioRsp_network->rspInfo.type == RadioResponseType::SOLICITED ||
+ radioRsp_network->rspInfo.type == RadioResponseType::SOLICITED_ACK_EXP);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::CANCELLED, RadioError::DEVICE_IN_USE,
+ RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "getAvailableNetworks finished";
+}
+
+/*
+ * Test IRadioNetwork.setBandMode() for the response returned.
+ */
+TEST_P(RadioNetworkTest, setBandMode) {
+ LOG(DEBUG) << "setBandMode";
+ serial = GetRandomSerialNumber();
+
+ radio_network->setBandMode(serial, RadioBandMode::BAND_MODE_USA);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "setBandMode finished";
+}
+
+/*
+ * Test IRadioNetwork.setLocationUpdates() for the response returned.
+ */
+TEST_P(RadioNetworkTest, setLocationUpdates) {
+ LOG(DEBUG) << "setLocationUpdates";
+ serial = GetRandomSerialNumber();
+
+ radio_network->setLocationUpdates(serial, true);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::SIM_ABSENT}));
+ }
+ LOG(DEBUG) << "setLocationUpdates finished";
+}
+
+/*
+ * Test IRadioNetwork.setCdmaRoamingPreference() for the response returned.
+ */
+TEST_P(RadioNetworkTest, setCdmaRoamingPreference) {
+ LOG(DEBUG) << "setCdmaRoamingPreference";
+ serial = GetRandomSerialNumber();
+
+ radio_network->setCdmaRoamingPreference(serial, CdmaRoamingType::HOME_NETWORK);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+ LOG(DEBUG) << "setCdmaRoamingPreference finished";
+}
+
+/*
+ * Test IRadioNetwork.getCdmaRoamingPreference() for the response returned.
+ */
+TEST_P(RadioNetworkTest, getCdmaRoamingPreference) {
+ LOG(DEBUG) << "getCdmaRoamingPreference";
+ serial = GetRandomSerialNumber();
+
+ radio_network->getCdmaRoamingPreference(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "getCdmaRoamingPreference finished";
+}
+
+/*
+ * Test IRadioNetwork.getVoiceRadioTechnology() for the response returned.
+ */
+TEST_P(RadioNetworkTest, getVoiceRadioTechnology) {
+ LOG(DEBUG) << "getVoiceRadioTechnology";
+ serial = GetRandomSerialNumber();
+
+ radio_network->getVoiceRadioTechnology(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error);
+ }
+ LOG(DEBUG) << "getVoiceRadioTechnology finished";
+}
+
+/*
+ * Test IRadioNetwork.setCellInfoListRate() for the response returned.
+ */
+TEST_P(RadioNetworkTest, setCellInfoListRate) {
+ LOG(DEBUG) << "setCellInfoListRate";
+ serial = GetRandomSerialNumber();
+
+ radio_network->setCellInfoListRate(serial, 10);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+ LOG(DEBUG) << "setCellInfoListRate finished";
+}
+
+/*
+ * Test IRadioNetwork.supplyNetworkDepersonalization() for the response returned.
+ */
+TEST_P(RadioNetworkTest, supplyNetworkDepersonalization) {
+ LOG(DEBUG) << "supplyNetworkDepersonalization";
+ serial = GetRandomSerialNumber();
+
+ radio_network->supplyNetworkDepersonalization(serial, std::string("test"));
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::INTERNAL_ERR,
+ RadioError::INVALID_SIM_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY,
+ RadioError::PASSWORD_INCORRECT, RadioError::SIM_ABSENT, RadioError::SYSTEM_ERR}));
+ }
+ LOG(DEBUG) << "supplyNetworkDepersonalization finished";
}
diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h
index 9f76769..29ba2f2 100644
--- a/radio/aidl/vts/radio_network_utils.h
+++ b/radio/aidl/vts/radio_network_utils.h
@@ -41,8 +41,9 @@
bool isNrDualConnectivityEnabled;
int networkTypeBitmapResponse;
RegStateResult voiceRegResp;
+ RegStateResult dataRegResp;
CellIdentity barringCellIdentity;
- std::vector<BarringInfo> barringInfos;
+ std::vector<BarringInfo> barringInfoList;
UsageSetting usageSetting;
virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
@@ -218,4 +219,6 @@
// Helper function to reduce copy+paste
void testSetUsageSetting_InvalidValues(std::vector<RadioError> errors);
+
+ void stopNetworkScan();
};
diff --git a/radio/aidl/vts/radio_sim_response.cpp b/radio/aidl/vts/radio_sim_response.cpp
index a783f43..391c9cb 100644
--- a/radio/aidl/vts/radio_sim_response.cpp
+++ b/radio/aidl/vts/radio_sim_response.cpp
@@ -23,44 +23,62 @@
}
ndk::ScopedAStatus RadioSimResponse::areUiccApplicationsEnabledResponse(
- const RadioResponseInfo& /*info*/, bool /*enabled*/) {
+ const RadioResponseInfo& info, bool enabled) {
+ rspInfo = info;
+ areUiccApplicationsEnabled = enabled;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::changeIccPin2ForAppResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioSimResponse::changeIccPin2ForAppResponse(const RadioResponseInfo& info,
int32_t /*remainingRetries*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::changeIccPinForAppResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioSimResponse::changeIccPinForAppResponse(const RadioResponseInfo& info,
int32_t /*remainingRetries*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::enableUiccApplicationsResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioSimResponse::enableUiccApplicationsResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioSimResponse::getAllowedCarriersResponse(
- const RadioResponseInfo& /*info*/, const CarrierRestrictions& /*carriers*/,
- SimLockMultiSimPolicy /*multiSimPolicy*/) {
+ const RadioResponseInfo& info, const CarrierRestrictions& carriers,
+ SimLockMultiSimPolicy multiSimPolicy) {
+ rspInfo = info;
+ carrierRestrictionsResp = carriers;
+ multiSimPolicyResp = multiSimPolicy;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioSimResponse::getCdmaSubscriptionResponse(
- const RadioResponseInfo& /*info*/, const std::string& /*mdn*/, const std::string& /*hSid*/,
+ const RadioResponseInfo& info, const std::string& /*mdn*/, const std::string& /*hSid*/,
const std::string& /*hNid*/, const std::string& /*min*/, const std::string& /*prl*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioSimResponse::getCdmaSubscriptionSourceResponse(
- const RadioResponseInfo& /*info*/, CdmaSubscriptionSource /*source*/) {
+ const RadioResponseInfo& info, CdmaSubscriptionSource /*source*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::getFacilityLockForAppResponse(
- const RadioResponseInfo& /*info*/, int32_t /*response*/) {
+ndk::ScopedAStatus RadioSimResponse::getFacilityLockForAppResponse(const RadioResponseInfo& info,
+ int32_t /*response*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -72,8 +90,11 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::getImsiForAppResponse(const RadioResponseInfo& /*info*/,
- const std::string& /*imsi*/) {
+ndk::ScopedAStatus RadioSimResponse::getImsiForAppResponse(const RadioResponseInfo& info,
+ const std::string& imsi_str) {
+ rspInfo = info;
+ imsi = imsi_str;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -91,58 +112,79 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::iccCloseLogicalChannelResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioSimResponse::iccCloseLogicalChannelResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::iccIoForAppResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioSimResponse::iccIoForAppResponse(const RadioResponseInfo& info,
const IccIoResult& /*iccIo*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioSimResponse::iccOpenLogicalChannelResponse(
- const RadioResponseInfo& /*info*/, int32_t /*channelId*/,
+ const RadioResponseInfo& info, int32_t /*channelId*/,
const std::vector<uint8_t>& /*selectResponse*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioSimResponse::iccTransmitApduBasicChannelResponse(
- const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) {
+ const RadioResponseInfo& info, const IccIoResult& /*result*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioSimResponse::iccTransmitApduLogicalChannelResponse(
- const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) {
+ const RadioResponseInfo& info, const IccIoResult& /*result*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioSimResponse::reportStkServiceIsRunningResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioSimResponse::requestIccSimAuthenticationResponse(
- const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) {
+ const RadioResponseInfo& info, const IccIoResult& /*result*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::sendEnvelopeResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioSimResponse::sendEnvelopeResponse(const RadioResponseInfo& info,
const std::string& /*commandResponse*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::sendEnvelopeWithStatusResponse(
- const RadioResponseInfo& /*info*/, const IccIoResult& /*iccIo*/) {
+ndk::ScopedAStatus RadioSimResponse::sendEnvelopeWithStatusResponse(const RadioResponseInfo& info,
+ const IccIoResult& /*iccIo*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioSimResponse::sendTerminalResponseToSimResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::setAllowedCarriersResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioSimResponse::setAllowedCarriersResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -154,12 +196,16 @@
}
ndk::ScopedAStatus RadioSimResponse::setCdmaSubscriptionSourceResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::setFacilityLockForAppResponse(
- const RadioResponseInfo& /*info*/, int32_t /*retry*/) {
+ndk::ScopedAStatus RadioSimResponse::setFacilityLockForAppResponse(const RadioResponseInfo& info,
+ int32_t /*retry*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -169,34 +215,44 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::setUiccSubscriptionResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioSimResponse::setUiccSubscriptionResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::supplyIccPin2ForAppResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioSimResponse::supplyIccPin2ForAppResponse(const RadioResponseInfo& info,
int32_t /*remainingRetries*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::supplyIccPinForAppResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioSimResponse::supplyIccPinForAppResponse(const RadioResponseInfo& info,
int32_t /*remainingRetries*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::supplyIccPuk2ForAppResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioSimResponse::supplyIccPuk2ForAppResponse(const RadioResponseInfo& info,
int32_t /*remainingRetries*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioSimResponse::supplyIccPukForAppResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioSimResponse::supplyIccPukForAppResponse(const RadioResponseInfo& info,
int32_t /*remainingRetries*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioSimResponse::supplySimDepersonalizationResponse(
- const RadioResponseInfo& /*info*/, PersoSubstate /*persoType*/,
- int32_t /*remainingRetries*/) {
+ const RadioResponseInfo& info, PersoSubstate /*persoType*/, int32_t /*remainingRetries*/) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp
index 5db77f6..64474c9 100644
--- a/radio/aidl/vts/radio_sim_test.cpp
+++ b/radio/aidl/vts/radio_sim_test.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <aidl/android/hardware/radio/RadioConst.h>
#include <aidl/android/hardware/radio/config/IRadioConfig.h>
#include <android-base/logging.h>
#include <android/binder_manager.h>
@@ -260,3 +261,764 @@
}
}
}
+
+/*
+ * Test IRadioSim.enableUiccApplications() for the response returned.
+ * For SIM ABSENT case.
+ */
+TEST_P(RadioSimTest, togglingUiccApplicationsSimAbsent) {
+ // This test case only test SIM ABSENT case.
+ if (cardStatus.cardState != CardStatus::STATE_ABSENT) return;
+
+ // Disable Uicc applications.
+ serial = GetRandomSerialNumber();
+ radio_sim->enableUiccApplications(serial, false);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ // As SIM is absent, RadioError::SIM_ABSENT should be thrown.
+ EXPECT_EQ(RadioError::SIM_ABSENT, radioRsp_sim->rspInfo.error);
+
+ // Query Uicc application enablement.
+ serial = GetRandomSerialNumber();
+ radio_sim->areUiccApplicationsEnabled(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ // As SIM is absent, RadioError::SIM_ABSENT should be thrown.
+ EXPECT_EQ(RadioError::SIM_ABSENT, radioRsp_sim->rspInfo.error);
+}
+
+/*
+ * Test IRadioSim.enableUiccApplications() for the response returned.
+ * For SIM PRESENT case.
+ */
+TEST_P(RadioSimTest, togglingUiccApplicationsSimPresent) {
+ // This test case only test SIM ABSENT case.
+ if (cardStatus.cardState != CardStatus::STATE_PRESENT) return;
+ if (cardStatus.applications.size() == 0) return;
+
+ // Disable Uicc applications.
+ serial = GetRandomSerialNumber();
+ radio_sim->enableUiccApplications(serial, false);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ // As SIM is present, there shouldn't be error.
+ EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
+
+ // Query Uicc application enablement.
+ serial = GetRandomSerialNumber();
+ radio_sim->areUiccApplicationsEnabled(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ // As SIM is present, there shouldn't be error.
+ EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
+ ASSERT_FALSE(radioRsp_sim->areUiccApplicationsEnabled);
+
+ // Enable Uicc applications.
+ serial = GetRandomSerialNumber();
+ radio_sim->enableUiccApplications(serial, true);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ // As SIM is present, there shouldn't be error.
+ EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
+
+ // Query Uicc application enablement.
+ serial = GetRandomSerialNumber();
+ radio_sim->areUiccApplicationsEnabled(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ // As SIM is present, there shouldn't be error.
+ EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
+ ASSERT_TRUE(radioRsp_sim->areUiccApplicationsEnabled);
+}
+
+/*
+ * Test IRadioSim.areUiccApplicationsEnabled() for the response returned.
+ */
+TEST_P(RadioSimTest, areUiccApplicationsEnabled) {
+ // Disable Uicc applications.
+ serial = GetRandomSerialNumber();
+ radio_sim->areUiccApplicationsEnabled(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ // If SIM is absent, RadioError::SIM_ABSENT should be thrown. Otherwise there shouldn't be any
+ // error.
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ EXPECT_EQ(RadioError::SIM_ABSENT, radioRsp_sim->rspInfo.error);
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadioSim.getAllowedCarriers() for the response returned.
+ */
+TEST_P(RadioSimTest, getAllowedCarriers) {
+ serial = GetRandomSerialNumber();
+
+ radio_sim->getAllowedCarriers(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+}
+
+/**
+ * Test IRadioSim.setAllowedCarriers() for the response returned.
+ */
+TEST_P(RadioSimTest, setAllowedCarriers) {
+ // TODO (b/210712359): remove once shim supports 1.4 or alternative is found
+ GTEST_SKIP();
+ serial = GetRandomSerialNumber();
+ CarrierRestrictions carrierRestrictions;
+ memset(&carrierRestrictions, 0, sizeof(carrierRestrictions));
+ carrierRestrictions.allowedCarriers.resize(1);
+ carrierRestrictions.excludedCarriers.resize(0);
+ carrierRestrictions.allowedCarriers[0].mcc = std::string("123");
+ carrierRestrictions.allowedCarriers[0].mnc = std::string("456");
+ carrierRestrictions.allowedCarriers[0].matchType = Carrier::MATCH_TYPE_ALL;
+ carrierRestrictions.allowedCarriers[0].matchData = std::string();
+ carrierRestrictions.allowedCarriersPrioritized = true;
+ SimLockMultiSimPolicy multisimPolicy = SimLockMultiSimPolicy::NO_MULTISIM_POLICY;
+
+ radio_sim->setAllowedCarriers(serial, carrierRestrictions, multisimPolicy);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+
+ if (radioRsp_sim->rspInfo.error == RadioError::NONE) {
+ /* Verify the update of the SIM status. This might need some time */
+ if (cardStatus.cardState != CardStatus::STATE_ABSENT) {
+ updateSimCardStatus();
+ auto startTime = std::chrono::system_clock::now();
+ while (cardStatus.cardState != CardStatus::STATE_RESTRICTED &&
+ std::chrono::duration_cast<std::chrono::seconds>(
+ std::chrono::system_clock::now() - startTime)
+ .count() < 30) {
+ /* Set 2 seconds as interval to check card status */
+ sleep(2);
+ updateSimCardStatus();
+ }
+ EXPECT_EQ(CardStatus::STATE_RESTRICTED, cardStatus.cardState);
+ }
+
+ /* Verify that configuration was set correctly, retrieving it from the modem */
+ serial = GetRandomSerialNumber();
+
+ radio_sim->getAllowedCarriers(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
+
+ EXPECT_EQ(1, radioRsp_sim->carrierRestrictionsResp.allowedCarriers.size());
+ EXPECT_EQ(0, radioRsp_sim->carrierRestrictionsResp.excludedCarriers.size());
+ ASSERT_TRUE(std::string("123") ==
+ radioRsp_sim->carrierRestrictionsResp.allowedCarriers[0].mcc);
+ ASSERT_TRUE(std::string("456") ==
+ radioRsp_sim->carrierRestrictionsResp.allowedCarriers[0].mnc);
+ EXPECT_EQ(Carrier::MATCH_TYPE_ALL,
+ radioRsp_sim->carrierRestrictionsResp.allowedCarriers[0].matchType);
+ ASSERT_TRUE(radioRsp_sim->carrierRestrictionsResp.allowedCarriersPrioritized);
+ EXPECT_EQ(SimLockMultiSimPolicy::NO_MULTISIM_POLICY, radioRsp_sim->multiSimPolicyResp);
+
+ sleep(10);
+
+ /**
+ * Another test case of the API to cover to allow carrier.
+ * If the API is supported, this is also used to reset to no carrier restriction
+ * status for cardStatus.
+ */
+ memset(&carrierRestrictions, 0, sizeof(carrierRestrictions));
+ carrierRestrictions.allowedCarriers.resize(0);
+ carrierRestrictions.excludedCarriers.resize(0);
+ carrierRestrictions.allowedCarriersPrioritized = false;
+
+ serial = GetRandomSerialNumber();
+ radio_sim->setAllowedCarriers(serial, carrierRestrictions, multisimPolicy);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
+
+ if (cardStatus.cardState != CardStatus::STATE_ABSENT) {
+ /* Resetting back to no carrier restriction needs some time */
+ updateSimCardStatus();
+ auto startTime = std::chrono::system_clock::now();
+ while (cardStatus.cardState == CardStatus::STATE_RESTRICTED &&
+ std::chrono::duration_cast<std::chrono::seconds>(
+ std::chrono::system_clock::now() - startTime)
+ .count() < 10) {
+ /* Set 2 seconds as interval to check card status */
+ sleep(2);
+ updateSimCardStatus();
+ }
+ EXPECT_NE(CardStatus::STATE_RESTRICTED, cardStatus.cardState);
+ sleep(10);
+ }
+ }
+}
+
+/*
+ * Test IRadioSim.getIccCardStatus() for the response returned.
+ */
+TEST_P(RadioSimTest, getIccCardStatus) {
+ LOG(DEBUG) << "getIccCardStatus";
+ EXPECT_LE(cardStatus.applications.size(), RadioConst::CARD_MAX_APPS);
+ EXPECT_LT(cardStatus.gsmUmtsSubscriptionAppIndex, RadioConst::CARD_MAX_APPS);
+ EXPECT_LT(cardStatus.cdmaSubscriptionAppIndex, RadioConst::CARD_MAX_APPS);
+ EXPECT_LT(cardStatus.imsSubscriptionAppIndex, RadioConst::CARD_MAX_APPS);
+ LOG(DEBUG) << "getIccCardStatus finished";
+}
+
+/*
+ * Test IRadioSim.supplyIccPinForApp() for the response returned
+ */
+TEST_P(RadioSimTest, supplyIccPinForApp) {
+ LOG(DEBUG) << "supplyIccPinForApp";
+ serial = GetRandomSerialNumber();
+
+ // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+ // 3GPP2 apps only
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) {
+ radio_sim->supplyIccPinForApp(serial, std::string("test1"),
+ cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_sim->rspInfo.error,
+ {RadioError::PASSWORD_INCORRECT, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+ }
+ LOG(DEBUG) << "supplyIccPinForApp finished";
+}
+
+/*
+ * Test IRadioSim.supplyIccPukForApp() for the response returned.
+ */
+TEST_P(RadioSimTest, supplyIccPukForApp) {
+ LOG(DEBUG) << "supplyIccPukForApp";
+ serial = GetRandomSerialNumber();
+
+ // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+ // 3GPP2 apps only
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) {
+ radio_sim->supplyIccPukForApp(serial, std::string("test1"), std::string("test2"),
+ cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_sim->rspInfo.error,
+ {RadioError::PASSWORD_INCORRECT, RadioError::INVALID_SIM_STATE}));
+ }
+ }
+ LOG(DEBUG) << "supplyIccPukForApp finished";
+}
+
+/*
+ * Test IRadioSim.supplyIccPin2ForApp() for the response returned.
+ */
+TEST_P(RadioSimTest, supplyIccPin2ForApp) {
+ LOG(DEBUG) << "supplyIccPin2ForApp";
+ serial = GetRandomSerialNumber();
+
+ // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+ // 3GPP2 apps only
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) {
+ radio_sim->supplyIccPin2ForApp(serial, std::string("test1"),
+ cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::PASSWORD_INCORRECT,
+ RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_PUK2}));
+ }
+ }
+ LOG(DEBUG) << "supplyIccPin2ForApp finished";
+}
+
+/*
+ * Test IRadioSim.supplyIccPuk2ForApp() for the response returned.
+ */
+TEST_P(RadioSimTest, supplyIccPuk2ForApp) {
+ LOG(DEBUG) << "supplyIccPuk2ForApp";
+ serial = GetRandomSerialNumber();
+
+ // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+ // 3GPP2 apps only
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) {
+ radio_sim->supplyIccPuk2ForApp(serial, std::string("test1"), std::string("test2"),
+ cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_sim->rspInfo.error,
+ {RadioError::PASSWORD_INCORRECT, RadioError::INVALID_SIM_STATE}));
+ }
+ }
+ LOG(DEBUG) << "supplyIccPuk2ForApp finished";
+}
+
+/*
+ * Test IRadioSim.changeIccPinForApp() for the response returned.
+ */
+TEST_P(RadioSimTest, changeIccPinForApp) {
+ LOG(DEBUG) << "changeIccPinForApp";
+ serial = GetRandomSerialNumber();
+
+ // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+ // 3GPP2 apps only
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) {
+ radio_sim->changeIccPinForApp(serial, std::string("test1"), std::string("test2"),
+ cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_sim->rspInfo.error,
+ {RadioError::PASSWORD_INCORRECT, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+ }
+ LOG(DEBUG) << "changeIccPinForApp finished";
+}
+
+/*
+ * Test IRadioSim.changeIccPin2ForApp() for the response returned.
+ */
+TEST_P(RadioSimTest, changeIccPin2ForApp) {
+ LOG(DEBUG) << "changeIccPin2ForApp";
+ serial = GetRandomSerialNumber();
+
+ // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
+ // 3GPP2 apps only
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) {
+ radio_sim->changeIccPin2ForApp(serial, std::string("test1"), std::string("test2"),
+ cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::PASSWORD_INCORRECT,
+ RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_PUK2}));
+ }
+ }
+ LOG(DEBUG) << "changeIccPin2ForApp finished";
+}
+
+/*
+ * Test IRadioSim.getImsiForApp() for the response returned.
+ */
+TEST_P(RadioSimTest, getImsiForApp) {
+ LOG(DEBUG) << "getImsiForApp";
+ serial = GetRandomSerialNumber();
+
+ // Check success returned while getting imsi for 3GPP and 3GPP2 apps only
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM ||
+ cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) {
+ radio_sim->getImsiForApp(serial, cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, {RadioError::NONE},
+ CHECK_GENERAL_ERROR));
+
+ // IMSI (MCC+MNC+MSIN) is at least 6 digits, but not more than 15
+ if (radioRsp_sim->rspInfo.error == RadioError::NONE) {
+ EXPECT_NE(radioRsp_sim->imsi, std::string());
+ EXPECT_GE((int)(radioRsp_sim->imsi).size(), 6);
+ EXPECT_LE((int)(radioRsp_sim->imsi).size(), 15);
+ }
+ }
+ }
+ LOG(DEBUG) << "getImsiForApp finished";
+}
+
+/*
+ * Test IRadioSim.iccIoForApp() for the response returned.
+ */
+TEST_P(RadioSimTest, iccIoForApp) {
+ LOG(DEBUG) << "iccIoForApp";
+ serial = GetRandomSerialNumber();
+
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ IccIo iccIo;
+ iccIo.command = 0xc0;
+ iccIo.fileId = 0x6f11;
+ iccIo.path = std::string("3F007FFF");
+ iccIo.p1 = 0;
+ iccIo.p2 = 0;
+ iccIo.p3 = 0;
+ iccIo.data = std::string();
+ iccIo.pin2 = std::string();
+ iccIo.aid = cardStatus.applications[i].aidPtr;
+
+ radio_sim->iccIoForApp(serial, iccIo);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ }
+ LOG(DEBUG) << "iccIoForApp finished";
+}
+
+/*
+ * Test IRadioSim.iccTransmitApduBasicChannel() for the response returned.
+ */
+TEST_P(RadioSimTest, iccTransmitApduBasicChannel) {
+ LOG(DEBUG) << "iccTransmitApduBasicChannel";
+ serial = GetRandomSerialNumber();
+ SimApdu msg;
+ memset(&msg, 0, sizeof(msg));
+ msg.data = std::string();
+
+ radio_sim->iccTransmitApduBasicChannel(serial, msg);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ LOG(DEBUG) << "iccTransmitApduBasicChannel finished";
+}
+
+/*
+ * Test IRadioSim.iccOpenLogicalChannel() for the response returned.
+ */
+TEST_P(RadioSimTest, iccOpenLogicalChannel) {
+ LOG(DEBUG) << "iccOpenLogicalChannel";
+ serial = GetRandomSerialNumber();
+ int p2 = 0x04;
+ // Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested.
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ radio_sim->iccOpenLogicalChannel(serial, cardStatus.applications[i].aidPtr, p2);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ }
+ LOG(DEBUG) << "iccOpenLogicalChannel finished";
+}
+
+/*
+ * Test IRadioSim.iccCloseLogicalChannel() for the response returned.
+ */
+TEST_P(RadioSimTest, iccCloseLogicalChannel) {
+ LOG(DEBUG) << "iccCloseLogicalChannel";
+ serial = GetRandomSerialNumber();
+ // Try closing invalid channel and check INVALID_ARGUMENTS returned as error
+ radio_sim->iccCloseLogicalChannel(serial, 0);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp_sim->rspInfo.error);
+ LOG(DEBUG) << "iccCloseLogicalChannel finished";
+}
+
+/*
+ * Test IRadioSim.iccTransmitApduLogicalChannel() for the response returned.
+ */
+TEST_P(RadioSimTest, iccTransmitApduLogicalChannel) {
+ LOG(DEBUG) << "iccTransmitApduLogicalChannel";
+ serial = GetRandomSerialNumber();
+ SimApdu msg;
+ memset(&msg, 0, sizeof(msg));
+ msg.data = std::string();
+
+ radio_sim->iccTransmitApduLogicalChannel(serial, msg);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ LOG(DEBUG) << "iccTransmitApduLogicalChannel finished";
+}
+
+/*
+ * Test IRadioSim.requestIccSimAuthentication() for the response returned.
+ */
+TEST_P(RadioSimTest, requestIccSimAuthentication) {
+ LOG(DEBUG) << "requestIccSimAuthentication";
+ serial = GetRandomSerialNumber();
+
+ // Pass wrong challenge string and check RadioError::INVALID_ARGUMENTS
+ // or REQUEST_NOT_SUPPORTED returned as error.
+ for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
+ radio_sim->requestIccSimAuthentication(serial, 0, std::string("test"),
+ cardStatus.applications[i].aidPtr);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_sim->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+ LOG(DEBUG) << "requestIccSimAuthentication finished";
+}
+
+/*
+ * Test IRadioSim.getFacilityLockForApp() for the response returned.
+ */
+TEST_P(RadioSimTest, getFacilityLockForApp) {
+ serial = GetRandomSerialNumber();
+ std::string facility = "";
+ std::string password = "";
+ int32_t serviceClass = 1;
+ std::string appId = "";
+
+ radio_sim->getFacilityLockForApp(serial, facility, password, serviceClass, appId);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+}
+
+/*
+ * Test IRadioSim.setFacilityLockForApp() for the response returned.
+ */
+TEST_P(RadioSimTest, setFacilityLockForApp) {
+ serial = GetRandomSerialNumber();
+ std::string facility = "";
+ bool lockState = false;
+ std::string password = "";
+ int32_t serviceClass = 1;
+ std::string appId = "";
+
+ radio_sim->setFacilityLockForApp(serial, facility, lockState, password, serviceClass, appId);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+}
+
+/*
+ * Test IRadioSim.getCdmaSubscription() for the response returned.
+ */
+TEST_P(RadioSimTest, getCdmaSubscription) {
+ LOG(DEBUG) << "getCdmaSubscription";
+ serial = GetRandomSerialNumber();
+
+ radio_sim->getCdmaSubscription(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT}));
+ }
+ LOG(DEBUG) << "getCdmaSubscription finished";
+}
+
+/*
+ * Test IRadioSim.getCdmaSubscriptionSource() for the response returned.
+ */
+TEST_P(RadioSimTest, getCdmaSubscriptionSource) {
+ LOG(DEBUG) << "getCdmaSubscriptionSource";
+ serial = GetRandomSerialNumber();
+
+ radio_sim->getCdmaSubscriptionSource(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT}));
+ }
+ LOG(DEBUG) << "getCdmaSubscriptionSource finished";
+}
+
+/*
+ * Test IRadioSim.setCdmaSubscriptionSource() for the response returned.
+ */
+TEST_P(RadioSimTest, setCdmaSubscriptionSource) {
+ LOG(DEBUG) << "setCdmaSubscriptionSource";
+ serial = GetRandomSerialNumber();
+
+ radio_sim->setCdmaSubscriptionSource(serial, CdmaSubscriptionSource::RUIM_SIM);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::SUBSCRIPTION_NOT_AVAILABLE},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "setCdmaSubscriptionSource finished";
+}
+
+/*
+ * Test IRadioSim.setUiccSubscription() for the response returned.
+ */
+TEST_P(RadioSimTest, setUiccSubscription) {
+ LOG(DEBUG) << "setUiccSubscription";
+ serial = GetRandomSerialNumber();
+ SelectUiccSub item;
+ memset(&item, 0, sizeof(item));
+
+ radio_sim->setUiccSubscription(serial, item);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
+ RadioError::MODEM_ERR, RadioError::SUBSCRIPTION_NOT_SUPPORTED},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "setUiccSubscription finished";
+}
+
+/*
+ * Test IRadioSim.sendEnvelope() for the response returned.
+ */
+TEST_P(RadioSimTest, sendEnvelope) {
+ LOG(DEBUG) << "sendEnvelope";
+ serial = GetRandomSerialNumber();
+
+ // Test with sending empty string
+ std::string content = "";
+
+ radio_sim->sendEnvelope(serial, content);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
+ RadioError::MODEM_ERR, RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "sendEnvelope finished";
+}
+
+/*
+ * Test IRadioSim.sendTerminalResponseToSim() for the response returned.
+ */
+TEST_P(RadioSimTest, sendTerminalResponseToSim) {
+ LOG(DEBUG) << "sendTerminalResponseToSim";
+ serial = GetRandomSerialNumber();
+
+ // Test with sending empty string
+ std::string commandResponse = "";
+
+ radio_sim->sendTerminalResponseToSim(serial, commandResponse);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "sendTerminalResponseToSim finished";
+}
+
+/*
+ * Test IRadioSim.reportStkServiceIsRunning() for the response returned.
+ */
+TEST_P(RadioSimTest, reportStkServiceIsRunning) {
+ LOG(DEBUG) << "reportStkServiceIsRunning";
+ serial = GetRandomSerialNumber();
+
+ radio_sim->reportStkServiceIsRunning(serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, {RadioError::NONE},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "reportStkServiceIsRunning finished";
+}
+
+/*
+ * Test IRadioSim.sendEnvelopeWithStatus() for the response returned with empty
+ * string.
+ */
+TEST_P(RadioSimTest, sendEnvelopeWithStatus) {
+ LOG(DEBUG) << "sendEnvelopeWithStatus";
+ serial = GetRandomSerialNumber();
+
+ // Test with sending empty string
+ std::string contents = "";
+
+ radio_sim->sendEnvelopeWithStatus(serial, contents);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_sim->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR, RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "sendEnvelopeWithStatus finished";
+}
diff --git a/radio/aidl/vts/radio_sim_utils.h b/radio/aidl/vts/radio_sim_utils.h
index b5e365d..83f1cbc 100644
--- a/radio/aidl/vts/radio_sim_utils.h
+++ b/radio/aidl/vts/radio_sim_utils.h
@@ -42,6 +42,7 @@
bool areUiccApplicationsEnabled;
PhonebookCapacity capacity;
int32_t updatedRecordIndex;
+ std::string imsi;
virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
diff --git a/radio/aidl/vts/radio_voice_indication.cpp b/radio/aidl/vts/radio_voice_indication.cpp
index d814c18..3fee326 100644
--- a/radio/aidl/vts/radio_voice_indication.cpp
+++ b/radio/aidl/vts/radio_voice_indication.cpp
@@ -65,6 +65,12 @@
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus RadioVoiceIndication::onUssd(RadioIndicationType /*type*/,
+ UssdModeType /*modeType*/,
+ const std::string& /*msg*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
ndk::ScopedAStatus RadioVoiceIndication::resendIncallMute(RadioIndicationType /*type*/) {
return ndk::ScopedAStatus::ok();
}
diff --git a/radio/aidl/vts/radio_voice_response.cpp b/radio/aidl/vts/radio_voice_response.cpp
index a491613..dd7b1bf 100644
--- a/radio/aidl/vts/radio_voice_response.cpp
+++ b/radio/aidl/vts/radio_voice_response.cpp
@@ -18,7 +18,9 @@
RadioVoiceResponse::RadioVoiceResponse(RadioServiceTest& parent) : parent_voice(parent) {}
-ndk::ScopedAStatus RadioVoiceResponse::acceptCallResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::acceptCallResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -26,11 +28,21 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::conferenceResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::cancelPendingUssdResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::dialResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::conferenceResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::dialResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -41,34 +53,44 @@
}
ndk::ScopedAStatus RadioVoiceResponse::exitEmergencyCallbackModeResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::explicitCallTransferResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::explicitCallTransferResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioVoiceResponse::getCallForwardStatusResponse(
- const RadioResponseInfo& /*info*/,
- const std::vector<CallForwardInfo>& /*callForwardInfos*/) {
+ const RadioResponseInfo& info, const std::vector<CallForwardInfo>& /*callForwardInfos*/) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::getCallWaitingResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioVoiceResponse::getCallWaitingResponse(const RadioResponseInfo& info,
bool /*enable*/,
int32_t /*serviceClass*/) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::getClipResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioVoiceResponse::getClipResponse(const RadioResponseInfo& info,
ClipStatus /*status*/) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::getClirResponse(const RadioResponseInfo& /*info*/,
- int32_t /*n*/, int32_t /*m*/) {
+ndk::ScopedAStatus RadioVoiceResponse::getClirResponse(const RadioResponseInfo& info, int32_t /*n*/,
+ int32_t /*m*/) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -81,27 +103,37 @@
}
ndk::ScopedAStatus RadioVoiceResponse::getLastCallFailCauseResponse(
- const RadioResponseInfo& /*info*/, const LastCallFailCauseInfo& /*failCauseInfo*/) {
+ const RadioResponseInfo& info, const LastCallFailCauseInfo& /*failCauseInfo*/) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::getMuteResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioVoiceResponse::getMuteResponse(const RadioResponseInfo& info,
bool /*enable*/) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioVoiceResponse::getPreferredVoicePrivacyResponse(
- const RadioResponseInfo& /*info*/, bool /*enable*/) {
+ const RadioResponseInfo& info, bool /*enable*/) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::getTtyModeResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioVoiceResponse::getTtyModeResponse(const RadioResponseInfo& info,
TtyMode /*mode*/) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioVoiceResponse::handleStkCallSetupRequestFromSimResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -112,80 +144,120 @@
}
ndk::ScopedAStatus RadioVoiceResponse::hangupForegroundResumeBackgroundResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioVoiceResponse::hangupWaitingOrBackgroundResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::isVoNrEnabledResponse(const RadioResponseInfo& /*info*/,
+ndk::ScopedAStatus RadioVoiceResponse::isVoNrEnabledResponse(const RadioResponseInfo& info,
bool /*enabled*/) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::rejectCallResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::rejectCallResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::sendBurstDtmfResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::sendBurstDtmfResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::sendCdmaFeatureCodeResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::sendCdmaFeatureCodeResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::sendDtmfResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::sendDtmfResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::separateConnectionResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::sendUssdResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::setCallForwardResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::separateConnectionResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::setCallWaitingResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::setCallForwardResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::setClirResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::setCallWaitingResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::setMuteResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::setClirResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::setMuteResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioVoiceResponse::setPreferredVoicePrivacyResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::setTtyModeResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::setTtyModeResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::setVoNrEnabledResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::setVoNrEnabledResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::startDtmfResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::startDtmfResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioVoiceResponse::stopDtmfResponse(const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioVoiceResponse::stopDtmfResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioVoiceResponse::switchWaitingOrHoldingAndActiveResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
diff --git a/radio/aidl/vts/radio_voice_test.cpp b/radio/aidl/vts/radio_voice_test.cpp
index 717f3f0..eec28b1 100644
--- a/radio/aidl/vts/radio_voice_test.cpp
+++ b/radio/aidl/vts/radio_voice_test.cpp
@@ -265,3 +265,681 @@
EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error);
}
+
+/*
+ * Test IRadioVoice.getClir() for the response returned.
+ */
+TEST_P(RadioVoiceTest, getClir) {
+ serial = GetRandomSerialNumber();
+
+ radio_voice->getClir(serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+}
+
+/*
+ * Test IRadioVoice.setClir() for the response returned.
+ */
+TEST_P(RadioVoiceTest, setClir) {
+ serial = GetRandomSerialNumber();
+ int32_t status = 1;
+
+ radio_voice->setClir(serial, status);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadioVoice.getClip() for the response returned.
+ */
+TEST_P(RadioVoiceTest, getClip) {
+ serial = GetRandomSerialNumber();
+
+ radio_voice->getClip(serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+}
+
+/*
+ * Test IRadioVoice.getTtyMode() for the response returned.
+ */
+TEST_P(RadioVoiceTest, getTtyMode) {
+ LOG(DEBUG) << "getTtyMode";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->getTtyMode(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error);
+ }
+ LOG(DEBUG) << "getTtyMode finished";
+}
+
+/*
+ * Test IRadioVoice.setTtyMode() for the response returned.
+ */
+TEST_P(RadioVoiceTest, setTtyMode) {
+ LOG(DEBUG) << "setTtyMode";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->setTtyMode(serial, TtyMode::OFF);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error);
+ }
+ LOG(DEBUG) << "setTtyMode finished";
+}
+
+/*
+ * Test IRadioVoice.setPreferredVoicePrivacy() for the response returned.
+ */
+TEST_P(RadioVoiceTest, setPreferredVoicePrivacy) {
+ LOG(DEBUG) << "setPreferredVoicePrivacy";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->setPreferredVoicePrivacy(serial, true);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+ LOG(DEBUG) << "setPreferredVoicePrivacy finished";
+}
+
+/*
+ * Test IRadioVoice.getPreferredVoicePrivacy() for the response returned.
+ */
+TEST_P(RadioVoiceTest, getPreferredVoicePrivacy) {
+ LOG(DEBUG) << "getPreferredVoicePrivacy";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->getPreferredVoicePrivacy(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+ LOG(DEBUG) << "getPreferredVoicePrivacy finished";
+}
+
+/*
+ * Test IRadioVoice.exitEmergencyCallbackMode() for the response returned.
+ */
+TEST_P(RadioVoiceTest, exitEmergencyCallbackMode) {
+ LOG(DEBUG) << "exitEmergencyCallbackMode";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->exitEmergencyCallbackMode(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_voice->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT}));
+ }
+ LOG(DEBUG) << "exitEmergencyCallbackMode finished";
+}
+
+/*
+ * Test IRadioVoice.handleStkCallSetupRequestFromSim() for the response returned.
+ */
+TEST_P(RadioVoiceTest, handleStkCallSetupRequestFromSim) {
+ LOG(DEBUG) << "handleStkCallSetupRequestFromSim";
+ serial = GetRandomSerialNumber();
+ bool accept = false;
+
+ radio_voice->handleStkCallSetupRequestFromSim(serial, accept);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
+ RadioError::MODEM_ERR, RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "handleStkCallSetupRequestFromSim finished";
+}
+
+/*
+ * Test IRadioVoice.dial() for the response returned.
+ */
+TEST_P(RadioVoiceTest, dial) {
+ LOG(DEBUG) << "dial";
+ serial = GetRandomSerialNumber();
+
+ Dial dialInfo;
+ memset(&dialInfo, 0, sizeof(dialInfo));
+ dialInfo.address = std::string("123456789");
+
+ radio_voice->dial(serial, dialInfo);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_voice->rspInfo.error,
+ {RadioError::CANCELLED, RadioError::DEVICE_IN_USE, RadioError::FDN_CHECK_FAILURE,
+ RadioError::INVALID_ARGUMENTS, RadioError::INVALID_CALL_ID,
+ RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE, RadioError::MODEM_ERR,
+ RadioError::NO_NETWORK_FOUND, RadioError::NO_SUBSCRIPTION,
+ RadioError::OPERATION_NOT_ALLOWED},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "dial finished";
+}
+
+/*
+ * Test IRadioVoice.hangup() for the response returned.
+ */
+TEST_P(RadioVoiceTest, hangup) {
+ LOG(DEBUG) << "hangup";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->hangup(serial, 1);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_voice->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "hangup finished";
+}
+
+/*
+ * Test IRadioVoice.hangupWaitingOrBackground() for the response returned.
+ */
+TEST_P(RadioVoiceTest, hangupWaitingOrBackground) {
+ LOG(DEBUG) << "hangupWaitingOrBackground";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->hangupWaitingOrBackground(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error,
+ {RadioError::INVALID_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "hangupWaitingOrBackground finished";
+}
+
+/*
+ * Test IRadioVoice.hangupForegroundResumeBackground() for the response returned.
+ */
+TEST_P(RadioVoiceTest, hangupForegroundResumeBackground) {
+ LOG(DEBUG) << "hangupForegroundResumeBackground";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->hangupForegroundResumeBackground(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error,
+ {RadioError::INVALID_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "hangupForegroundResumeBackground finished";
+}
+
+/*
+ * Test IRadioVoice.switchWaitingOrHoldingAndActive() for the response returned.
+ */
+TEST_P(RadioVoiceTest, switchWaitingOrHoldingAndActive) {
+ LOG(DEBUG) << "switchWaitingOrHoldingAndActive";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->switchWaitingOrHoldingAndActive(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error,
+ {RadioError::INVALID_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "switchWaitingOrHoldingAndActive finished";
+}
+
+/*
+ * Test IRadioVoice.conference() for the response returned.
+ */
+TEST_P(RadioVoiceTest, conference) {
+ LOG(DEBUG) << "conference";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->conference(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error,
+ {RadioError::INVALID_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "conference finished";
+}
+
+/*
+ * Test IRadioVoice.rejectCall() for the response returned.
+ */
+TEST_P(RadioVoiceTest, rejectCall) {
+ LOG(DEBUG) << "rejectCall";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->rejectCall(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error,
+ {RadioError::INVALID_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "rejectCall finished";
+}
+
+/*
+ * Test IRadioVoice.getLastCallFailCause() for the response returned.
+ */
+TEST_P(RadioVoiceTest, getLastCallFailCause) {
+ LOG(DEBUG) << "getLastCallFailCause";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->getLastCallFailCause(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::NONE},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "getLastCallFailCause finished";
+}
+
+/*
+ * Test IRadioVoice.getCallForwardStatus() for the response returned.
+ */
+TEST_P(RadioVoiceTest, getCallForwardStatus) {
+ LOG(DEBUG) << "getCallForwardStatus";
+ serial = GetRandomSerialNumber();
+ CallForwardInfo callInfo;
+ memset(&callInfo, 0, sizeof(callInfo));
+ callInfo.number = std::string();
+
+ radio_voice->getCallForwardStatus(serial, callInfo);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_voice->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "getCallForwardStatus finished";
+}
+
+/*
+ * Test IRadioVoice.setCallForward() for the response returned.
+ */
+TEST_P(RadioVoiceTest, setCallForward) {
+ LOG(DEBUG) << "setCallForward";
+ serial = GetRandomSerialNumber();
+ CallForwardInfo callInfo;
+ memset(&callInfo, 0, sizeof(callInfo));
+ callInfo.number = std::string();
+
+ radio_voice->setCallForward(serial, callInfo);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_voice->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "setCallForward finished";
+}
+
+/*
+ * Test IRadioVoice.getCallWaiting() for the response returned.
+ */
+TEST_P(RadioVoiceTest, getCallWaiting) {
+ LOG(DEBUG) << "getCallWaiting";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->getCallWaiting(serial, 1);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_voice->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "getCallWaiting finished";
+}
+
+/*
+ * Test IRadioVoice.setCallWaiting() for the response returned.
+ */
+TEST_P(RadioVoiceTest, setCallWaiting) {
+ LOG(DEBUG) << "setCallWaiting";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->setCallWaiting(serial, true, 1);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_voice->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "setCallWaiting finished";
+}
+
+/*
+ * Test IRadioVoice.acceptCall() for the response returned.
+ */
+TEST_P(RadioVoiceTest, acceptCall) {
+ LOG(DEBUG) << "acceptCall";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->acceptCall(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error,
+ {RadioError::INVALID_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "acceptCall finished";
+}
+
+/*
+ * Test IRadioVoice.separateConnection() for the response returned.
+ */
+TEST_P(RadioVoiceTest, separateConnection) {
+ LOG(DEBUG) << "separateConnection";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->separateConnection(serial, 1);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_voice->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "separateConnection finished";
+}
+
+/*
+ * Test IRadioVoice.explicitCallTransfer() for the response returned.
+ */
+TEST_P(RadioVoiceTest, explicitCallTransfer) {
+ LOG(DEBUG) << "explicitCallTransfer";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->explicitCallTransfer(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error,
+ {RadioError::INVALID_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "explicitCallTransfer finished";
+}
+
+/*
+ * Test IRadioVoice.sendCdmaFeatureCode() for the response returned.
+ */
+TEST_P(RadioVoiceTest, sendCdmaFeatureCode) {
+ LOG(DEBUG) << "sendCdmaFeatureCode";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->sendCdmaFeatureCode(serial, std::string());
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
+ RadioError::INVALID_CALL_ID, RadioError::INVALID_MODEM_STATE,
+ RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "sendCdmaFeatureCode finished";
+}
+
+/*
+ * Test IRadioVoice.sendDtmf() for the response returned.
+ */
+TEST_P(RadioVoiceTest, sendDtmf) {
+ LOG(DEBUG) << "sendDtmf";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->sendDtmf(serial, "1");
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_voice->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::INVALID_CALL_ID,
+ RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "sendDtmf finished";
+}
+
+/*
+ * Test IRadioVoice.startDtmf() for the response returned.
+ */
+TEST_P(RadioVoiceTest, startDtmf) {
+ LOG(DEBUG) << "startDtmf";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->startDtmf(serial, "1");
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_voice->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::INVALID_CALL_ID,
+ RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "startDtmf finished";
+}
+
+/*
+ * Test IRadioVoice.stopDtmf() for the response returned.
+ */
+TEST_P(RadioVoiceTest, stopDtmf) {
+ LOG(DEBUG) << "stopDtmf";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->stopDtmf(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_CALL_ID,
+ RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "stopDtmf finished";
+}
+
+/*
+ * Test IRadioVoice.setMute() for the response returned.
+ */
+TEST_P(RadioVoiceTest, setMute) {
+ LOG(DEBUG) << "setMute";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->setMute(serial, true);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "setMute finished";
+}
+
+/*
+ * Test IRadioVoice.getMute() for the response returned.
+ */
+TEST_P(RadioVoiceTest, getMute) {
+ LOG(DEBUG) << "getMute";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->getMute(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error);
+ }
+ LOG(DEBUG) << "getMute finished";
+}
+
+/*
+ * Test IRadioVoice.sendBurstDtmf() for the response returned.
+ */
+TEST_P(RadioVoiceTest, sendBurstDtmf) {
+ LOG(DEBUG) << "sendBurstDtmf";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->sendBurstDtmf(serial, "1", 0, 0);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE,
+ RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "sendBurstDtmf finished";
+}
+
+/*
+ * Test IRadioVoice.sendUssd() for the response returned.
+ */
+TEST_P(RadioVoiceTest, sendUssd) {
+ LOG(DEBUG) << "sendUssd";
+ serial = GetRandomSerialNumber();
+ radio_voice->sendUssd(serial, std::string("test"));
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_voice->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "sendUssd finished";
+}
+
+/*
+ * Test IRadioVoice.cancelPendingUssd() for the response returned.
+ */
+TEST_P(RadioVoiceTest, cancelPendingUssd) {
+ LOG(DEBUG) << "cancelPendingUssd";
+ serial = GetRandomSerialNumber();
+
+ radio_voice->cancelPendingUssd(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_voice->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_STATE, RadioError::MODEM_ERR},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "cancelPendingUssd finished";
+}
diff --git a/radio/aidl/vts/radio_voice_utils.h b/radio/aidl/vts/radio_voice_utils.h
index d61bf1e..0c3df7f 100644
--- a/radio/aidl/vts/radio_voice_utils.h
+++ b/radio/aidl/vts/radio_voice_utils.h
@@ -43,6 +43,8 @@
virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
+ virtual ndk::ScopedAStatus cancelPendingUssdResponse(const RadioResponseInfo& info) override;
+
virtual ndk::ScopedAStatus conferenceResponse(const RadioResponseInfo& info) override;
virtual ndk::ScopedAStatus dialResponse(const RadioResponseInfo& info) override;
@@ -103,6 +105,8 @@
virtual ndk::ScopedAStatus sendDtmfResponse(const RadioResponseInfo& info) override;
+ virtual ndk::ScopedAStatus sendUssdResponse(const RadioResponseInfo& info) override;
+
virtual ndk::ScopedAStatus separateConnectionResponse(const RadioResponseInfo& info) override;
virtual ndk::ScopedAStatus setCallForwardResponse(const RadioResponseInfo& info) override;
@@ -164,6 +168,9 @@
virtual ndk::ScopedAStatus onSupplementaryServiceIndication(
RadioIndicationType type, const StkCcUnsolSsResult& ss) override;
+ virtual ndk::ScopedAStatus onUssd(RadioIndicationType type, UssdModeType modeType,
+ const std::string& msg) override;
+
virtual ndk::ScopedAStatus resendIncallMute(RadioIndicationType type) override;
virtual ndk::ScopedAStatus srvccStateNotify(RadioIndicationType type,
diff --git a/security/keymint/aidl/android/hardware/security/keymint/DeviceInfo.aidl b/security/keymint/aidl/android/hardware/security/keymint/DeviceInfo.aidl
index b0761bf..153a04f 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/DeviceInfo.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/DeviceInfo.aidl
@@ -27,29 +27,27 @@
@VintfStability
parcelable DeviceInfo {
/**
- * DeviceInfo is a CBOR Map structure described by the following CDDL.
+ * DeviceInfo is a CBOR Map structure described by the following CDDL. DeviceInfo must be
+ * canonicalized according to the specification in RFC 7049. The ordering presented here is
+ * non-canonical to group similar entries semantically.
*
* DeviceInfo = {
- * ? "brand" : tstr,
- * ? "manufacturer" : tstr,
- * ? "product" : tstr,
- * ? "model" : tstr,
- * ? "board" : tstr,
- * ? "vb_state" : "green" / "yellow" / "orange", // Taken from the AVB values
- * ? "bootloader_state" : "locked" / "unlocked", // Taken from the AVB values
- * ? "vbmeta_digest": bstr, // Taken from the AVB values
- * ? "os_version" : tstr, // Same as android.os.Build.VERSION.release
- * ? "system_patch_level" : uint, // YYYYMMDD
- * ? "boot_patch_level" : uint, // YYYYMMDD
- * ? "vendor_patch_level" : uint, // YYYYMMDD
- * "version" : 1, // The CDDL schema version.
- * "security_level" : "tee" / "strongbox"
- * "att_id_state": "locked" / "open", // Attestation IDs State. If "locked", this
- * // indicates a device's attestable IDs are
- * // factory-locked and immutable. If "open",
- * // this indicates the device is still in a
- * // provisionable state and the attestable IDs
- * // are not yet frozen.
+ * "brand" : tstr,
+ * "manufacturer" : tstr,
+ * "product" : tstr,
+ * "model" : tstr,
+ * "device" : tstr,
+ * "vb_state" : "green" / "yellow" / "orange", // Taken from the AVB values
+ * "bootloader_state" : "locked" / "unlocked", // Taken from the AVB values
+ * "vbmeta_digest": bstr, // Taken from the AVB values
+ * "os_version" : tstr, // Same as android.os.Build.VERSION.release
+ * "system_patch_level" : uint, // YYYYMMDD
+ * "boot_patch_level" : uint, // YYYYMMDD
+ * "vendor_patch_level" : uint, // YYYYMMDD
+ * "version" : 2, // The CDDL schema version.
+ * "security_level" : "tee" / "strongbox",
+ * "fused": 1 / 0, // 1 if secure boot is enforced for the processor that the IRPC
+ * // implementation is contained in. 0 otherwise.
* }
*/
byte[] deviceInfo;
diff --git a/security/keymint/aidl/android/hardware/security/keymint/MacedPublicKey.aidl b/security/keymint/aidl/android/hardware/security/keymint/MacedPublicKey.aidl
index 62a48e9..ad97443 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/MacedPublicKey.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/MacedPublicKey.aidl
@@ -37,10 +37,10 @@
*
* PublicKey = { // COSE_Key
* 1 : 2, // Key type : EC2
- * 3 : -8 // Algorithm : ES256
- * -1 : 6, // Curve : P256
- * -2 : bstr // X coordinate, little-endian
- * -3 : bstr // Y coordinate, little-endian
+ * 3 : -7, // Algorithm : ES256
+ * -1 : 1, // Curve : P256
+ * -2 : bstr, // X coordinate, little-endian
+ * -3 : bstr, // Y coordinate, little-endian
* ? -70000 : nil // Presence indicates this is a test key. If set, K_mac is
* // all zeros.
* },
diff --git a/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl b/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl
index 24cdbc1..a14fc88 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl
@@ -169,7 +169,6 @@
* PubKeyEd25519 = { // COSE_Key
* 1 : 1, // Key type : octet key pair
* 3 : AlgorithmEdDSA, // Algorithm : EdDSA
- * 4 : 2, // Ops: Verify
* -1 : 6, // Curve : Ed25519
* -2 : bstr // X coordinate, little-endian
* }
@@ -184,7 +183,6 @@
* PubKeyECDSA256 = { // COSE_Key
* 1 : 2, // Key type : EC2
* 3 : AlgorithmES256, // Algorithm : ECDSA w/ SHA-256
- * 4 : 2, // Ops: Verify
* -1 : 1, // Curve: P256
* -2 : bstr, // X coordinate
* -3 : bstr // Y coordinate
diff --git a/security/keymint/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/keymint/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
index 829780d..927d7d7 100644
--- a/security/keymint/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
+++ b/security/keymint/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
@@ -57,6 +57,22 @@
using namespace remote_prov;
using namespace keymaster;
+std::set<std::string> getAllowedVbStates() {
+ return {"green", "yellow", "orange"};
+}
+
+std::set<std::string> getAllowedBootloaderStates() {
+ return {"locked", "unlocked"};
+}
+
+std::set<std::string> getAllowedSecurityLevels() {
+ return {"tee", "strongbox"};
+}
+
+std::set<std::string> getAllowedAttIdStates() {
+ return {"locked", "open"};
+}
+
bytevec string_to_bytevec(const char* s) {
const uint8_t* p = reinterpret_cast<const uint8_t*>(s);
return bytevec(p, p + strlen(s));
@@ -406,6 +422,8 @@
ASSERT_TRUE(deviceInfoMap) << "Failed to parse deviceInfo: " << deviceInfoErrMsg;
ASSERT_TRUE(deviceInfoMap->asMap());
+ checkDeviceInfo(deviceInfoMap->asMap(), deviceInfo.deviceInfo);
+
auto& signingKey = bccContents->back().pubKey;
auto macKey = verifyAndParseCoseSign1(signedMac->asArray(), signingKey,
cppbor::Array() // SignedMacAad
@@ -432,6 +450,78 @@
}
}
+ void checkType(const cppbor::Map* devInfo, uint8_t majorType, std::string entryName) {
+ const auto& val = devInfo->get(entryName);
+ ASSERT_TRUE(val) << entryName << " does not exist";
+ ASSERT_EQ(val->type(), majorType) << entryName << " has the wrong type.";
+ switch (majorType) {
+ case cppbor::TSTR:
+ ASSERT_GT(val->asTstr()->value().size(), 0);
+ break;
+ case cppbor::BSTR:
+ ASSERT_GT(val->asBstr()->value().size(), 0);
+ break;
+ default:
+ break;
+ }
+ }
+
+ void checkDeviceInfo(const cppbor::Map* deviceInfo, bytevec deviceInfoBytes) {
+ const auto& version = deviceInfo->get("version");
+ ASSERT_TRUE(version);
+ ASSERT_TRUE(version->asUint());
+ RpcHardwareInfo info;
+ provisionable_->getHardwareInfo(&info);
+ ASSERT_EQ(version->asUint()->value(), info.versionNumber);
+ std::set<std::string> allowList;
+ switch (version->asUint()->value()) {
+ // These fields became mandated in version 2.
+ case 2:
+ checkType(deviceInfo, cppbor::TSTR, "brand");
+ checkType(deviceInfo, cppbor::TSTR, "manufacturer");
+ checkType(deviceInfo, cppbor::TSTR, "product");
+ checkType(deviceInfo, cppbor::TSTR, "model");
+ checkType(deviceInfo, cppbor::TSTR, "device");
+ // TODO: Refactor the KeyMint code that validates these fields and include it here.
+ checkType(deviceInfo, cppbor::TSTR, "vb_state");
+ allowList = getAllowedVbStates();
+ ASSERT_NE(allowList.find(deviceInfo->get("vb_state")->asTstr()->value()),
+ allowList.end());
+ checkType(deviceInfo, cppbor::TSTR, "bootloader_state");
+ allowList = getAllowedBootloaderStates();
+ ASSERT_NE(allowList.find(deviceInfo->get("bootloader_state")->asTstr()->value()),
+ allowList.end());
+ checkType(deviceInfo, cppbor::BSTR, "vbmeta_digest");
+ checkType(deviceInfo, cppbor::TSTR, "os_version");
+ checkType(deviceInfo, cppbor::UINT, "system_patch_level");
+ checkType(deviceInfo, cppbor::UINT, "boot_patch_level");
+ checkType(deviceInfo, cppbor::UINT, "vendor_patch_level");
+ checkType(deviceInfo, cppbor::UINT, "fused");
+ ASSERT_LT(deviceInfo->get("fused")->asUint()->value(), 2); // Must be 0 or 1.
+ checkType(deviceInfo, cppbor::TSTR, "security_level");
+ allowList = getAllowedSecurityLevels();
+ ASSERT_NE(allowList.find(deviceInfo->get("security_level")->asTstr()->value()),
+ allowList.end());
+ break;
+ case 1:
+ checkType(deviceInfo, cppbor::TSTR, "security_level");
+ allowList = getAllowedSecurityLevels();
+ ASSERT_NE(allowList.find(deviceInfo->get("security_level")->asTstr()->value()),
+ allowList.end());
+ if (version->asUint()->value() == 1) {
+ checkType(deviceInfo, cppbor::TSTR, "att_id_state");
+ allowList = getAllowedAttIdStates();
+ ASSERT_NE(allowList.find(deviceInfo->get("att_id_state")->asTstr()->value()),
+ allowList.end());
+ }
+ break;
+ default:
+ FAIL() << "Unrecognized version: " << version->asUint()->value();
+ }
+ ASSERT_EQ(deviceInfo->clone()->asMap()->canonicalize().encode(), deviceInfoBytes)
+ << "DeviceInfo ordering is non-canonical.";
+ }
+
bytevec eekId_;
size_t testEekLength_;
EekChain testEekChain_;
diff --git a/security/keymint/support/remote_prov_utils.cpp b/security/keymint/support/remote_prov_utils.cpp
index 0cbee51..35cb891 100644
--- a/security/keymint/support/remote_prov_utils.cpp
+++ b/security/keymint/support/remote_prov_utils.cpp
@@ -26,6 +26,11 @@
namespace aidl::android::hardware::security::keymint::remote_prov {
+constexpr uint32_t kBccPayloadIssuer = 1;
+constexpr uint32_t kBccPayloadSubject = 2;
+constexpr int32_t kBccPayloadSubjPubKey = -4670552;
+constexpr int32_t kBccPayloadKeyUsage = -4670553;
+
bytevec kTestMacKey(32 /* count */, 0 /* byte value */);
bytevec randomBytes(size_t numBytes) {
@@ -98,6 +103,18 @@
return prodEek;
}
+ErrMsgOr<bytevec> validatePayloadAndFetchPubKey(const cppbor::Map* payload) {
+ const auto& issuer = payload->get(kBccPayloadIssuer);
+ if (!issuer || !issuer->asTstr()) return "Issuer is not present or not a tstr.";
+ const auto& subject = payload->get(kBccPayloadSubject);
+ if (!subject || !subject->asTstr()) return "Subject is not present or not a tstr.";
+ const auto& keyUsage = payload->get(kBccPayloadKeyUsage);
+ if (!keyUsage || !keyUsage->asBstr()) return "Key usage is not present or not a bstr.";
+ const auto& serializedKey = payload->get(kBccPayloadSubjPubKey);
+ if (!serializedKey || !serializedKey->asBstr()) return "Key is not present or not a bstr.";
+ return serializedKey->asBstr()->value();
+}
+
ErrMsgOr<bytevec> verifyAndParseCoseSign1Cwt(const cppbor::Array* coseSign1,
const bytevec& signingCoseKey, const bytevec& aad) {
if (!coseSign1 || coseSign1->size() != kCoseSign1EntryCount) {
@@ -126,18 +143,16 @@
return "Unsupported signature algorithm";
}
- // TODO(jbires): Handle CWTs as the CoseSign1 payload in a less hacky way. Since the CWT payload
- // is extremely remote provisioning specific, probably just make a separate
- // function there.
auto [parsedPayload, __, payloadErrMsg] = cppbor::parse(payload);
if (!parsedPayload) return payloadErrMsg + " when parsing key";
if (!parsedPayload->asMap()) return "CWT must be a map";
- auto serializedKey = parsedPayload->asMap()->get(-4670552)->clone();
- if (!serializedKey || !serializedKey->asBstr()) return "Could not find key entry";
+ auto serializedKey = validatePayloadAndFetchPubKey(parsedPayload->asMap());
+ if (!serializedKey) {
+ return "CWT validation failed: " + serializedKey.moveMessage();
+ }
bool selfSigned = signingCoseKey.empty();
- auto key =
- CoseKey::parseEd25519(selfSigned ? serializedKey->asBstr()->value() : signingCoseKey);
+ auto key = CoseKey::parseEd25519(selfSigned ? *serializedKey : signingCoseKey);
if (!key) return "Bad signing key: " + key.moveMessage();
bytevec signatureInput =
@@ -148,7 +163,7 @@
return "Signature verification failed";
}
- return serializedKey->asBstr()->value();
+ return serializedKey.moveValue();
}
ErrMsgOr<std::vector<BccEntryData>> validateBcc(const cppbor::Array* bcc) {
@@ -156,8 +171,11 @@
std::vector<BccEntryData> result;
+ const auto& devicePubKey = bcc->get(0);
+ if (!devicePubKey->asMap()) return "Invalid device public key at the 1st entry in the BCC";
+
bytevec prevKey;
- // TODO(jbires): Actually process the pubKey at the start of the new bcc entry
+
for (size_t i = 1; i < bcc->size(); ++i) {
const cppbor::Array* entry = bcc->get(i)->asArray();
if (!entry || entry->size() != kCoseSign1EntryCount) {
@@ -177,6 +195,13 @@
// This entry's public key is the signing key for the next entry.
prevKey = payload.moveValue();
+ if (i == 1) {
+ auto [parsedRootKey, _, errMsg] = cppbor::parse(prevKey);
+ if (!parsedRootKey || !parsedRootKey->asMap()) return "Invalid payload entry in BCC.";
+ if (*parsedRootKey != *devicePubKey) {
+ return "Device public key doesn't match BCC root.";
+ }
+ }
}
return result;
diff --git a/sensors/aidl/android/hardware/sensors/SensorInfo.aidl b/sensors/aidl/android/hardware/sensors/SensorInfo.aidl
index 35caf8b..065642a 100644
--- a/sensors/aidl/android/hardware/sensors/SensorInfo.aidl
+++ b/sensors/aidl/android/hardware/sensors/SensorInfo.aidl
@@ -21,7 +21,7 @@
@VintfStability
parcelable SensorInfo {
/**
- * handle that identifies this sensors. This handle is used to reference
+ * Handle that identifies this sensors. This handle is used to reference
* this sensor throughout the HAL API.
*/
int sensorHandle;
@@ -33,25 +33,25 @@
String name;
/**
- * vendor of the hardware part
+ * Vendor of the hardware part.
*/
String vendor;
/**
- * version of the hardware part + driver. The value of this field
- * must increase when the driver is updated in a way that changes the
- * output of this sensor. This is important for fused sensors when the
- * fusion algorithm is updated.
+ * Version of the hardware part + driver, used for informational purposes.
+ * The value of this field must increase when the driver is updated in a
+ * way that changes the output of this sensor. This is important for fused
+ * sensors when the fusion algorithm is updated.
*/
int version;
/**
- * this sensor's type.
+ * This sensor's type.
*/
SensorType type;
/**
- * type of this sensor as a string.
+ * Type of this sensor as a string.
*
* When defining an OEM specific sensor or sensor manufacturer specific
* sensor, use your reserve domain name as a prefix.
@@ -63,22 +63,22 @@
String typeAsString;
/**
- * maximum range of this sensor's value in SI units
+ * Maximum range of this sensor's value in SI units
*/
float maxRange;
/**
- * smallest difference between two values reported by this sensor
+ * Smallest difference between two values reported by this sensor
*/
float resolution;
/**
- * rough estimate of this sensor's power consumption in mA
+ * Rough estimate of this sensor's power consumption in mA
*/
float power;
/**
- * this value depends on the reporting mode:
+ * This value depends on the reporting mode:
*
* continuous: minimum sample period allowed in microseconds
* on-change : 0
@@ -88,7 +88,7 @@
int minDelayUs;
/**
- * number of events reserved for this sensor in the batch mode FIFO.
+ * Number of events reserved for this sensor in the batch mode FIFO.
* If there is a dedicated FIFO for this sensor, then this is the
* size of this FIFO. If the FIFO is shared with other sensors,
* this is the size reserved for that sensor and it can be zero.
@@ -96,14 +96,14 @@
int fifoReservedEventCount;
/**
- * maximum number of events of this sensor that could be batched.
+ * Maximum number of events of this sensor that could be batched.
* This is especially relevant when the FIFO is shared between
* several sensors; this value is then set to the size of that FIFO.
*/
int fifoMaxEventCount;
/**
- * permission required to see this sensor, register to it and receive data.
+ * Permission required to see this sensor, register to it and receive data.
* Set to "" if no permission is required. Some sensor types like the
* heart rate monitor have a mandatory require_permission.
* For sensors that always require a specific permission, like the heart
diff --git a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp
index 1bc7263..83d0dc9 100644
--- a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp
+++ b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp
@@ -60,6 +60,8 @@
ASSERT_STREQ(SENSOR_STRING_TYPE_##type, stringType.c_str()); \
break;
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ACCELEROMETER);
+ CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ACCELEROMETER_LIMITED_AXES);
+ CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ACCELEROMETER_LIMITED_AXES_UNCALIBRATED);
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ACCELEROMETER_UNCALIBRATED);
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ADDITIONAL_INFO);
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(AMBIENT_TEMPERATURE);
@@ -70,7 +72,10 @@
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GLANCE_GESTURE);
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GRAVITY);
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GYROSCOPE);
+ CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GYROSCOPE_LIMITED_AXES);
+ CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GYROSCOPE_LIMITED_AXES_UNCALIBRATED);
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GYROSCOPE_UNCALIBRATED);
+ CHECK_TYPE_STRING_FOR_SENSOR_TYPE(HEADING);
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(HEART_BEAT);
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(HEART_RATE);
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(LIGHT);
@@ -122,8 +127,11 @@
int expectedReportModeForType(SensorType type) {
switch (type) {
case SensorType::ACCELEROMETER:
+ case SensorType::ACCELEROMETER_LIMITED_AXES:
case SensorType::ACCELEROMETER_UNCALIBRATED:
+ case SensorType::ACCELEROMETER_LIMITED_AXES_UNCALIBRATED:
case SensorType::GYROSCOPE:
+ case SensorType::GYROSCOPE_LIMITED_AXES:
case SensorType::MAGNETIC_FIELD:
case SensorType::ORIENTATION:
case SensorType::PRESSURE:
@@ -133,9 +141,11 @@
case SensorType::MAGNETIC_FIELD_UNCALIBRATED:
case SensorType::GAME_ROTATION_VECTOR:
case SensorType::GYROSCOPE_UNCALIBRATED:
+ case SensorType::GYROSCOPE_LIMITED_AXES_UNCALIBRATED:
case SensorType::GEOMAGNETIC_ROTATION_VECTOR:
case SensorType::POSE_6DOF:
case SensorType::HEART_BEAT:
+ case SensorType::HEADING:
return SensorInfo::SENSOR_FLAG_BITS_CONTINUOUS_MODE;
case SensorType::LIGHT:
diff --git a/thermal/2.0/default/Android.bp b/thermal/2.0/default/Android.bp
index a63ffbc..f743ade 100644
--- a/thermal/2.0/default/Android.bp
+++ b/thermal/2.0/default/Android.bp
@@ -22,16 +22,26 @@
default_applicable_licenses: ["hardware_interfaces_license"],
}
+filegroup {
+ name: "android.hardware.thermal@2.0-service.xml",
+ srcs: ["android.hardware.thermal@2.0-service.xml"],
+}
+
+filegroup {
+ name: "android.hardware.thermal@2.0-service.rc",
+ srcs: ["android.hardware.thermal@2.0-service.rc"],
+}
+
cc_binary {
name: "android.hardware.thermal@2.0-service.mock",
defaults: ["hidl_defaults"],
relative_install_path: "hw",
vendor: true,
- init_rc: ["android.hardware.thermal@2.0-service.rc"],
- vintf_fragments: ["android.hardware.thermal@2.0-service.xml"],
+ init_rc: [":android.hardware.thermal@2.0-service.rc"],
+ vintf_fragments: [":android.hardware.thermal@2.0-service.xml"],
srcs: [
"Thermal.cpp",
- "service.cpp"
+ "service.cpp",
],
shared_libs: [
"libbase",
diff --git a/thermal/2.0/default/apex/Android.bp b/thermal/2.0/default/apex/Android.bp
new file mode 100644
index 0000000..914a3a8
--- /dev/null
+++ b/thermal/2.0/default/apex/Android.bp
@@ -0,0 +1,55 @@
+// Copyright (C) 2022 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+apex_key {
+ name: "com.android.hardware.thermal.key",
+ public_key: "com.android.hardware.thermal.avbpubkey",
+ private_key: "com.android.hardware.thermal.pem",
+}
+
+android_app_certificate {
+ name: "com.android.hardware.thermal.certificate",
+ certificate: "com.android.hardware.thermal",
+}
+
+genrule {
+ name: "com.android.hardware.thermal.rc-gen",
+ srcs: [":android.hardware.thermal@2.0-service.rc"],
+ out: ["com.android.hardware.thermal.rc"],
+ cmd: "sed -E 's/\\/vendor/\\/apex\\/com.android.hardware.thermal.mock/' $(in) > $(out)",
+}
+
+prebuilt_etc {
+ name: "com.android.hardware.thermal.rc",
+ src: ":com.android.hardware.thermal.rc-gen",
+ installable: false,
+}
+
+apex {
+ name: "com.android.hardware.thermal.mock",
+ manifest: "manifest.json",
+ file_contexts: "file_contexts",
+ key: "com.android.hardware.thermal.key",
+ certificate: ":com.android.hardware.thermal.certificate",
+ use_vndk_as_stable: true,
+ updatable: false,
+ soc_specific: true,
+ binaries: ["android.hardware.thermal@2.0-service.mock"],
+ prebuilts: ["com.android.hardware.thermal.rc"],
+ vintf_fragments: [":android.hardware.thermal@2.0-service.xml"],
+}
diff --git a/thermal/2.0/default/apex/com.android.hardware.thermal.avbpubkey b/thermal/2.0/default/apex/com.android.hardware.thermal.avbpubkey
new file mode 100644
index 0000000..8f7cf72
--- /dev/null
+++ b/thermal/2.0/default/apex/com.android.hardware.thermal.avbpubkey
Binary files differ
diff --git a/thermal/2.0/default/apex/com.android.hardware.thermal.pem b/thermal/2.0/default/apex/com.android.hardware.thermal.pem
new file mode 100644
index 0000000..4ea6e85
--- /dev/null
+++ b/thermal/2.0/default/apex/com.android.hardware.thermal.pem
@@ -0,0 +1,51 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIJKQIBAAKCAgEApXL2prEKqnU/xHlYeZB55x5EOrVAsfBuyHN5xOgUY877UuDC
+xoX+DOYAkCDSwMPmBj/Q9E70lId1PXMeI3y0obgYpdFubqRsoGNcEq2zG811tr6J
+BAE/7mAI0a4VVFWtauBNTiP5G31hsRpZNTE/dyZxs20GEVQqdvtBlEAuebCt7VIb
+fCwXnPCXSiYQ9WyjU0dwHoZPuy02qBuq3v9NYt5J6lYiPDqTWmpYBFm+SIZvth/j
+HUcaU3p+BlUad0qLhA8HYTPPBwJq2uHbTXeFrWXngt+UPCdzYubyUjG4WmgHIfee
+zSvoTjud2Gaofnd4/PcE5jFTMYUJuz0D4E+8StZArw+xegfxGcvqFZ4gfKAO1Vha
+eQBhw94P2eieUfh9metQEyKZ+A24sxG0awtAUOgcwr/WNv2TgJoN8+56DhuPXOuO
+U2qeIZuIrmE5xmyzrzJsCx+5vRQA7A3kpxRo1ZCgbJlzMgdAQaRTe2rqxyyoeFQR
+HbxUdsM7ZwDLE62UlaTTZFoJ1wzvZmsIJdkdRg97zcc3R3kYnVehCxAZ1KdAKzq6
+bhrw/kNAVA0zUHhlhHWGDnJQ/rkGfjQ9GGhS51IJYgKEoQc5M9hSgZD3idic8hso
+63r/P2Wn4S78gwLigfpzsGD7RrusTbMIRkebwpHwAYpB8qIykrtUKfunLtMCAwEA
+AQKCAgEAjiKbv0ytaw9bfwD4f0cdUu5vkzgPok55/f8mh4ERs0UoKGUrL74BKTeX
+GDr6k9w4CvpcGuaRu+A7WlVBeR8zVxN/KUUo6CidoZR6jxlmm+YA0MQTlbs1Hyal
+rO0vKcqJNx4Hi6/f3Dv0519JcCck7Mm8OHbbFZwG9zyXdDNHOggNA6rcLer7Rjpy
+3qKhQxbXoT3oFnEwog8Pu5A5VWZjJyLswULKGo//81cU0nf+vvOvmPj/9jEVbs32
+4p3OJNmHziXTIzCNFOqAvhX2fzDFSNgY8hf9k0gZGshpOS+5vwFLz2SZqo2j/0G8
+MyLOcgdVi4zzSobpf8tZNuAOKnCVwxteV3Ddl0o+qAf4cQCAXtuEkJvFWpAxrX4m
+J7nDDuvcTjKMlnchlm6XxmP27YNTKA2w5uNfrJQV5LR3IDs77PFpNiKOwERka6MU
+WE1LnjAFTCDxujT29NfIjC9z0iOY45TYut4okesaK7woe6pfK2H0ouvE6mZ+Lb7Y
+qZphPb4e4DZZZAVoELVvWflm/VC/xmBMA9vtzpjuvRXD+iYjgxbHaiG2UANLWmTd
+vADLqBadlbp10AvyrjKxHUhAiZnJgaVKRXtw5qk8YrwZOwypEHCQjY41fJuRScWF
+pD58/PYOLtSdwewzTijXSVwwPeqL1JMdJ+KWFk5zI410DtmHwoECggEBANM5dHEj
+L4ZOCcgHVG7aCLah7f/0Za7BBiPsZFD0uRIzWFTd77st3v8ulMw1JQiO3+xmpL7e
+iOP+onuSEMKgNQqeX9WCnv6pL+mjg0of2IEcGnvCpmfUZRA2x/MlyJRrQ1vHGqkV
+oBIIWgCGmIAWuFbHPmkNYx7mAJymAfzShkVtMw29oiGYyubqx9cTjD0odeyScbhZ
+LuMt72O5QeNsPREX4SsSRAL+vZbz1+8iRI8Fon89csZym3hos3DA4QSml+FNHnLe
+YFD6AfU7pdn79YhhNkn4jE0BxLaEkXhMs8RRTU2Q3o990ZxrAZGQz4zqOm5sOIQT
+JaXFXxGvOwEysrMCggEBAMiFaTzkhJSLEmLEu0T3gNEC2d3jE9kt4Olv4mQmzD00
+AzDtkrkArLQCeG3CMn55oFcJRwr8gAEk7/f2mvJSoZQnw0J0tRI+QiHJG4zwdsQC
+UszqN89X8ef0yoobwVa31ZoWxK4/NvLO4GZQ6UUd9uni10jfYVWmwEwKBU61ihvT
+ntcZIXvROR6khxzLeXtglnsznnYcdYMPJUeN+cfK9/rL3V3jk1jes8y8XwYfxkUa
+99nEe1NkRCUznzKxvkRwnKunlMCEkZ5z4nNMlqEqiOlVEYgwKwNCP+qM7ZKUJg7t
+uOL91bqWFPj2qdzyUh0uP5V/dg2odnu0xSblKWhxI2ECggEBAKbZttJ8Idlsoath
+pt+d2c4yoadTLlNZ5HjSDfgpKFxpNLhtTCbGuGVJLX8V5/gXrGi4OCER9n5rMXx9
+SEIFfYCy1C77bI7rpI5hfJ88ArESOxVSEFLqYx7otw+p5AThqibAY533GCfGcxoB
+OEvOJrVd1D31tju9IfSb6ewFfM0w0mhjSMRTRswb39pUda4F3QkQMUaXJEOOkJBs
+0dBNOvvaqiJ03kajZa3tVsBuiEuV/uOV7ak29Pqrcjt6EQW0dzsgyRGh+eFda9iE
+0qEbt7uQVusdq+5UnEg09hhaNpK4SmEgM76Te9WcbXPIOTst9xQs5oPmABIvk8aL
+bgenPaMCggEAX9EAHIzFnYVm37NKGQZ7k2RdXt2nGlwF4QYJk/nGFmjILZUYSza7
+T7jueuQU5MKRj4VrYSCOuf1AfahlGe3KL9VgRF0oOPNu/l3uwEYXOkox7qDs0jMf
+8MrUDXJ9zEZD10GR8gFa7GNWbw2yqchLuC8g2D2FcTwhHzSanKW6vNk+SWJE0bmE
+JdRQi73e6smYnn5n9eBbdqjCE5MQDBw8qqbHvJmGSyz/lZFdhrugLl1YmcJ9e7ep
+qG0mYT71wBZfhtapCeVO//w39Qhf4dtFWNnBauY5Z3E8wYNd8nDATtnhQvYwLtyQ
+YPbc7CsOecsjrvgdHSGmnC4hFxjh1HpbgQKCAQBzEr35CFQpUfGsu06SqRrxp7mb
+BfQzLmqnt+ZLu21H/YjVbamMXNjbJFSdtFLxAK/s9vFGQzEWWEYia2pRZejlCXhQ
+RO+TREJ4rm4Erfdh+zS9z8MZlxe2ybIMs260XxjZ0gEltRtJ6P14zLBlChi/rQEY
+tGrOpfjvLc1Lryaucwj7snDLtMfyqvemAUmuJNn/6IEMuG4DcdtJ3Whh7t3xKfO0
+Hc71Oh7F30okQQ6Ctiwp1T77Y1EXlRJrUtpf1sLxeItP6/r3WXLNaiFdKqGJxiCM
+Gw11oUcBA9bvfAzeJIpVVbLtGPNOp4J1XpkgFcWzsTM+ZpxWwbj4yJL6rSN2
+-----END RSA PRIVATE KEY-----
diff --git a/thermal/2.0/default/apex/com.android.hardware.thermal.pk8 b/thermal/2.0/default/apex/com.android.hardware.thermal.pk8
new file mode 100644
index 0000000..3e5bf69
--- /dev/null
+++ b/thermal/2.0/default/apex/com.android.hardware.thermal.pk8
Binary files differ
diff --git a/thermal/2.0/default/apex/com.android.hardware.thermal.x509.pem b/thermal/2.0/default/apex/com.android.hardware.thermal.x509.pem
new file mode 100644
index 0000000..048e69a
--- /dev/null
+++ b/thermal/2.0/default/apex/com.android.hardware.thermal.x509.pem
@@ -0,0 +1,34 @@
+-----BEGIN CERTIFICATE-----
+MIIF3TCCA8UCFFWeg2KJX/fyAqZPcKaFS61/a3GiMA0GCSqGSIb3DQEBCwUAMIGp
+MQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNTW91
+bnRhaW4gVmlldzEQMA4GA1UECgwHQW5kcm9pZDEQMA4GA1UECwwHQW5kcm9pZDEi
+MCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTElMCMGA1UEAwwcY29t
+LmFuZHJvaWQuaGFyZHdhcmUudGhlcm1hbDAgFw0yMTExMTcxODE3MjRaGA80NzU5
+MTAxNDE4MTcyNFowgakxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlh
+MRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MRAwDgYDVQQKDAdBbmRyb2lkMRAwDgYD
+VQQLDAdBbmRyb2lkMSIwIAYJKoZIhvcNAQkBFhNhbmRyb2lkQGFuZHJvaWQuY29t
+MSUwIwYDVQQDDBxjb20uYW5kcm9pZC5oYXJkd2FyZS50aGVybWFsMIICIjANBgkq
+hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2W8QhCKX0WoS5jhIWbWBoKulD6XhKASA
+CL0oU6Uci0U6id2m++ou/T0aHSlliS9kT1NEABNwbLeTDa9h1qg1lbajRzXbvzEz
+EvZYT+dlgYFNZ9zaVCIlMapoiN+nrM/Rs24UBjJrZu1B39+IcE5ciQz69PgrLKWF
+vFEdYzxWI246azOVr3fvdelQg+CyPgiGObVAGOHhAidvsjg4FssKnADzn+JNlTt6
+b9P65xUQErut8hz9YdLtfZ096iwe8eEpsMOQwCNdKNXVCcNjQWkOwRaU+0awHoH1
+4mArvF7yyvJxqzkNaR03BPqXAHPIAPu6xdfA19+HVIiz6bLEZ1mfCM6edXByCWZu
+K8o54OZph71r15ncv4DVd+cnBjNvBvfdlJSeGjSreFkUo5NkfAwqdmLfZx6CedHI
+sLx7X8vPYolQnR4UEvaX6yeNN0gs8Dd6ePMqOEiwWFVASD+cbpcUrp09uzlDStGV
+1DPx/9J2kw8eXPMqOSGThkLWuUMUFojyh7bNlL16oYmEeZW6/OOXCOXzAQgJ7NIs
+DA1/H2w1HMHWgSfF4y+Es2CiqcgVFOIU/07b31Edw4v56pjx1CUpRpJZjDA1JJNo
+A4YCnpA6JWTxzUTmv21fEYyY+poA3CuzvCfZ80z9h/UFW98oM9GawGvK0i2pLudS
+RaZXWeil08cCAwEAATANBgkqhkiG9w0BAQsFAAOCAgEAj2gpn/IpAHQLDlI52WwL
+IDc5uzlf1BGseLZ8M8uuMiwvN00nOjunQQZEIbhH7+03GYyMzRhTTI3nWwmX4Fnq
+vC5sR68yNlu9gOAMXaAHo/Rw73ak7sv8xGbb2FeQsHaMKDQ2nqxP17SWdQ0xWa1u
+5qNurPOdAPOw77noZcT7yYX7lcrOKxPIekPJxyeOlp4bQSmabSRgYr70B7GybPlv
+K1gkgCBxl5RiVjVxLo+7ESHSAaGLy0S7F2v6PJ9oj15TovWQ0py2iBKZ6HReB7s/
+umnQqkwXDLudlNmoXIsgIYn8vKFTYpy1GSNJqhRSLfvLR6NtuU0iCTvg/X7oPmS1
+dWUdjVeO7ZVvIpO3gLLEe4maBEYF2sOlt3bRmzIHydORJtkfTt5tiZ4wR9RfJbkj
+iBiDbNiX010bZPTAXmgMbuJzQXZEXCBy0qKeS1cHwf9M8FDoiLajXepfZIp+6syt
+D4lZk4eAV141JL5PfABfdZWwT3cTgFIqCYpqrMQJIu+GHEjUwD2yNPi0I1/ydFCW
+CPDnzWjYCi6yVB8hss3ZFbvhfyJzdm3LivNVbLGK0+TG0EOAz6d2aQ0UjESgMD1A
+U8hLzQt7MiFSG0bt2cVx6SgCHeYUqMntbFELEAURWrhAfPLMJtAvFgKbEiZEAkkW
+pdDVh603aIp4LjVCfTYp/mQ=
+-----END CERTIFICATE-----
diff --git a/thermal/2.0/default/apex/file_contexts b/thermal/2.0/default/apex/file_contexts
new file mode 100644
index 0000000..e0d87c7
--- /dev/null
+++ b/thermal/2.0/default/apex/file_contexts
@@ -0,0 +1,5 @@
+(/.*)? u:object_r:vendor_file:s0
+# Permission XMLs
+/etc/permissions(/.*)? u:object_r:vendor_configs_file:s0
+# binary
+/bin/hw/android\.hardware\.thermal@2\.0-service\.mock u:object_r:hal_thermal_default_exec:s0
diff --git a/thermal/2.0/default/apex/manifest.json b/thermal/2.0/default/apex/manifest.json
new file mode 100644
index 0000000..ee44dc1
--- /dev/null
+++ b/thermal/2.0/default/apex/manifest.json
@@ -0,0 +1,4 @@
+{
+ "name": "com.android.hardware.thermal.mock",
+ "version": 1
+}
diff --git a/tv/tuner/aidl/Android.bp b/tv/tuner/aidl/Android.bp
index c33572d..63f91ac 100644
--- a/tv/tuner/aidl/Android.bp
+++ b/tv/tuner/aidl/Android.bp
@@ -19,7 +19,6 @@
backend: {
java: {
sdk_version: "module_current",
- srcs_available: true,
},
cpp: {
enabled: false,
diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp
index 056d014..3f7797c 100644
--- a/tv/tuner/aidl/default/Frontend.cpp
+++ b/tv/tuner/aidl/default/Frontend.cpp
@@ -393,6 +393,13 @@
{
FrontendScanMessage msg;
+ msg.set<FrontendScanMessage::Tag::isLocked>(false);
+ mCallback->onScanMessage(FrontendScanMessageType::LOCKED, msg);
+ mIsLocked = false;
+ }
+
+ {
+ FrontendScanMessage msg;
msg.set<FrontendScanMessage::Tag::isLocked>(true);
mCallback->onScanMessage(FrontendScanMessageType::LOCKED, msg);
mIsLocked = true;
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
similarity index 79%
copy from uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl
copy to uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
index 0d53431..fec044e 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
@@ -33,14 +33,16 @@
package android.hardware.uwb.fira_android;
@Backing(type="int") @VintfStability
-enum UwbVendorSessionSetAppConfigCmdParams {
- CCC_HOP_MODE_KEY = 160,
- CCC_UWB_TIME0 = 161,
- CCC_RANGING_PROTOCOL_VER = 163,
- CCC_UWB_CONFIG_ID = 164,
- CCC_PULSESHAPE_COMBO = 165,
- CCC_URSK_TTL = 166,
- NB_OF_RANGE_MEASUREMENTS = 227,
- NB_OF_AZIMUTH_MEASUREMENTS = 228,
- NB_OF_ELEVATION_MEASUREMENTS = 229,
+enum UwbVendorCapabilityTlvTypes {
+ SUPPORTED_POWER_STATS_QUERY = 192,
+ CCC_SUPPORTED_VERSIONS = 160,
+ CCC_SUPPORTED_UWB_CONFIGS = 161,
+ CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 162,
+ CCC_SUPPORTED_RAN_MULTIPLIER = 163,
+ CCC_SUPPORTED_CHAPS_PER_SLOT = 164,
+ CCC_SUPPORTED_SYNC_CODES = 165,
+ CCC_SUPPORTED_CHANNELS = 166,
+ CCC_SUPPORTED_HOPPING_SEQUENCES = 167,
+ CCC_SUPPORTED_HOPPING_CONFIG_MODES = 168,
+ SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 227,
}
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl
similarity index 76%
copy from uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl
copy to uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl
index 7e3be56..ee47a13 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl
@@ -33,7 +33,22 @@
package android.hardware.uwb.fira_android;
@Backing(type="long") @VintfStability
-enum UwbAndroidCapabilities {
- POWER_STATS_QUERY = 1,
- ANTENNAE_INTERLEAVING = 2,
+enum UwbVendorCapabilityTlvValues {
+ UWB_CONFIG_0 = 0,
+ UWB_CONFIG_1 = 1,
+ PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 1,
+ PULSE_SHAPE_PRECURSOR_FREE = 2,
+ PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 3,
+ CHAPS_PER_SLOT_3 = 3,
+ CHAPS_PER_SLOT_4 = 4,
+ CHAPS_PER_SLOT_6 = 6,
+ CHAPS_PER_SLOT_8 = 8,
+ CHAPS_PER_SLOT_9 = 9,
+ CHAPS_PER_SLOT_12 = 12,
+ CHAPS_PER_SLOT_24 = 24,
+ HOPPING_SEQUENCE_DEFAULT = 0,
+ HOPPING_SEQUENCE_AES = 1,
+ HOPPING_CONFIG_MODE_NONE = 0,
+ HOPPING_CONFIG_MODE_CONTINUOUS = 1,
+ HOPPING_CONFIG_MODE_ADAPTIVE = 2,
}
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl
similarity index 97%
rename from uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl
rename to uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl
index 0d53431..d35728f 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl
@@ -33,7 +33,7 @@
package android.hardware.uwb.fira_android;
@Backing(type="int") @VintfStability
-enum UwbVendorSessionSetAppConfigCmdParams {
+enum UwbVendorSessionAppConfigTlvTypes {
CCC_HOP_MODE_KEY = 160,
CCC_UWB_TIME0 = 161,
CCC_RANGING_PROTOCOL_VER = 163,
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl
similarity index 93%
rename from uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl
rename to uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl
index 7e3be56..a7f487b 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl
@@ -32,8 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.uwb.fira_android;
-@Backing(type="long") @VintfStability
-enum UwbAndroidCapabilities {
- POWER_STATS_QUERY = 1,
- ANTENNAE_INTERLEAVING = 2,
+@Backing(type="int") @VintfStability
+enum UwbVendorSessionAppConfigTlvValues {
+ AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 240,
}
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl
index c7708f1..0e640be 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl
@@ -42,6 +42,5 @@
void coreInit();
void sessionInit(int sessionId);
int getSupportedAndroidUciVersion();
- long getSupportedAndroidCapabilities();
int sendUciMessage(in byte[] data);
}
diff --git a/uwb/aidl/android/hardware/uwb/IUwbChip.aidl b/uwb/aidl/android/hardware/uwb/IUwbChip.aidl
index f2bb0f1..00cb8e0 100644
--- a/uwb/aidl/android/hardware/uwb/IUwbChip.aidl
+++ b/uwb/aidl/android/hardware/uwb/IUwbChip.aidl
@@ -67,16 +67,6 @@
int getSupportedAndroidUciVersion();
/**
- * Mechanism to allow HAL implementation to optionally expose features that are defined
- * in the "android.hardware.uwb.fira_android" types-only package.
- *
- * @return Returns the bitmask of capabilities
- * (android.hardware.uwb.fira_android.UwbAndroidCapabilities) that is supported by the
- * HAL implementation.
- */
- long getSupportedAndroidCapabilities();
-
- /**
* Write the UCI message to the UWB Subsystem.
* The UCI message format is as per UCI protocol and it is
* defined in "FiRa Consortium - UCI Generic Specification_v1.0" specification at FiRa
diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl
deleted file mode 100644
index 0af99e0..0000000
--- a/uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2021 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.uwb.fira_android;
-
-/**
- * Android specific capabilities should be defined here.
- *
- * For any features enabled via the FIRA vendor commands for Android, use this bitmask
- * to allow devices to expose the features supported by the HAL implementation.
- *
- */
-@VintfStability
-@Backing(type="long")
-enum UwbAndroidCapabilities {
- POWER_STATS_QUERY = 0x1,
- ANTENNAE_INTERLEAVING = 0x2,
-}
diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
new file mode 100644
index 0000000..4591dda
--- /dev/null
+++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2021 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.uwb.fira_android;
+
+/**
+ * Android specific capability TLV types in UCI command:
+ * GID: 0000b (UWB Core Group)
+ * OID: 000011b (CORE_GET_CAPS_INFO_CMD)
+ *
+ * For FIRA params, please refer to params mentioned in CR 287.
+ *
+ * Values expected for each type are mentioned in the docs below and the constants
+ * used are defined in UwbVendorCapabilityTlvValues enum.
+ */
+@VintfStability
+@Backing(type="int")
+enum UwbVendorCapabilityTlvTypes {
+
+ /*********************************************
+ * Protocol agnostic
+ ********************************************/
+ /**
+ * 1 byte value to indicate support for power stats query
+ * Values:
+ * 1 - Feature supported.
+ * 0 - Feature not supported.
+ */
+ SUPPORTED_POWER_STATS_QUERY = 0xC0,
+
+ /*********************************************
+ * CCC specific
+ ********************************************/
+
+ /**
+ * 2 byte tuple {major_version (1 byte), minor_version (1 byte)} array with list of supported
+ * CCC versions
+ */
+ CCC_SUPPORTED_VERSIONS = 0xA0,
+ /**
+ * byte array with a list of supported UWB configs
+ * Values:
+ * UWB_CONFIG_0 = 0
+ * UWB_CONFIG_1 = 1
+ */
+ CCC_SUPPORTED_UWB_CONFIGS = 0xA1,
+ /**
+ * 1 byte tuple {initiator_tx (4 bits), responder_tx (4 bits)} array with list of supported
+ * pulse shape combos
+ * Values:
+ * PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 1
+ * PULSE_SHAPE_PRECURSOR_FREE = 2
+ * PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 3
+ */
+ /** */
+ CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 0xA2,
+ /** Int value for indicating supported ran multiplier */
+ CCC_SUPPORTED_RAN_MULTIPLIER = 0xA3,
+ /**
+ * byte array with a list of supported chaps per slot
+ * Values:
+ * CHAPS_PER_SLOT_3 = 3
+ * CHAPS_PER_SLOT_4 = 4
+ * CHAPS_PER_SLOT_6 = 6
+ * CHAPS_PER_SLOT_8 = 8
+ * CHAPS_PER_SLOT_9 = 9
+ * CHAPS_PER_SLOT_12 = 12
+ * CHAPS_PER_SLOT_24 = 24
+ */
+ CCC_SUPPORTED_CHAPS_PER_SLOT = 0xA4,
+ /**
+ * byte array with a list of supported sync codes
+ * Values: 1 - 32
+ */
+ CCC_SUPPORTED_SYNC_CODES = 0xA5,
+ /** byte array with list of supported channels */
+ CCC_SUPPORTED_CHANNELS = 0xA6,
+ /**
+ * byte array with a list of supported hopping sequences
+ * Values:
+ HOPPING_SEQUENCE_DEFAULT = 0
+ HOPPING_SEQUENCE_AES = 1
+ */
+ CCC_SUPPORTED_HOPPING_SEQUENCES = 0xA7,
+ /**
+ * byte array with a list of supported hopping config modes
+ * Values:
+ * HOPPING_CONFIG_MODE_NONE = 0
+ * HOPPING_CONFIG_MODE_CONTINUOUS = 1
+ * HOPPING_CONFIG_MODE_ADAPTIVE = 2
+ */
+ CCC_SUPPORTED_HOPPING_CONFIG_MODES = 0xA8,
+
+ /*********************************************
+ * FIRA specific
+ ********************************************/
+ /**
+ * 1 byte value to indicate support for antenna interleaving
+ * feature.
+ * Values:
+ * 1 - Feature supported.
+ * 0 - Feature not supported.
+ */
+ SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 0xE3,
+}
diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl
new file mode 100644
index 0000000..380089f
--- /dev/null
+++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2021 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.uwb.fira_android;
+
+/**
+ * Android specific capability TLV values expected in UCI command:
+ * GID: 0000b (UWB Core Group),
+ * OID: 000011b (CORE_GET_CAPS_INFO_CMD),
+ */
+@VintfStability
+@Backing(type="long")
+enum UwbVendorCapabilityTlvValues {
+ /*********************************************
+ * CCC specific
+ ********************************************/
+ UWB_CONFIG_0 = 0,
+ UWB_CONFIG_1 = 1,
+
+ PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 1,
+ PULSE_SHAPE_PRECURSOR_FREE = 2,
+ PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 3,
+
+ CHAPS_PER_SLOT_3 = 3,
+ CHAPS_PER_SLOT_4 = 4,
+ CHAPS_PER_SLOT_6 = 6,
+ CHAPS_PER_SLOT_8 = 8,
+ CHAPS_PER_SLOT_9 = 9,
+ CHAPS_PER_SLOT_12 = 12,
+ CHAPS_PER_SLOT_24 = 24,
+
+ HOPPING_SEQUENCE_DEFAULT = 0,
+ HOPPING_SEQUENCE_AES = 1,
+
+ HOPPING_CONFIG_MODE_NONE = 0,
+ HOPPING_CONFIG_MODE_CONTINUOUS = 1,
+ HOPPING_CONFIG_MODE_ADAPTIVE = 2,
+}
diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl
index 1dfcd6f..c04bdcf 100644
--- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl
+++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl
@@ -24,8 +24,8 @@
@Backing(type="byte")
enum UwbVendorGidAndroidOids {
// Used by the command and response to get UWB power related stats.
- // Supported only if the value returned by getSupportedAndroidCapabilities()
- // has the bit of UwbAndroidCapabilities.POWER_STATS_QUERY set to 1.
+ // Supported only if the UwbVendorCapabilityTlvTypes.SUPPORTED_POWER_STATS_QUERY
+ // set to 1.
ANDROID_GET_POWER_STATS = 0x0,
// Used to set the current regulatory country code (determined usinag
// SIM or hardcoded by OEM).
diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl
similarity index 87%
rename from uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl
rename to uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl
index eb1f5ac..8547567 100644
--- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl
+++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl
@@ -17,16 +17,17 @@
package android.hardware.uwb.fira_android;
/**
- * Android specific vendor app params set in UCI command:
+ * Android specific vendor app params set/expected in UCI command:
* GID: 0001b (UWB Session config Group)
* OID: 000011b (SESSION_SET_APP_CONFIG_CMD)
+ * OID: 000100b (SESSION_GET_APP_CONFIG_CMD)
*
* Note: Refer to Table 34 of the UCI specification for the other params
* expected in this command.
*/
@VintfStability
@Backing(type="int")
-enum UwbVendorSessionSetAppConfigCmdParams {
+enum UwbVendorSessionAppConfigTlvTypes {
/** CCC params for ranging start */
/**
@@ -56,8 +57,8 @@
/**
* Added in vendor version 0.
* Interleaving ratio if AOA_RESULT_REQ is set to 0xF0.
- * Supported only if the value returned by getSupportedAndroidCapabilities()
- * has the bit of UwbAndroidCapabilities.ANTENNAE_INTERLEAVING set to 1.
+ * Supported only if the UwbVendorCapabilityTlvTypes
+ * .SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING set to 1.
*/
/** 2 byte data */
NB_OF_RANGE_MEASUREMENTS = 0xE3,
diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl
new file mode 100644
index 0000000..bd4ad6e
--- /dev/null
+++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2021 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.uwb.fira_android;
+
+/**
+ * Android specific vendor app config values set/expected in UCI command:
+ * GID: 0001b (UWB Session config Group)
+ * OID: 000011b (SESSION_SET_APP_CONFIG_CMD)
+ * OID: 000100b (SESSION_GET_APP_CONFIG_CMD)
+ *
+ * Note: Refer to Table 34 of the UCI specification for the other values
+ * expected in this command.
+ */
+@VintfStability
+@Backing(type="int")
+enum UwbVendorSessionAppConfigTlvValues {
+ /**
+ * Added in vendor version 0.
+ * Supported only if the UwbVendorCapabilityTlvTypes
+ * .SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING set to 1.
+ * Set AOA_RESULT_REQ (Config ID - 0x0D) to this value to turn on antenna
+ * interleaving feature.
+ */
+ AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 0xF0,
+}
diff --git a/uwb/aidl/default/uwb_chip.cpp b/uwb/aidl/default/uwb_chip.cpp
index a5a3f4a..41f14fd 100644
--- a/uwb/aidl/default/uwb_chip.cpp
+++ b/uwb/aidl/default/uwb_chip.cpp
@@ -18,7 +18,6 @@
namespace {
constexpr static int32_t kAndroidUciVersion = 1;
-constexpr static int64_t kAndroidCapabilities = 0;
}
namespace android {
@@ -60,11 +59,6 @@
return ndk::ScopedAStatus::ok();
}
-::ndk::ScopedAStatus UwbChip::getSupportedAndroidCapabilities(int64_t* capabilities) {
- *capabilities = kAndroidCapabilities;
- return ndk::ScopedAStatus::ok();
-}
-
::ndk::ScopedAStatus UwbChip::sendUciMessage(const std::vector<uint8_t>& /* data */,
int32_t* /* bytes_written */) {
// TODO(b/195992658): Need emulator support for UCI stack.
diff --git a/uwb/aidl/default/uwb_chip.h b/uwb/aidl/default/uwb_chip.h
index 46cecd4..e900cbe 100644
--- a/uwb/aidl/default/uwb_chip.h
+++ b/uwb/aidl/default/uwb_chip.h
@@ -39,7 +39,6 @@
::ndk::ScopedAStatus coreInit() override;
::ndk::ScopedAStatus sessionInit(int sesionId) override;
::ndk::ScopedAStatus getSupportedAndroidUciVersion(int32_t* version) override;
- ::ndk::ScopedAStatus getSupportedAndroidCapabilities(int64_t* capabilities) override;
::ndk::ScopedAStatus sendUciMessage(const std::vector<uint8_t>& data,
int32_t* bytes_written) override;
diff --git a/uwb/aidl/vts/VtsHalUwbTargetTest.cpp b/uwb/aidl/vts/VtsHalUwbTargetTest.cpp
index 1da4432..edd8dd6 100644
--- a/uwb/aidl/vts/VtsHalUwbTargetTest.cpp
+++ b/uwb/aidl/vts/VtsHalUwbTargetTest.cpp
@@ -180,14 +180,6 @@
EXPECT_GT(version, 0);
}
-TEST_P(UwbAidl, ChipGetSupportedAndroidCapabilities) {
- const auto iuwb_chip = getAnyChipAndOpen();
- EXPECT_TRUE(iuwb_chip->coreInit().isOk());
-
- int64_t capabilities;
- EXPECT_TRUE(iuwb_chip->getSupportedAndroidCapabilities(&capabilities).isOk());
-}
-
TEST_P(UwbAidl, ChipGetName) {
std::string chip_name = getAnyChipName();
std::shared_ptr<IUwbChip> iuwb_chip;
diff --git a/wifi/1.6/IWifiChip.hal b/wifi/1.6/IWifiChip.hal
index eaa2400..555ec91 100644
--- a/wifi/1.6/IWifiChip.hal
+++ b/wifi/1.6/IWifiChip.hal
@@ -99,4 +99,35 @@
getUsableChannels_1_6(WifiBand band, bitfield<WifiIfaceMode> ifaceModeMask,
bitfield<UsableChannelFilter> filterMask)
generates (WifiStatus status, vec<WifiUsableChannel> channels);
+
+ /**
+ * Retrieve the list of all the possible radio combinations supported by this
+ * chip.
+ *
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.FAILURE_UNKNOWN|
+ * @return radioCombinationMatrix
+ * A list of all the possible radio combinations represented by
+ * |WifiRadioCombinationMatrix|.
+ * For Example in case of a chip which has two radios, where one radio is
+ * capable of 2.4GHz 2X2 only and another radio which is capable of either
+ * 5GHz or 6GHz 2X2, number of possible radio combinations in this case
+ * are 5 and possible combinations are
+ * {{{2G 2X2}}, //Standalone 2G
+ * {{5G 2X2}}, //Standalone 5G
+ * {{6G 2X2}}, //Standalone 6G
+ * {{2G 2X2}, {5G 2X2}}, //2G+5G DBS
+ * {{2G 2X2}, {6G 2X2}}} //2G+6G DBS
+ * Note: Since this chip doesn’t support 5G+6G simultaneous operation
+ * as there is only one radio which can support both bands, So it can only
+ * do MCC 5G+6G. This table should not get populated with possible MCC
+ * configurations. This is only for simultaneous radio configurations
+ * (such as standalone, multi band simultaneous or single band simultaneous).
+ */
+ getSupportedRadioCombinationsMatrix()
+ generates (WifiStatus status, WifiRadioCombinationMatrix radioCombinationMatrix);
};
diff --git a/wifi/1.6/default/hidl_callback_util.h b/wifi/1.6/default/hidl_callback_util.h
index 3ac54c1..aab0ae5 100644
--- a/wifi/1.6/default/hidl_callback_util.h
+++ b/wifi/1.6/default/hidl_callback_util.h
@@ -20,6 +20,7 @@
#include <set>
#include <hidl/HidlSupport.h>
+#include <hidl/HidlTransportSupport.h>
namespace {
// Type of callback invoked by the death handler.
@@ -68,9 +69,11 @@
// (callback proxy's raw pointer) to track the death of individual
// clients.
uint64_t cookie = reinterpret_cast<uint64_t>(cb.get());
- if (cb_set_.find(cb) != cb_set_.end()) {
- LOG(WARNING) << "Duplicate death notification registration";
- return true;
+ for (const auto& s : cb_set_) {
+ if (interfacesEqual(cb, s)) {
+ LOG(ERROR) << "Duplicate death notification registration";
+ return true;
+ }
}
if (!cb->linkToDeath(death_handler_, cookie)) {
LOG(ERROR) << "Failed to register death notification";
diff --git a/wifi/1.6/default/hidl_struct_util.cpp b/wifi/1.6/default/hidl_struct_util.cpp
index 71f98b9..45459e2 100644
--- a/wifi/1.6/default/hidl_struct_util.cpp
+++ b/wifi/1.6/default/hidl_struct_util.cpp
@@ -367,6 +367,21 @@
}
}
+V1_5::WifiBand convertLegacyMacBandToHidlWifiBand(uint32_t band) {
+ switch (band) {
+ case legacy_hal::WLAN_MAC_2_4_BAND:
+ return V1_5::WifiBand::BAND_24GHZ;
+ case legacy_hal::WLAN_MAC_5_0_BAND:
+ return V1_5::WifiBand::BAND_5GHZ;
+ case legacy_hal::WLAN_MAC_6_0_BAND:
+ return V1_5::WifiBand::BAND_6GHZ;
+ case legacy_hal::WLAN_MAC_60_0_BAND:
+ return V1_5::WifiBand::BAND_60GHZ;
+ default:
+ return V1_5::WifiBand::BAND_UNSPECIFIED;
+ }
+}
+
uint32_t convertHidlWifiIfaceModeToLegacy(uint32_t hidl_iface_mask) {
uint32_t legacy_iface_mask = 0;
if (hidl_iface_mask & V1_5::WifiIfaceMode::IFACE_MODE_STA) {
@@ -2905,6 +2920,85 @@
return true;
}
+V1_6::WifiAntennaMode convertLegacyAntennaConfigurationToHidl(uint32_t antenna_cfg) {
+ switch (antenna_cfg) {
+ case legacy_hal::WIFI_ANTENNA_1X1:
+ return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_1X1;
+ case legacy_hal::WIFI_ANTENNA_2X2:
+ return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_2X2;
+ case legacy_hal::WIFI_ANTENNA_3X3:
+ return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_3X3;
+ case legacy_hal::WIFI_ANTENNA_4X4:
+ return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_4X4;
+ default:
+ return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_UNSPECIFIED;
+ }
+}
+
+bool convertLegacyWifiRadioConfigurationToHidl(
+ legacy_hal::wifi_radio_configuration* radio_configuration,
+ V1_6::WifiRadioConfiguration* hidl_radio_configuration) {
+ if (!hidl_radio_configuration) {
+ return false;
+ }
+ *hidl_radio_configuration = {};
+ hidl_radio_configuration->bandInfo =
+ hidl_struct_util::convertLegacyMacBandToHidlWifiBand(radio_configuration->band);
+ if (hidl_radio_configuration->bandInfo == V1_5::WifiBand::BAND_UNSPECIFIED) {
+ LOG(ERROR) << "Unspecified band";
+ return false;
+ }
+ hidl_radio_configuration->antennaMode =
+ hidl_struct_util::convertLegacyAntennaConfigurationToHidl(
+ radio_configuration->antenna_cfg);
+ return true;
+}
+
+bool convertLegacyRadioCombinationsMatrixToHidl(
+ legacy_hal::wifi_radio_combination_matrix* legacy_matrix,
+ WifiRadioCombinationMatrix* hidl_matrix) {
+ if (!hidl_matrix || !legacy_matrix) {
+ return false;
+ }
+ *hidl_matrix = {};
+
+ int num_combinations = legacy_matrix->num_radio_combinations;
+ std::vector<V1_6::WifiRadioCombination> radio_combinations_vec;
+ if (!num_combinations) {
+ LOG(ERROR) << "zero radio combinations";
+ return false;
+ }
+ wifi_radio_combination* l_radio_combinations_ptr = legacy_matrix->radio_combinations;
+ for (int i = 0; i < num_combinations; i++) {
+ int num_configurations = l_radio_combinations_ptr->num_radio_configurations;
+ WifiRadioCombination radioCombination;
+ std::vector<V1_6::WifiRadioConfiguration> radio_configurations_vec;
+ if (!num_configurations) {
+ LOG(ERROR) << "zero radio configurations";
+ return false;
+ }
+ for (int j = 0; j < num_configurations; j++) {
+ WifiRadioConfiguration radioConfiguration;
+ wifi_radio_configuration* l_radio_configurations_ptr =
+ &l_radio_combinations_ptr->radio_configurations[j];
+ if (!hidl_struct_util::convertLegacyWifiRadioConfigurationToHidl(
+ l_radio_configurations_ptr, &radioConfiguration)) {
+ LOG(ERROR) << "Error converting wifi radio configuration";
+ return false;
+ }
+ radio_configurations_vec.push_back(radioConfiguration);
+ }
+ radioCombination.radioConfigurations = radio_configurations_vec;
+ radio_combinations_vec.push_back(radioCombination);
+ l_radio_combinations_ptr =
+ (wifi_radio_combination*)((u8*)l_radio_combinations_ptr +
+ sizeof(wifi_radio_combination) +
+ (sizeof(wifi_radio_configuration) * num_configurations));
+ }
+ hidl_matrix->radioCombinations = radio_combinations_vec;
+ return true;
+}
+
} // namespace hidl_struct_util
} // namespace implementation
} // namespace V1_6
diff --git a/wifi/1.6/default/hidl_struct_util.h b/wifi/1.6/default/hidl_struct_util.h
index 26a6ebc..2d4a5f1 100644
--- a/wifi/1.6/default/hidl_struct_util.h
+++ b/wifi/1.6/default/hidl_struct_util.h
@@ -74,6 +74,11 @@
bool convertHidlVectorOfCoexUnsafeChannelToLegacy(
const std::vector<V1_5::IWifiChip::CoexUnsafeChannel>& hidl_unsafe_channels,
std::vector<legacy_hal::wifi_coex_unsafe_channel>* legacy_unsafe_channels);
+bool convertLegacyRadioCombinationsMatrixToHidl(
+ legacy_hal::wifi_radio_combination_matrix* legacy_matrix,
+ V1_6::WifiRadioCombinationMatrix* hidl_matrix);
+V1_5::WifiBand convertLegacyMacBandToHidlWifiBand(uint32_t band);
+V1_6::WifiAntennaMode convertLegacyAntennaConfigurationToHidl(uint32_t antenna_cfg);
// STA iface conversion methods.
bool convertLegacyFeaturesToHidlStaCapabilities(uint64_t legacy_feature_set,
diff --git a/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp b/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp
index 077c6cc..0dd0aa1 100644
--- a/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp
+++ b/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp
@@ -377,6 +377,108 @@
HidlChipCaps::SET_LATENCY_MODE | HidlChipCaps::DEBUG_MEMORY_DRIVER_DUMP,
hidle_caps);
}
+
+void insertRadioCombination(legacy_hal::wifi_radio_combination* dst_radio_combination_ptr,
+ int num_radio_configurations,
+ legacy_hal::wifi_radio_configuration* radio_configuration) {
+ dst_radio_combination_ptr->num_radio_configurations = num_radio_configurations;
+ memcpy(dst_radio_combination_ptr->radio_configurations, radio_configuration,
+ num_radio_configurations * sizeof(legacy_hal::wifi_radio_configuration));
+}
+
+void verifyRadioCombination(WifiRadioCombination* radioCombination, size_t num_radio_configurations,
+ legacy_hal::wifi_radio_configuration* radio_configuration) {
+ EXPECT_EQ(num_radio_configurations, radioCombination->radioConfigurations.size());
+ for (size_t i = 0; i < num_radio_configurations; i++) {
+ EXPECT_EQ(hidl_struct_util::convertLegacyMacBandToHidlWifiBand(radio_configuration->band),
+ radioCombination->radioConfigurations[i].bandInfo);
+ EXPECT_EQ(hidl_struct_util::convertLegacyAntennaConfigurationToHidl(
+ radio_configuration->antenna_cfg),
+ radioCombination->radioConfigurations[i].antennaMode);
+ radio_configuration++;
+ }
+}
+
+TEST_F(HidlStructUtilTest, canConvertLegacyRadioCombinationsMatrixToHidl) {
+ legacy_hal::wifi_radio_configuration radio_configurations_array1[] = {
+ {.band = legacy_hal::WLAN_MAC_2_4_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_1X1},
+ };
+ legacy_hal::wifi_radio_configuration radio_configurations_array2[] = {
+ {.band = legacy_hal::WLAN_MAC_2_4_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_2X2},
+ {.band = legacy_hal::WLAN_MAC_5_0_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_3X3},
+ };
+ legacy_hal::wifi_radio_configuration radio_configurations_array3[] = {
+ {.band = legacy_hal::WLAN_MAC_2_4_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_2X2},
+ {.band = legacy_hal::WLAN_MAC_6_0_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_1X1},
+ {.band = legacy_hal::WLAN_MAC_5_0_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_4X4},
+ };
+
+ int num_radio_configs = 0;
+ int num_combinations = 0;
+ std::array<char, 256> buffer;
+ buffer.fill(0);
+ legacy_hal::wifi_radio_combination_matrix* legacy_matrix =
+ reinterpret_cast<wifi_radio_combination_matrix*>(buffer.data());
+ legacy_hal::wifi_radio_combination* radio_combinations;
+
+ // Prepare a legacy wifi_radio_combination_matrix
+ legacy_matrix->num_radio_combinations = 3;
+ // Insert first combination
+ radio_combinations =
+ (legacy_hal::wifi_radio_combination*)((char*)legacy_matrix->radio_combinations);
+ insertRadioCombination(
+ radio_combinations,
+ sizeof(radio_configurations_array1) / sizeof(radio_configurations_array1[0]),
+ radio_configurations_array1);
+ num_combinations++;
+ num_radio_configs +=
+ sizeof(radio_configurations_array1) / sizeof(radio_configurations_array1[0]);
+
+ // Insert second combination
+ radio_combinations =
+ (legacy_hal::wifi_radio_combination*)((char*)legacy_matrix->radio_combinations +
+ (num_combinations *
+ sizeof(legacy_hal::wifi_radio_combination)) +
+ (num_radio_configs *
+ sizeof(wifi_radio_configuration)));
+ insertRadioCombination(
+ radio_combinations,
+ sizeof(radio_configurations_array2) / sizeof(radio_configurations_array2[0]),
+ radio_configurations_array2);
+ num_combinations++;
+ num_radio_configs +=
+ sizeof(radio_configurations_array2) / sizeof(radio_configurations_array2[0]);
+
+ // Insert third combination
+ radio_combinations =
+ (legacy_hal::wifi_radio_combination*)((char*)legacy_matrix->radio_combinations +
+ (num_combinations *
+ sizeof(legacy_hal::wifi_radio_combination)) +
+ (num_radio_configs *
+ sizeof(wifi_radio_configuration)));
+ insertRadioCombination(
+ radio_combinations,
+ sizeof(radio_configurations_array3) / sizeof(radio_configurations_array3[0]),
+ radio_configurations_array3);
+
+ V1_6::WifiRadioCombinationMatrix converted_matrix{};
+ hidl_struct_util::convertLegacyRadioCombinationsMatrixToHidl(legacy_matrix, &converted_matrix);
+
+ // Verify the conversion
+ EXPECT_EQ(legacy_matrix->num_radio_combinations, converted_matrix.radioCombinations.size());
+ verifyRadioCombination(
+ &converted_matrix.radioCombinations[0],
+ sizeof(radio_configurations_array1) / sizeof(radio_configurations_array1[0]),
+ radio_configurations_array1);
+ verifyRadioCombination(
+ &converted_matrix.radioCombinations[1],
+ sizeof(radio_configurations_array2) / sizeof(radio_configurations_array2[0]),
+ radio_configurations_array2);
+ verifyRadioCombination(
+ &converted_matrix.radioCombinations[2],
+ sizeof(radio_configurations_array3) / sizeof(radio_configurations_array3[0]),
+ radio_configurations_array3);
+}
} // namespace implementation
} // namespace V1_6
} // namespace wifi
diff --git a/wifi/1.6/default/wifi_chip.cpp b/wifi/1.6/default/wifi_chip.cpp
index a185724..4fff770 100644
--- a/wifi/1.6/default/wifi_chip.cpp
+++ b/wifi/1.6/default/wifi_chip.cpp
@@ -722,6 +722,12 @@
filterMask);
}
+Return<void> WifiChip::getSupportedRadioCombinationsMatrix(
+ getSupportedRadioCombinationsMatrix_cb hidl_status_cb) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+ &WifiChip::getSupportedRadioCombinationsMatrixInternal, hidl_status_cb);
+}
+
void WifiChip::invalidateAndRemoveAllIfaces() {
invalidateAndClearBridgedApAll();
invalidateAndClearAll(ap_ifaces_);
@@ -1461,6 +1467,28 @@
return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_usable_channels};
}
+std::pair<WifiStatus, V1_6::WifiRadioCombinationMatrix>
+WifiChip::getSupportedRadioCombinationsMatrixInternal() {
+ legacy_hal::wifi_error legacy_status;
+ legacy_hal::wifi_radio_combination_matrix* legacy_matrix;
+
+ std::tie(legacy_status, legacy_matrix) =
+ legacy_hal_.lock()->getSupportedRadioCombinationsMatrix();
+ if (legacy_status != legacy_hal::WIFI_SUCCESS) {
+ LOG(ERROR) << "Failed to get SupportedRadioCombinations matrix from legacy HAL: "
+ << legacyErrorToString(legacy_status);
+ return {createWifiStatusFromLegacyError(legacy_status), {}};
+ }
+
+ V1_6::WifiRadioCombinationMatrix hidl_matrix;
+ if (!hidl_struct_util::convertLegacyRadioCombinationsMatrixToHidl(legacy_matrix,
+ &hidl_matrix)) {
+ LOG(ERROR) << "Failed convertLegacyRadioCombinationsMatrixToHidl() ";
+ return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), {}};
+ }
+ return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_matrix};
+}
+
WifiStatus WifiChip::handleChipConfiguration(
/* NONNULL */ std::unique_lock<std::recursive_mutex>* lock, ChipModeId mode_id) {
// If the chip is already configured in a different mode, stop
diff --git a/wifi/1.6/default/wifi_chip.h b/wifi/1.6/default/wifi_chip.h
index 61ac03d..13d62fb 100644
--- a/wifi/1.6/default/wifi_chip.h
+++ b/wifi/1.6/default/wifi_chip.h
@@ -160,6 +160,8 @@
hidl_bitfield<V1_5::WifiIfaceMode> ifaceModeMask,
hidl_bitfield<UsableChannelFilter> filterMask,
getUsableChannels_1_6_cb _hidl_cb) override;
+ Return<void> getSupportedRadioCombinationsMatrix(
+ getSupportedRadioCombinationsMatrix_cb hidl_status_cb) override;
private:
void invalidateAndRemoveAllIfaces();
@@ -267,6 +269,7 @@
const sp<IWifiIface>& bound_iface);
std::pair<WifiStatus, std::vector<V1_6::WifiUsableChannel>> getUsableChannelsInternal_1_6(
WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask);
+ std::pair<WifiStatus, WifiRadioCombinationMatrix> getSupportedRadioCombinationsMatrixInternal();
ChipId chip_id_;
std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
diff --git a/wifi/1.6/default/wifi_legacy_hal.cpp b/wifi/1.6/default/wifi_legacy_hal.cpp
index 64dde95..8a75fd8 100644
--- a/wifi/1.6/default/wifi_legacy_hal.cpp
+++ b/wifi/1.6/default/wifi_legacy_hal.cpp
@@ -37,6 +37,7 @@
static constexpr uint32_t kMaxWakeReasonStatsArraySize = 32;
static constexpr uint32_t kMaxRingBuffers = 10;
static constexpr uint32_t kMaxWifiUsableChannels = 256;
+static constexpr uint32_t kMaxSupportedRadioCombinationsMatrixLength = 256;
// need a long timeout (1000ms) for chips that unload their driver.
static constexpr uint32_t kMaxStopCompleteWaitMs = 1000;
static constexpr char kDriverPropName[] = "wlan.driver.status";
@@ -356,6 +357,15 @@
}
}
+// Callback to report current CHRE NAN state
+std::function<void(chre_nan_rtt_state)> on_chre_nan_rtt_internal_callback;
+void onAsyncChreNanRttState(chre_nan_rtt_state state) {
+ const auto lock = hidl_sync_util::acquireGlobalLock();
+ if (on_chre_nan_rtt_internal_callback) {
+ on_chre_nan_rtt_internal_callback(state);
+ }
+}
+
// End of the free-standing "C" style callbacks.
WifiLegacyHal::WifiLegacyHal(const std::weak_ptr<wifi_system::InterfaceTool> iface_tool,
@@ -1537,6 +1547,43 @@
return global_func_table_.wifi_set_indoor_state(global_handle_, isIndoor);
}
+std::pair<wifi_error, wifi_radio_combination_matrix*>
+WifiLegacyHal::getSupportedRadioCombinationsMatrix() {
+ std::array<char, kMaxSupportedRadioCombinationsMatrixLength> buffer;
+ buffer.fill(0);
+ uint32_t size = 0;
+ wifi_radio_combination_matrix* radio_combination_matrix_ptr =
+ reinterpret_cast<wifi_radio_combination_matrix*>(buffer.data());
+ wifi_error status = global_func_table_.wifi_get_supported_radio_combinations_matrix(
+ global_handle_, buffer.size(), &size, radio_combination_matrix_ptr);
+ CHECK(size >= 0 && size <= kMaxSupportedRadioCombinationsMatrixLength);
+ return {status, radio_combination_matrix_ptr};
+}
+
+wifi_error WifiLegacyHal::chreNanRttRequest(const std::string& iface_name, bool enable) {
+ if (enable)
+ return global_func_table_.wifi_nan_rtt_chre_enable_request(0, getIfaceHandle(iface_name),
+ NULL);
+ else
+ return global_func_table_.wifi_nan_rtt_chre_disable_request(0, getIfaceHandle(iface_name));
+}
+
+wifi_error WifiLegacyHal::chreRegisterHandler(const std::string& iface_name,
+ const ChreCallbackHandlers& handler) {
+ if (on_chre_nan_rtt_internal_callback) {
+ return WIFI_ERROR_NOT_AVAILABLE;
+ }
+
+ on_chre_nan_rtt_internal_callback = handler.on_wifi_chre_nan_rtt_state;
+
+ wifi_error status = global_func_table_.wifi_chre_register_handler(getIfaceHandle(iface_name),
+ {onAsyncChreNanRttState});
+ if (status != WIFI_SUCCESS) {
+ on_chre_nan_rtt_internal_callback = nullptr;
+ }
+ return status;
+}
+
void WifiLegacyHal::invalidate() {
global_handle_ = nullptr;
iface_name_to_handle_.clear();
@@ -1572,6 +1619,7 @@
on_twt_event_teardown_completion_callback = nullptr;
on_twt_event_info_frame_received_callback = nullptr;
on_twt_event_device_notify_callback = nullptr;
+ on_chre_nan_rtt_internal_callback = nullptr;
}
} // namespace legacy_hal
diff --git a/wifi/1.6/default/wifi_legacy_hal.h b/wifi/1.6/default/wifi_legacy_hal.h
index 1d85d2e..ab21e8e 100644
--- a/wifi/1.6/default/wifi_legacy_hal.h
+++ b/wifi/1.6/default/wifi_legacy_hal.h
@@ -36,6 +36,7 @@
namespace legacy_hal {
// Import all the types defined inside the legacy HAL header files into this
// namespace.
+using ::chre_nan_rtt_state;
using ::frame_info;
using ::frame_type;
using ::FRAME_TYPE_80211_MGMT;
@@ -204,6 +205,11 @@
using ::WIFI_AC_BK;
using ::WIFI_AC_VI;
using ::WIFI_AC_VO;
+using ::WIFI_ANTENNA_1X1;
+using ::WIFI_ANTENNA_2X2;
+using ::WIFI_ANTENNA_3X3;
+using ::WIFI_ANTENNA_4X4;
+using ::WIFI_ANTENNA_UNSPECIFIED;
using ::wifi_band;
using ::WIFI_BAND_A;
using ::WIFI_BAND_A_DFS;
@@ -281,6 +287,9 @@
using ::WIFI_POWER_SCENARIO_ON_HEAD_CELL_OFF;
using ::WIFI_POWER_SCENARIO_ON_HEAD_CELL_ON;
using ::WIFI_POWER_SCENARIO_VOICE_CALL;
+using ::wifi_radio_combination;
+using ::wifi_radio_combination_matrix;
+using ::wifi_radio_configuration;
using ::wifi_rate;
using ::wifi_request_id;
using ::wifi_ring_buffer_status;
@@ -450,6 +459,12 @@
std::function<void(const TwtDeviceNotify&)> on_device_notify;
};
+// CHRE response and event callbacks struct.
+struct ChreCallbackHandlers {
+ // Callback for CHRE NAN RTT
+ std::function<void(chre_nan_rtt_state)> on_wifi_chre_nan_rtt_state;
+};
+
/**
* Class that encapsulates all legacy HAL interactions.
* This class manages the lifetime of the event loop thread used by legacy HAL.
@@ -660,6 +675,14 @@
wifi_error setIndoorState(bool isIndoor);
+ std::pair<wifi_error, wifi_radio_combination_matrix*> getSupportedRadioCombinationsMatrix();
+
+ // CHRE NAN RTT function
+ wifi_error chreNanRttRequest(const std::string& iface_name, bool enable);
+
+ wifi_error chreRegisterHandler(const std::string& iface_name,
+ const ChreCallbackHandlers& handler);
+
private:
// Retrieve interface handles for all the available interfaces.
wifi_error retrieveIfaceHandles();
diff --git a/wifi/1.6/default/wifi_legacy_hal_stubs.cpp b/wifi/1.6/default/wifi_legacy_hal_stubs.cpp
index 7e66fab..5ad22f5 100644
--- a/wifi/1.6/default/wifi_legacy_hal_stubs.cpp
+++ b/wifi/1.6/default/wifi_legacy_hal_stubs.cpp
@@ -162,6 +162,10 @@
populateStubFor(&hal_fn->wifi_get_usable_channels);
populateStubFor(&hal_fn->wifi_trigger_subsystem_restart);
populateStubFor(&hal_fn->wifi_set_indoor_state);
+ populateStubFor(&hal_fn->wifi_get_supported_radio_combinations_matrix);
+ populateStubFor(&hal_fn->wifi_nan_rtt_chre_enable_request);
+ populateStubFor(&hal_fn->wifi_nan_rtt_chre_disable_request);
+ populateStubFor(&hal_fn->wifi_chre_register_handler);
return true;
}
} // namespace legacy_hal
diff --git a/wifi/1.6/types.hal b/wifi/1.6/types.hal
index ef6965d..80fdbd1 100644
--- a/wifi/1.6/types.hal
+++ b/wifi/1.6/types.hal
@@ -46,6 +46,7 @@
import @1.4::RttPreamble;
import @1.4::WifiRatePreamble;
import @1.5::NanConfigRequestSupplemental;
+import @1.5::WifiBand;
import @1.5::StaLinkLayerIfaceContentionTimeStats;
import @1.5::WifiIfaceMode;
@@ -87,6 +88,17 @@
};
/**
+ * Antenna configuration
+ */
+enum WifiAntennaMode : uint32_t {
+ WIFI_ANTENNA_MODE_UNSPECIFIED = 0,
+ WIFI_ANTENNA_MODE_1X1 = 1,
+ WIFI_ANTENNA_MODE_2X2 = 2,
+ WIFI_ANTENNA_MODE_3X3 = 3,
+ WIFI_ANTENNA_MODE_4X4 = 4,
+};
+
+/**
* Channel information.
*/
struct WifiChannelInfo {
@@ -1262,3 +1274,41 @@
*/
bool instantCommunicationModeSupportFlag;
};
+
+/**
+ * Wifi radio configuration
+ */
+struct WifiRadioConfiguration {
+ /**
+ * Band on which this radio chain is operating.
+ * Valid values of bandInfo are: BAND_24GHZ, BAND_5GHZ, BAND_6GHZ and
+ * BAND_60GHZ.
+ *
+ */
+ WifiBand bandInfo;
+
+ /**
+ * Wifi Antenna configuration.
+ */
+ WifiAntennaMode antennaMode;
+};
+
+/**
+ * Wifi radio combination
+ */
+struct WifiRadioCombination {
+ /**
+ * A list of radio configurations in this combination.
+ */
+ vec<WifiRadioConfiguration> radioConfigurations;
+};
+
+/**
+ * Wifi radio combinations matrix retrieved via |getSupportedRadioCombinationsMatrix|.
+ */
+struct WifiRadioCombinationMatrix {
+ /**
+ * A list of all the possible radio combinations that the chip can operate.
+ */
+ vec<WifiRadioCombination> radioCombinations;
+};
diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/EncryptionType.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/EncryptionType.aidl
index cec0c14..a7b20fa 100644
--- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/EncryptionType.aidl
+++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/EncryptionType.aidl
@@ -39,4 +39,6 @@
WPA2 = 2,
WPA3_SAE_TRANSITION = 3,
WPA3_SAE = 4,
+ WPA3_OWE_TRANSITION = 5,
+ WPA3_OWE = 6,
}
diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/EncryptionType.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/EncryptionType.aidl
index bfc634d..eb06b4a 100644
--- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/EncryptionType.aidl
+++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/EncryptionType.aidl
@@ -29,4 +29,6 @@
WPA2,
WPA3_SAE_TRANSITION,
WPA3_SAE,
+ WPA3_OWE_TRANSITION,
+ WPA3_OWE,
}
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
index 114fe4f..086166a 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
@@ -69,37 +69,6 @@
// disable.
bool waitForSupplicantStop() { return waitForSupplicantState(false); }
-// Helper function to initialize the driver and firmware to STA mode
-// using the vendor HAL HIDL interface.
-void initilializeDriverAndFirmware(const std::string& wifi_instance_name) {
- // Skip if wifi instance is not set.
- if (wifi_instance_name == "") {
- return;
- }
- if (getWifi(wifi_instance_name) != nullptr) {
- sp<IWifiChip> wifi_chip = getWifiChip(wifi_instance_name);
- ChipModeId mode_id;
- EXPECT_TRUE(configureChipToSupportIfaceType(
- wifi_chip, ::android::hardware::wifi::V1_0::IfaceType::STA, &mode_id));
- } else {
- LOG(WARNING) << __func__ << ": Vendor HAL not supported";
- }
-}
-
-// Helper function to deinitialize the driver and firmware
-// using the vendor HAL HIDL interface.
-void deInitilializeDriverAndFirmware(const std::string& wifi_instance_name) {
- // Skip if wifi instance is not set.
- if (wifi_instance_name == "") {
- return;
- }
- if (getWifi(wifi_instance_name) != nullptr) {
- stopWifi(wifi_instance_name);
- } else {
- LOG(WARNING) << __func__ << ": Vendor HAL not supported";
- }
-}
-
// Helper function to find any iface of the desired type exposed.
bool findIfaceOfType(sp<ISupplicant> supplicant, IfaceType desired_type,
ISupplicant::IfaceInfo* out_info) {
@@ -156,14 +125,46 @@
SupplicantManager supplicant_manager;
ASSERT_TRUE(supplicant_manager.StopSupplicant());
- deInitilializeDriverAndFirmware(wifi_instance_name);
+ deInitializeDriverAndFirmware(wifi_instance_name);
ASSERT_FALSE(supplicant_manager.IsSupplicantRunning());
}
+// Helper function to initialize the driver and firmware to STA mode
+// using the vendor HAL HIDL interface.
+void initializeDriverAndFirmware(const std::string& wifi_instance_name) {
+ // Skip if wifi instance is not set.
+ if (wifi_instance_name == "") {
+ return;
+ }
+ if (getWifi(wifi_instance_name) != nullptr) {
+ sp<IWifiChip> wifi_chip = getWifiChip(wifi_instance_name);
+ ChipModeId mode_id;
+ EXPECT_TRUE(configureChipToSupportIfaceType(
+ wifi_chip, ::android::hardware::wifi::V1_0::IfaceType::STA,
+ &mode_id));
+ } else {
+ LOG(WARNING) << __func__ << ": Vendor HAL not supported";
+ }
+}
+
+// Helper function to deinitialize the driver and firmware
+// using the vendor HAL HIDL interface.
+void deInitializeDriverAndFirmware(const std::string& wifi_instance_name) {
+ // Skip if wifi instance is not set.
+ if (wifi_instance_name == "") {
+ return;
+ }
+ if (getWifi(wifi_instance_name) != nullptr) {
+ stopWifi(wifi_instance_name);
+ } else {
+ LOG(WARNING) << __func__ << ": Vendor HAL not supported";
+ }
+}
+
void startSupplicantAndWaitForHidlService(
const std::string& wifi_instance_name,
const std::string& supplicant_instance_name) {
- initilializeDriverAndFirmware(wifi_instance_name);
+ initializeDriverAndFirmware(wifi_instance_name);
SupplicantManager supplicant_manager;
ASSERT_TRUE(supplicant_manager.StartSupplicant());
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h
index 22cea8c..7228623 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h
@@ -42,6 +42,11 @@
const std::string& wifi_instance_name,
const std::string& supplicant_instance_name);
+// Used to initialize/deinitialize the driver and firmware at the
+// beginning and end of each test.
+void initializeDriverAndFirmware(const std::string& wifi_instance_name);
+void deInitializeDriverAndFirmware(const std::string& wifi_instance_name);
+
// Helper functions to obtain references to the various HIDL interface objects.
// Note: We only have a single instance of each of these objects currently.
// These helper functions should be modified to return vectors if we support
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
index ca40379..5c0aacd 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
@@ -61,6 +61,9 @@
void reassociate();
void reconnect();
void registerCallback(in android.hardware.wifi.supplicant.ISupplicantStaIfaceCallback callback);
+ void setQosPolicyFeatureEnabled(in boolean enable);
+ void sendQosPolicyResponse(in boolean morePolicies, in android.hardware.wifi.supplicant.QosPolicyStatus[] qosPolicyStatusList);
+ void removeAllQosPolicies();
void removeDppUri(in int id);
void removeExtRadioWork(in int id);
void removeNetwork(in int id);
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
index 37b34cf..c17c624 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
@@ -60,4 +60,6 @@
oneway void onWpsEventFail(in byte[] bssid, in android.hardware.wifi.supplicant.WpsConfigError configError, in android.hardware.wifi.supplicant.WpsErrorIndication errorInd);
oneway void onWpsEventPbcOverlap();
oneway void onWpsEventSuccess();
+ oneway void onQosPolicyReset();
+ oneway void onQosPolicyRequest(in android.hardware.wifi.supplicant.QosPolicyData[] qosPolicyData);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IpVersion.aidl
similarity index 89%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IpVersion.aidl
index 4f29c0b..f571b44 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IpVersion.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
-@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+package android.hardware.wifi.supplicant;
+@Backing(type="byte") @VintfStability
+enum IpVersion {
+ VERSION_4 = 0,
+ VERSION_6 = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PortRange.aidl
similarity index 90%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PortRange.aidl
index 4f29c0b..b2004f2 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PortRange.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable PortRange {
+ int startPort;
+ int endPort;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl
similarity index 88%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl
index 4f29c0b..8fb91d0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
-@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+package android.hardware.wifi.supplicant;
+@Backing(type="byte") @VintfStability
+enum ProtocolNextHeader {
+ TCP = 6,
+ UDP = 17,
+ ESP = 50,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl
similarity index 76%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl
index 4f29c0b..8bf5fd8 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,16 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable QosPolicyClassifierParams {
+ android.hardware.wifi.supplicant.IpVersion ipVersion;
+ android.hardware.wifi.supplicant.QosPolicyClassifierParamsMask classifierParamMask;
+ byte[] srcIp;
+ byte[] dstIp;
+ int srcPort;
+ android.hardware.wifi.supplicant.PortRange dstPortRange;
+ android.hardware.wifi.supplicant.ProtocolNextHeader protocolNextHdr;
+ byte[] flowLabelIpv6;
+ String domainName;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
similarity index 85%
copy from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
index 5395b11..280ddbe 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,13 +31,14 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.messaging;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum UssdModeType {
- NOTIFY = 0,
- REQUEST = 1,
- NW_RELEASE = 2,
- LOCAL_CLIENT = 3,
- NOT_SUPPORTED = 4,
- NW_TIMEOUT = 5,
+enum QosPolicyClassifierParamsMask {
+ SRC_IP = 1,
+ DST_IP = 2,
+ SRC_PORT = 4,
+ DST_PORT_RANGE = 8,
+ PROTOCOL_NEXT_HEADER = 16,
+ FLOW_LABEL = 32,
+ DOMAIN_NAME = 64,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyData.aidl
similarity index 83%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyData.aidl
index 4f29c0b..1719565 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyData.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable QosPolicyData {
+ byte policyId;
+ android.hardware.wifi.supplicant.QosPolicyRequestType requestType;
+ byte dscp;
+ android.hardware.wifi.supplicant.QosPolicyClassifierParams classifierParams;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl
similarity index 87%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl
index 4f29c0b..4c1e4fa 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
-@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+package android.hardware.wifi.supplicant;
+@Backing(type="byte") @VintfStability
+enum QosPolicyRequestType {
+ QOS_POLICY_ADD = 0,
+ QOS_POLICY_REMOVE = 1,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatus.aidl
similarity index 88%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatus.aidl
index 4f29c0b..61278c5 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatus.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+parcelable QosPolicyStatus {
+ byte policyId;
+ android.hardware.wifi.supplicant.QosPolicyStatusCode status;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl
similarity index 83%
copy from radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl
index 4f29c0b..4d40edc 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,11 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.radio.network;
-@VintfStability
-parcelable NeighboringCell {
- String cid;
- int rssi;
+package android.hardware.wifi.supplicant;
+@Backing(type="byte") @VintfStability
+enum QosPolicyStatusCode {
+ QOS_POLICY_SUCCESS = 0,
+ QOS_POLICY_REQUEST_DECLINED = 1,
+ QOS_POLICY_CLASSIFIER_NOT_SUPPORTED = 2,
+ QOS_POLICY_INSUFFICIENT_RESOURCES = 3,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
index b48fa04..a48a991 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
@@ -28,6 +28,7 @@
import android.hardware.wifi.supplicant.ISupplicantStaNetwork;
import android.hardware.wifi.supplicant.IfaceType;
import android.hardware.wifi.supplicant.KeyMgmtMask;
+import android.hardware.wifi.supplicant.QosPolicyStatus;
import android.hardware.wifi.supplicant.RxFilterType;
import android.hardware.wifi.supplicant.WpaDriverCapabilitiesMask;
import android.hardware.wifi.supplicant.WpsConfigMethods;
@@ -377,6 +378,37 @@
void registerCallback(in ISupplicantStaIfaceCallback callback);
/**
+ * Enable/disable QoS policy feature.
+ * @param enable true to enable, false to disable.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setQosPolicyFeatureEnabled(in boolean enable);
+
+ /**
+ * Send a DSCP policy response to the AP. If a DSCP request is ongoing,
+ * sends a solicited (uses the ongoing DSCP request as dialog token) DSCP
+ * response. Otherwise, sends an unsolicited DSCP response.
+ *
+ * @param morePolicies Flag to indicate more QoS policies can be accommodated.
+ * @param qosPolicyStatusList QoS policy status info for each QoS policy id.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_UNSUPPORTED|
+ */
+ void sendQosPolicyResponse(in boolean morePolicies, in QosPolicyStatus[] qosPolicyStatusList);
+
+ /**
+ * Indicate removal of all active QoS policies configured by the AP.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_UNSUPPORTED|
+ */
+ void removeAllQosPolicies();
+
+ /**
* Remove a DPP peer URI.
*
* @param id The ID of the URI, as returned by |addDppPeerUri|.
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
index 594fef9..ca63f5c 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
@@ -26,6 +26,7 @@
import android.hardware.wifi.supplicant.DppProgressCode;
import android.hardware.wifi.supplicant.Hs20AnqpData;
import android.hardware.wifi.supplicant.OsuMethod;
+import android.hardware.wifi.supplicant.QosPolicyData;
import android.hardware.wifi.supplicant.StaIfaceCallbackState;
import android.hardware.wifi.supplicant.StaIfaceReasonCode;
import android.hardware.wifi.supplicant.WpsConfigError;
@@ -275,4 +276,17 @@
* Used to indicate the success of a WPS connection attempt.
*/
oneway void onWpsEventSuccess();
+
+ /**
+ * Used to indicate that the AP has cleared all DSCP requests
+ * associated with this device.
+ */
+ oneway void onQosPolicyReset();
+
+ /**
+ * Used to indicate a DSCP request was received from the AP.
+ *
+ * @param qosPolicyData QoS policies info requested by the AP.
+ */
+ oneway void onQosPolicyRequest(in QosPolicyData[] qosPolicyData);
}
diff --git a/audio/7.1/IStreamIn.hal b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/IpVersion.aidl
similarity index 77%
copy from audio/7.1/IStreamIn.hal
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/IpVersion.aidl
index abebe6a..ad83fd7 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/IpVersion.aidl
@@ -14,9 +14,14 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.wifi.supplicant;
-import @7.0::IStreamIn;
-
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * Enum values for IP version.
+ */
+@VintfStability
+@Backing(type="byte")
+enum IpVersion {
+ VERSION_4,
+ VERSION_6,
+}
diff --git a/audio/7.1/IStreamIn.hal b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/PortRange.aidl
similarity index 76%
copy from audio/7.1/IStreamIn.hal
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/PortRange.aidl
index abebe6a..0b8385e 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/PortRange.aidl
@@ -14,9 +14,13 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.wifi.supplicant;
-import @7.0::IStreamIn;
-
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * Port range to indicate start port and end port number.
+ */
+@VintfStability
+parcelable PortRange {
+ int startPort;
+ int endPort;
+}
diff --git a/audio/7.1/IStreamIn.hal b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl
similarity index 75%
copy from audio/7.1/IStreamIn.hal
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl
index abebe6a..643405b 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl
@@ -14,9 +14,15 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.wifi.supplicant;
-import @7.0::IStreamIn;
-
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * Enum values for Protocol/Next Header.
+ */
+@VintfStability
+@Backing(type="byte")
+enum ProtocolNextHeader {
+ TCP = 6,
+ UDP = 17,
+ ESP = 50,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl
new file mode 100644
index 0000000..d95d18d
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.IpVersion;
+import android.hardware.wifi.supplicant.PortRange;
+import android.hardware.wifi.supplicant.ProtocolNextHeader;
+import android.hardware.wifi.supplicant.QosPolicyClassifierParamsMask;
+
+/**
+ * QoS policy classifier parameters. Refer section 5.4 of the
+ * WFA (WiFi Alliance) QoS Management Specification v2.0.
+ */
+@VintfStability
+parcelable QosPolicyClassifierParams {
+ IpVersion ipVersion;
+
+ /**
+ * Classifier bit mask to identify filled fields. Setting a bit
+ * in the mask to 1 means the corresponding field in this struct
+ * has a value. Otherwise, that field should be ignored.
+ */
+ QosPolicyClassifierParamsMask classifierParamMask;
+
+ /** Source IP address. */
+ byte[] srcIp;
+
+ /** Destination IP address. */
+ byte[] dstIp;
+
+ /** Source port. */
+ int srcPort;
+
+ /**
+ * Destination port range. In the case of a single destination port,
+ * both startPort and endPort will have the same values.
+ */
+ PortRange dstPortRange;
+
+ /** Represents protocol for IPv4 and Next Header for IPv6. */
+ ProtocolNextHeader protocolNextHdr;
+
+ /** Applicable only for IPv6. */
+ byte[/* 3 */] flowLabelIpv6;
+
+ /**
+ * Domain Name encoded and formatted in accordance with the rules for
+ * "reg-name" in RFC 3986.
+ */
+ String domainName;
+}
diff --git a/audio/7.1/IStreamIn.hal b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
similarity index 62%
copy from audio/7.1/IStreamIn.hal
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
index abebe6a..51bc14c 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
@@ -14,9 +14,19 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.wifi.supplicant;
-import @7.0::IStreamIn;
-
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * Enum values for QoS policy classifier params mask bits.
+ */
+@VintfStability
+@Backing(type="int")
+enum QosPolicyClassifierParamsMask {
+ SRC_IP = 1 << 0,
+ DST_IP = 1 << 1,
+ SRC_PORT = 1 << 2,
+ DST_PORT_RANGE = 1 << 3,
+ PROTOCOL_NEXT_HEADER = 1 << 4,
+ FLOW_LABEL = 1 << 5,
+ DOMAIN_NAME = 1 << 6,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyData.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyData.aidl
new file mode 100644
index 0000000..0ae0def
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyData.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.QosPolicyClassifierParams;
+import android.hardware.wifi.supplicant.QosPolicyRequestType;
+
+/**
+ * QoS policy information in DSCP request.
+ */
+@VintfStability
+parcelable QosPolicyData {
+ /** QoS Policy identifier. */
+ byte policyId;
+
+ QosPolicyRequestType requestType;
+
+ /**
+ * DSCP value to be set for uplink traffic streams matched with
+ * |classifierParams|. Applicable only when |requestType| is
+ * |QOS_POLICY_ADD|.
+ */
+ byte dscp;
+
+ /**
+ * QoS policy classifier params. Applicable only when |requestType|
+ * is |QOS_POLICY_ADD|.
+ */
+ QosPolicyClassifierParams classifierParams;
+}
diff --git a/audio/7.1/IStreamIn.hal b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl
similarity index 64%
copy from audio/7.1/IStreamIn.hal
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl
index abebe6a..fd9a8d0 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl
@@ -14,9 +14,18 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.wifi.supplicant;
-import @7.0::IStreamIn;
-
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * Enum values for QoS Policy request type.
+ */
+@VintfStability
+@Backing(type="byte")
+enum QosPolicyRequestType {
+ /**
+ * If an Add request includes an existing policy,
+ * it should be considered an update request by the handler.
+ */
+ QOS_POLICY_ADD,
+ QOS_POLICY_REMOVE,
+}
diff --git a/audio/7.1/IStreamIn.hal b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyStatus.aidl
similarity index 71%
copy from audio/7.1/IStreamIn.hal
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyStatus.aidl
index abebe6a..9087048 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyStatus.aidl
@@ -14,9 +14,15 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.wifi.supplicant;
-import @7.0::IStreamIn;
+import android.hardware.wifi.supplicant.QosPolicyStatusCode;
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * QoS policy status tuple.
+ */
+@VintfStability
+parcelable QosPolicyStatus {
+ byte policyId;
+ QosPolicyStatusCode status;
+}
diff --git a/audio/7.1/IStreamIn.hal b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl
similarity index 66%
copy from audio/7.1/IStreamIn.hal
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl
index abebe6a..8ab60ad 100644
--- a/audio/7.1/IStreamIn.hal
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl
@@ -14,9 +14,16 @@
* limitations under the License.
*/
-package android.hardware.audio@7.1;
+package android.hardware.wifi.supplicant;
-import @7.0::IStreamIn;
-
-interface IStreamIn extends @7.0::IStreamIn {
-};
+/**
+ * Enum values for QoS policy response status.
+ */
+@VintfStability
+@Backing(type="byte")
+enum QosPolicyStatusCode {
+ QOS_POLICY_SUCCESS,
+ QOS_POLICY_REQUEST_DECLINED,
+ QOS_POLICY_CLASSIFIER_NOT_SUPPORTED,
+ QOS_POLICY_INSUFFICIENT_RESOURCES,
+}
diff --git a/wifi/supplicant/aidl/vts/functional/Android.bp b/wifi/supplicant/aidl/vts/functional/Android.bp
index 65f9652..8e142ec 100644
--- a/wifi/supplicant/aidl/vts/functional/Android.bp
+++ b/wifi/supplicant/aidl/vts/functional/Android.bp
@@ -33,11 +33,23 @@
shared_libs: [
"libbinder",
"libbinder_ndk",
+ "libvndksupport",
],
static_libs: [
+ "android.hardware.wifi@1.0",
+ "android.hardware.wifi@1.1",
+ "android.hardware.wifi@1.2",
+ "android.hardware.wifi@1.3",
+ "android.hardware.wifi@1.4",
+ "android.hardware.wifi@1.5",
+ "android.hardware.wifi.supplicant@1.0",
+ "android.hardware.wifi.supplicant@1.1",
"android.hardware.wifi.supplicant-V1-ndk",
"libwifi-system",
"libwifi-system-iface",
+ "VtsHalWifiV1_0TargetTestUtil",
+ "VtsHalWifiV1_5TargetTestUtil",
+ "VtsHalWifiSupplicantV1_0TargetTestUtil",
],
test_suites: [
"general-tests",
@@ -55,11 +67,23 @@
shared_libs: [
"libbinder",
"libbinder_ndk",
+ "libvndksupport",
],
static_libs: [
+ "android.hardware.wifi@1.0",
+ "android.hardware.wifi@1.1",
+ "android.hardware.wifi@1.2",
+ "android.hardware.wifi@1.3",
+ "android.hardware.wifi@1.4",
+ "android.hardware.wifi@1.5",
+ "android.hardware.wifi.supplicant@1.0",
+ "android.hardware.wifi.supplicant@1.1",
"android.hardware.wifi.supplicant-V1-ndk",
"libwifi-system",
"libwifi-system-iface",
+ "VtsHalWifiV1_0TargetTestUtil",
+ "VtsHalWifiV1_5TargetTestUtil",
+ "VtsHalWifiSupplicantV1_0TargetTestUtil",
],
test_suites: [
"general-tests",
@@ -77,11 +101,23 @@
shared_libs: [
"libbinder",
"libbinder_ndk",
+ "libvndksupport",
],
static_libs: [
+ "android.hardware.wifi@1.0",
+ "android.hardware.wifi@1.1",
+ "android.hardware.wifi@1.2",
+ "android.hardware.wifi@1.3",
+ "android.hardware.wifi@1.4",
+ "android.hardware.wifi@1.5",
+ "android.hardware.wifi.supplicant@1.0",
+ "android.hardware.wifi.supplicant@1.1",
"android.hardware.wifi.supplicant-V1-ndk",
"libwifi-system",
"libwifi-system-iface",
+ "VtsHalWifiV1_0TargetTestUtil",
+ "VtsHalWifiV1_5TargetTestUtil",
+ "VtsHalWifiSupplicantV1_0TargetTestUtil",
],
test_suites: [
"general-tests",
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
index 8c7018d..d95bd03 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
@@ -181,8 +181,7 @@
public:
void SetUp() override {
initializeService();
- supplicant_ = ISupplicant::fromBinder(ndk::SpAIBinder(
- AServiceManager_waitForService(GetParam().c_str())));
+ supplicant_ = getSupplicant(GetParam().c_str());
ASSERT_NE(supplicant_, nullptr);
ASSERT_TRUE(supplicant_
->setDebugParams(DebugLevel::EXCESSIVE,
@@ -196,13 +195,13 @@
GTEST_SKIP() << "Wi-Fi Direct is not supported, skip this test.";
}
- EXPECT_TRUE(supplicant_->addP2pInterface(getP2pIfaceName(), &p2p_iface_)
+ EXPECT_TRUE(supplicant_->getP2pInterface(getP2pIfaceName(), &p2p_iface_)
.isOk());
ASSERT_NE(p2p_iface_, nullptr);
}
void TearDown() override {
- stopSupplicant();
+ stopSupplicantService();
startWifiFramework();
}
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
index 6e6955f..c163864 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
@@ -191,27 +191,32 @@
::ndk::ScopedAStatus onWpsEventSuccess() override {
return ndk::ScopedAStatus::ok();
}
+ ::ndk::ScopedAStatus onQosPolicyReset() override { return ndk::ScopedAStatus::ok(); }
+ ::ndk::ScopedAStatus onQosPolicyRequest(
+ const std::vector<::aidl::android::hardware::wifi::supplicant ::
+ QosPolicyData /* qosPolicyData */>&) override {
+ return ndk::ScopedAStatus::ok();
+ }
};
class SupplicantStaIfaceAidlTest : public testing::TestWithParam<std::string> {
public:
void SetUp() override {
initializeService();
- supplicant_ = ISupplicant::fromBinder(ndk::SpAIBinder(
- AServiceManager_waitForService(GetParam().c_str())));
+ supplicant_ = getSupplicant(GetParam().c_str());
ASSERT_NE(supplicant_, nullptr);
ASSERT_TRUE(supplicant_
->setDebugParams(DebugLevel::EXCESSIVE,
true, // show timestamps
true)
.isOk());
- EXPECT_TRUE(supplicant_->addStaInterface(getStaIfaceName(), &sta_iface_)
+ EXPECT_TRUE(supplicant_->getStaInterface(getStaIfaceName(), &sta_iface_)
.isOk());
ASSERT_NE(sta_iface_, nullptr);
}
void TearDown() override {
- stopSupplicant();
+ stopSupplicantService();
startWifiFramework();
}
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp
index c6dd981..b3f70da 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp
@@ -105,15 +105,14 @@
public:
void SetUp() override {
initializeService();
- supplicant_ = ISupplicant::fromBinder(ndk::SpAIBinder(
- AServiceManager_waitForService(GetParam().c_str())));
+ supplicant_ = getSupplicant(GetParam().c_str());
ASSERT_NE(supplicant_, nullptr);
ASSERT_TRUE(supplicant_
->setDebugParams(DebugLevel::EXCESSIVE,
true, // show timestamps
true)
.isOk());
- EXPECT_TRUE(supplicant_->addStaInterface(getStaIfaceName(), &sta_iface_)
+ EXPECT_TRUE(supplicant_->getStaInterface(getStaIfaceName(), &sta_iface_)
.isOk());
ASSERT_NE(sta_iface_, nullptr);
EXPECT_TRUE(sta_iface_->addNetwork(&sta_network_).isOk());
@@ -121,7 +120,7 @@
}
void TearDown() override {
- stopSupplicant();
+ stopSupplicantService();
startWifiFramework();
}
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h b/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h
index b7e1a80..17e0394 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h
@@ -19,8 +19,14 @@
#include <VtsCoreUtil.h>
#include <android-base/logging.h>
+#include <android/hardware/wifi/1.0/IWifi.h>
+#include <hidl/ServiceManagement.h>
+#include <supplicant_hidl_test_utils.h>
#include <wifi_system/supplicant_manager.h>
+using aidl::android::hardware::wifi::supplicant::IfaceInfo;
+using aidl::android::hardware::wifi::supplicant::ISupplicant;
+using aidl::android::hardware::wifi::supplicant::ISupplicantP2pIface;
using aidl::android::hardware::wifi::supplicant::ISupplicantStaIface;
using aidl::android::hardware::wifi::supplicant::KeyMgmtMask;
using android::wifi_system::SupplicantManager;
@@ -37,6 +43,14 @@
return std::string(buffer.data());
}
+std::string getWifiInstanceName() {
+ const std::vector<std::string> instances =
+ android::hardware::getAllHalInstanceNames(
+ ::android::hardware::wifi::V1_0::IWifi::descriptor);
+ EXPECT_NE(0, instances.size());
+ return instances.size() != 0 ? instances[0] : "";
+}
+
bool keyMgmtSupported(std::shared_ptr<ISupplicantStaIface> iface,
KeyMgmtMask expected) {
KeyMgmtMask caps;
@@ -53,60 +67,44 @@
return keyMgmtSupported(iface, filsMask);
}
-bool waitForSupplicantState(bool is_running) {
+void startSupplicant() {
+ initializeDriverAndFirmware(getWifiInstanceName());
SupplicantManager supplicant_manager;
- int count = 50; /* wait at most 5 seconds for completion */
- while (count-- > 0) {
- if (supplicant_manager.IsSupplicantRunning() == is_running) {
- return true;
- }
- usleep(100000);
- }
- LOG(ERROR) << "Supplicant not " << (is_running ? "running" : "stopped");
- return false;
+ ASSERT_TRUE(supplicant_manager.StartSupplicant());
+ ASSERT_TRUE(supplicant_manager.IsSupplicantRunning());
}
-bool waitForFrameworkReady() {
- int waitCount = 15;
- do {
- // Check whether package service is ready or not.
- if (!testing::checkSubstringInCommandOutput(
- "/system/bin/service check package", ": not found")) {
- return true;
- }
- LOG(INFO) << "Framework is not ready";
- sleep(1);
- } while (waitCount-- > 0);
- return false;
-}
-
-bool waitForSupplicantStart() { return waitForSupplicantState(true); }
-
-bool waitForSupplicantStop() { return waitForSupplicantState(false); }
-
-void stopSupplicant() {
- SupplicantManager supplicant_manager;
- ASSERT_TRUE(supplicant_manager.StopSupplicant());
- ASSERT_FALSE(supplicant_manager.IsSupplicantRunning());
-}
-
-bool startWifiFramework() {
- std::system("svc wifi enable");
- std::system("cmd wifi set-scan-always-available enabled");
- return waitForSupplicantStart();
-}
-
-bool stopWifiFramework() {
- std::system("svc wifi disable");
- std::system("cmd wifi set-scan-always-available disabled");
- return waitForSupplicantStop();
-}
+// Wrapper around the implementation in supplicant_hidl_test_util.
+void stopSupplicantService() { stopSupplicant(getWifiInstanceName()); }
void initializeService() {
ASSERT_TRUE(stopWifiFramework());
std::system("/system/bin/start");
ASSERT_TRUE(waitForFrameworkReady());
- stopSupplicant();
+ stopSupplicantService();
+ startSupplicant();
+}
+
+void addStaIface(const std::shared_ptr<ISupplicant> supplicant) {
+ ASSERT_TRUE(supplicant.get());
+ std::shared_ptr<ISupplicantStaIface> iface;
+ ASSERT_TRUE(supplicant->addStaInterface(getStaIfaceName(), &iface).isOk());
+}
+
+void addP2pIface(const std::shared_ptr<ISupplicant> supplicant) {
+ ASSERT_TRUE(supplicant.get());
+ std::shared_ptr<ISupplicantP2pIface> iface;
+ ASSERT_TRUE(supplicant->addP2pInterface(getP2pIfaceName(), &iface).isOk());
+}
+
+std::shared_ptr<ISupplicant> getSupplicant(const char* supplicant_name) {
+ std::shared_ptr<ISupplicant> supplicant = ISupplicant::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(supplicant_name)));
+ addStaIface(supplicant);
+ if (testing::deviceSupportsFeature("android.hardware.wifi.direct")) {
+ addP2pIface(supplicant);
+ }
+ return supplicant;
}
#endif // SUPPLICANT_TEST_UTILS_H
\ No newline at end of file