Merge "lnitialize payload of additionallnfo for VTS InjectSensorEventData test" into android14-tests-dev am: 01d47260a1
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2795667 Change-Id: I2e6f7921aeea6e3e0d5a2d5c9ceacdd1a60b5403 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
253353540d
1 changed files with 10 additions and 0 deletions
|
@ -41,6 +41,7 @@ using aidl::android::hardware::sensors::ISensors;
|
|||
using aidl::android::hardware::sensors::SensorInfo;
|
||||
using aidl::android::hardware::sensors::SensorStatus;
|
||||
using aidl::android::hardware::sensors::SensorType;
|
||||
using aidl::android::hardware::sensors::AdditionalInfo;
|
||||
using android::ProcessState;
|
||||
using std::chrono::duration_cast;
|
||||
|
||||
|
@ -629,6 +630,15 @@ TEST_P(SensorsAidlTest, InjectSensorEventData) {
|
|||
Event additionalInfoEvent;
|
||||
additionalInfoEvent.sensorType = SensorType::ADDITIONAL_INFO;
|
||||
additionalInfoEvent.timestamp = android::elapsedRealtimeNano();
|
||||
AdditionalInfo info;
|
||||
info.type = AdditionalInfo::AdditionalInfoType::AINFO_BEGIN;
|
||||
info.serial = 1;
|
||||
AdditionalInfo::AdditionalInfoPayload::Int32Values infoData;
|
||||
for (int32_t i = 0; i < 14; i++) {
|
||||
infoData.values[i] = i;
|
||||
}
|
||||
info.payload.set<AdditionalInfo::AdditionalInfoPayload::Tag::dataInt32>(infoData);
|
||||
additionalInfoEvent.payload.set<Event::EventPayload::Tag::additional>(info);
|
||||
|
||||
Event injectedEvent;
|
||||
injectedEvent.timestamp = android::elapsedRealtimeNano();
|
||||
|
|
Loading…
Reference in a new issue