Merge "lnitialize payload of additionallnfo for VTS InjectSensorEventData test" into android14-tests-dev
This commit is contained in:
commit
01d47260a1
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