diff options
author | android-build-team Robot | 2018-04-01 02:26:53 -0500 |
---|---|---|
committer | android-build-team Robot | 2018-04-01 02:26:53 -0500 |
commit | 456a6dd9f0a928044b65b6a47709d28775859167 (patch) | |
tree | c48430fc1645262ff1e0a316b9f03c1efcc3d5a9 | |
parent | a87236462c2b5798b2e2f75b9ec7cc7cefd74b0f (diff) | |
parent | bdf10416ee1ed7fdbf501afe0d49c4d2e71270dc (diff) | |
download | platform-hardware-interfaces-456a6dd9f0a928044b65b6a47709d28775859167.tar.gz platform-hardware-interfaces-456a6dd9f0a928044b65b6a47709d28775859167.tar.xz platform-hardware-interfaces-456a6dd9f0a928044b65b6a47709d28775859167.zip |
Snap for 4693621 from bdf10416ee1ed7fdbf501afe0d49c4d2e71270dc to pi-release
Change-Id: I2c51883705d9f1780bf3d2cf09ac1f6ed376a421
35 files changed, 738 insertions, 143 deletions
diff --git a/audio/core/all-versions/default/include/core/all-versions/default/Conversions.h b/audio/core/all-versions/default/include/core/all-versions/default/Conversions.h index fa053509..b38eca35 100644 --- a/audio/core/all-versions/default/include/core/all-versions/default/Conversions.h +++ b/audio/core/all-versions/default/include/core/all-versions/default/Conversions.h | |||
@@ -30,6 +30,11 @@ using ::android::hardware::audio::AUDIO_HAL_VERSION::DeviceAddress; | |||
30 | 30 | ||
31 | std::string deviceAddressToHal(const DeviceAddress& address); | 31 | std::string deviceAddressToHal(const DeviceAddress& address); |
32 | 32 | ||
33 | #ifdef AUDIO_HAL_VERSION_4_0 | ||
34 | bool halToMicrophoneCharacteristics(MicrophoneInfo* pDst, | ||
35 | const struct audio_microphone_characteristic_t& src); | ||
36 | #endif | ||
37 | |||
33 | } // namespace implementation | 38 | } // namespace implementation |
34 | } // namespace AUDIO_HAL_VERSION | 39 | } // namespace AUDIO_HAL_VERSION |
35 | } // namespace audio | 40 | } // namespace audio |
diff --git a/audio/core/all-versions/default/include/core/all-versions/default/Conversions.impl.h b/audio/core/all-versions/default/include/core/all-versions/default/Conversions.impl.h index 3f3f936a..004a99ee 100644 --- a/audio/core/all-versions/default/include/core/all-versions/default/Conversions.impl.h +++ b/audio/core/all-versions/default/include/core/all-versions/default/Conversions.impl.h | |||
@@ -24,6 +24,8 @@ namespace audio { | |||
24 | namespace AUDIO_HAL_VERSION { | 24 | namespace AUDIO_HAL_VERSION { |
25 | namespace implementation { | 25 | namespace implementation { |
26 | 26 | ||
27 | using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice; | ||
28 | |||
27 | std::string deviceAddressToHal(const DeviceAddress& address) { | 29 | std::string deviceAddressToHal(const DeviceAddress& address) { |
28 | // HAL assumes that the address is NUL-terminated. | 30 | // HAL assumes that the address is NUL-terminated. |
29 | char halAddress[AUDIO_DEVICE_MAX_ADDRESS_LEN]; | 31 | char halAddress[AUDIO_DEVICE_MAX_ADDRESS_LEN]; |
@@ -54,6 +56,132 @@ std::string deviceAddressToHal(const DeviceAddress& address) { | |||
54 | return halAddress; | 56 | return halAddress; |
55 | } | 57 | } |
56 | 58 | ||
59 | #ifdef AUDIO_HAL_VERSION_4_0 | ||
60 | status_t deviceAddressFromHal(audio_devices_t device, const char* halAddress, | ||
61 | DeviceAddress* address) { | ||
62 | if (address == nullptr) { | ||
63 | return BAD_VALUE; | ||
64 | } | ||
65 | address->device = AudioDevice(device); | ||
66 | if (halAddress == nullptr || strnlen(halAddress, AUDIO_DEVICE_MAX_ADDRESS_LEN) == 0) { | ||
67 | return OK; | ||
68 | } | ||
69 | |||
70 | const bool isInput = (device & AUDIO_DEVICE_BIT_IN) != 0; | ||
71 | if (isInput) device &= ~AUDIO_DEVICE_BIT_IN; | ||
72 | if ((!isInput && (device & AUDIO_DEVICE_OUT_ALL_A2DP) != 0) || | ||
73 | (isInput && (device & AUDIO_DEVICE_IN_BLUETOOTH_A2DP) != 0)) { | ||
74 | int status = | ||
75 | sscanf(halAddress, "%hhX:%hhX:%hhX:%hhX:%hhX:%hhX", &address->address.mac[0], | ||
76 | &address->address.mac[1], &address->address.mac[2], &address->address.mac[3], | ||
77 | &address->address.mac[4], &address->address.mac[5]); | ||
78 | return status == 6 ? OK : BAD_VALUE; | ||
79 | } else if ((!isInput && (device & AUDIO_DEVICE_OUT_IP) != 0) || | ||
80 | (isInput && (device & AUDIO_DEVICE_IN_IP) != 0)) { | ||
81 | int status = | ||
82 | sscanf(halAddress, "%hhu.%hhu.%hhu.%hhu", &address->address.ipv4[0], | ||
83 | &address->address.ipv4[1], &address->address.ipv4[2], &address->address.ipv4[3]); | ||
84 | return status == 4 ? OK : BAD_VALUE; | ||
85 | } else if ((!isInput && (device & AUDIO_DEVICE_OUT_ALL_USB)) != 0 || | ||
86 | (isInput && (device & AUDIO_DEVICE_IN_ALL_USB)) != 0) { | ||
87 | int status = sscanf(halAddress, "card=%d;device=%d", &address->address.alsa.card, | ||
88 | &address->address.alsa.device); | ||
89 | return status == 2 ? OK : BAD_VALUE; | ||
90 | } else if ((!isInput && (device & AUDIO_DEVICE_OUT_BUS) != 0) || | ||
91 | (isInput && (device & AUDIO_DEVICE_IN_BUS) != 0)) { | ||
92 | address->busAddress = halAddress; | ||
93 | return OK; | ||
94 | } else if ((!isInput && (device & AUDIO_DEVICE_OUT_REMOTE_SUBMIX)) != 0 || | ||
95 | (isInput && (device & AUDIO_DEVICE_IN_REMOTE_SUBMIX) != 0)) { | ||
96 | address->rSubmixAddress = halAddress; | ||
97 | return OK; | ||
98 | } | ||
99 | address->busAddress = halAddress; | ||
100 | return OK; | ||
101 | } | ||
102 | |||
103 | AudioMicrophoneChannelMapping halToChannelMapping(audio_microphone_channel_mapping_t mapping) { | ||
104 | switch (mapping) { | ||
105 | case AUDIO_MICROPHONE_CHANNEL_MAPPING_UNUSED: | ||
106 | return AudioMicrophoneChannelMapping::UNUSED; | ||
107 | case AUDIO_MICROPHONE_CHANNEL_MAPPING_DIRECT: | ||
108 | return AudioMicrophoneChannelMapping::DIRECT; | ||
109 | case AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED: | ||
110 | return AudioMicrophoneChannelMapping::PROCESSED; | ||
111 | } | ||
112 | } | ||
113 | |||
114 | AudioMicrophoneLocation halToLocation(audio_microphone_location_t location) { | ||
115 | switch (location) { | ||
116 | default: | ||
117 | case AUDIO_MICROPHONE_LOCATION_UNKNOWN: | ||
118 | return AudioMicrophoneLocation::UNKNOWN; | ||
119 | case AUDIO_MICROPHONE_LOCATION_MAINBODY: | ||
120 | return AudioMicrophoneLocation::MAINBODY; | ||
121 | case AUDIO_MICROPHONE_LOCATION_MAINBODY_MOVABLE: | ||
122 | return AudioMicrophoneLocation::MAINBODY_MOVABLE; | ||
123 | case AUDIO_MICROPHONE_LOCATION_PERIPHERAL: | ||
124 | return AudioMicrophoneLocation::PERIPHERAL; | ||
125 | } | ||
126 | } | ||
127 | |||
128 | AudioMicrophoneDirectionality halToDirectionality(audio_microphone_directionality_t dir) { | ||
129 | switch (dir) { | ||
130 | default: | ||
131 | case AUDIO_MICROPHONE_DIRECTIONALITY_UNKNOWN: | ||
132 | return AudioMicrophoneDirectionality::UNKNOWN; | ||
133 | case AUDIO_MICROPHONE_DIRECTIONALITY_OMNI: | ||
134 | return AudioMicrophoneDirectionality::OMNI; | ||
135 | case AUDIO_MICROPHONE_DIRECTIONALITY_BI_DIRECTIONAL: | ||
136 | return AudioMicrophoneDirectionality::BI_DIRECTIONAL; | ||
137 | case AUDIO_MICROPHONE_DIRECTIONALITY_CARDIOID: | ||
138 | return AudioMicrophoneDirectionality::CARDIOID; | ||
139 | case AUDIO_MICROPHONE_DIRECTIONALITY_HYPER_CARDIOID: | ||
140 | return AudioMicrophoneDirectionality::HYPER_CARDIOID; | ||
141 | case AUDIO_MICROPHONE_DIRECTIONALITY_SUPER_CARDIOID: | ||
142 | return AudioMicrophoneDirectionality::SUPER_CARDIOID; | ||
143 | } | ||
144 | } | ||
145 | |||
146 | bool halToMicrophoneCharacteristics(MicrophoneInfo* pDst, | ||
147 | const struct audio_microphone_characteristic_t& src) { | ||
148 | bool status = false; | ||
149 | if (pDst != NULL) { | ||
150 | pDst->deviceId = src.device_id; | ||
151 | |||
152 | if (deviceAddressFromHal(src.device, src.address, &pDst->deviceAddress) != OK) { | ||
153 | return false; | ||
154 | } | ||
155 | pDst->channelMapping.resize(AUDIO_CHANNEL_COUNT_MAX); | ||
156 | for (size_t ch = 0; ch < pDst->channelMapping.size(); ch++) { | ||
157 | pDst->channelMapping[ch] = halToChannelMapping(src.channel_mapping[ch]); | ||
158 | } | ||
159 | pDst->location = halToLocation(src.location); | ||
160 | pDst->group = (AudioMicrophoneGroup)src.group; | ||
161 | pDst->indexInTheGroup = (uint32_t)src.index_in_the_group; | ||
162 | pDst->sensitivity = src.sensitivity; | ||
163 | pDst->maxSpl = src.max_spl; | ||
164 | pDst->minSpl = src.min_spl; | ||
165 | pDst->directionality = halToDirectionality(src.directionality); | ||
166 | pDst->frequencyResponse.resize(src.num_frequency_responses); | ||
167 | for (size_t k = 0; k < src.num_frequency_responses; k++) { | ||
168 | pDst->frequencyResponse[k].frequency = src.frequency_responses[0][k]; | ||
169 | pDst->frequencyResponse[k].level = src.frequency_responses[1][k]; | ||
170 | } | ||
171 | pDst->position.x = src.geometric_location.x; | ||
172 | pDst->position.y = src.geometric_location.y; | ||
173 | pDst->position.z = src.geometric_location.z; | ||
174 | |||
175 | pDst->orientation.x = src.orientation.x; | ||
176 | pDst->orientation.y = src.orientation.y; | ||
177 | pDst->orientation.z = src.orientation.z; | ||
178 | |||
179 | status = true; | ||
180 | } | ||
181 | return status; | ||
182 | } | ||
183 | #endif | ||
184 | |||
57 | } // namespace implementation | 185 | } // namespace implementation |
58 | } // namespace AUDIO_HAL_VERSION | 186 | } // namespace AUDIO_HAL_VERSION |
59 | } // namespace audio | 187 | } // namespace audio |
diff --git a/audio/core/all-versions/default/include/core/all-versions/default/Device.impl.h b/audio/core/all-versions/default/include/core/all-versions/default/Device.impl.h index fb4b686c..581e1dcc 100644 --- a/audio/core/all-versions/default/include/core/all-versions/default/Device.impl.h +++ b/audio/core/all-versions/default/include/core/all-versions/default/Device.impl.h | |||
@@ -332,8 +332,20 @@ Return<void> Device::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& / | |||
332 | 332 | ||
333 | #ifdef AUDIO_HAL_VERSION_4_0 | 333 | #ifdef AUDIO_HAL_VERSION_4_0 |
334 | Return<void> Device::getMicrophones(getMicrophones_cb _hidl_cb) { | 334 | Return<void> Device::getMicrophones(getMicrophones_cb _hidl_cb) { |
335 | // TODO return device microphones | 335 | Result retval = Result::NOT_SUPPORTED; |
336 | _hidl_cb(Result::NOT_SUPPORTED, {}); | 336 | size_t actual_mics = AUDIO_MICROPHONE_MAX_COUNT; |
337 | audio_microphone_characteristic_t mic_array[AUDIO_MICROPHONE_MAX_COUNT]; | ||
338 | |||
339 | hidl_vec<MicrophoneInfo> microphones; | ||
340 | if (mDevice->get_microphones != NULL && | ||
341 | mDevice->get_microphones(mDevice, &mic_array[0], &actual_mics) == 0) { | ||
342 | microphones.resize(actual_mics); | ||
343 | for (size_t i = 0; i < actual_mics; ++i) { | ||
344 | halToMicrophoneCharacteristics(µphones[i], mic_array[i]); | ||
345 | } | ||
346 | retval = Result::OK; | ||
347 | } | ||
348 | _hidl_cb(retval, microphones); | ||
337 | return Void(); | 349 | return Void(); |
338 | } | 350 | } |
339 | 351 | ||
diff --git a/audio/core/all-versions/default/include/core/all-versions/default/StreamIn.impl.h b/audio/core/all-versions/default/include/core/all-versions/default/StreamIn.impl.h index dcd3df19..8774be90 100644 --- a/audio/core/all-versions/default/include/core/all-versions/default/StreamIn.impl.h +++ b/audio/core/all-versions/default/include/core/all-versions/default/StreamIn.impl.h | |||
@@ -26,6 +26,8 @@ | |||
26 | 26 | ||
27 | using ::android::hardware::audio::AUDIO_HAL_VERSION::MessageQueueFlagBits; | 27 | using ::android::hardware::audio::AUDIO_HAL_VERSION::MessageQueueFlagBits; |
28 | using ::android::hardware::audio::all_versions::implementation::isGainNormalized; | 28 | using ::android::hardware::audio::all_versions::implementation::isGainNormalized; |
29 | #include "Conversions.h" | ||
30 | #include "Util.h" | ||
29 | 31 | ||
30 | namespace android { | 32 | namespace android { |
31 | namespace hardware { | 33 | namespace hardware { |
@@ -449,12 +451,39 @@ Return<void> StreamIn::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& | |||
449 | } | 451 | } |
450 | 452 | ||
451 | #ifdef AUDIO_HAL_VERSION_4_0 | 453 | #ifdef AUDIO_HAL_VERSION_4_0 |
452 | Return<void> StreamIn::updateSinkMetadata(const SinkMetadata& /*sinkMetadata*/) { | 454 | Return<void> StreamIn::updateSinkMetadata(const SinkMetadata& sinkMetadata) { |
453 | return Void(); // TODO: propagate to legacy | 455 | if (mStream->update_sink_metadata == nullptr) { |
456 | return Void(); // not supported by the HAL | ||
457 | } | ||
458 | std::vector<record_track_metadata> halTracks; | ||
459 | halTracks.reserve(sinkMetadata.tracks.size()); | ||
460 | for (auto& metadata : sinkMetadata.tracks) { | ||
461 | halTracks.push_back( | ||
462 | {.source = static_cast<audio_source_t>(metadata.source), .gain = metadata.gain}); | ||
463 | } | ||
464 | const sink_metadata_t halMetadata = { | ||
465 | .track_count = halTracks.size(), .tracks = halTracks.data(), | ||
466 | }; | ||
467 | mStream->update_sink_metadata(mStream, &halMetadata); | ||
468 | return Void(); | ||
454 | } | 469 | } |
455 | 470 | ||
456 | Return<void> StreamIn::getActiveMicrophones(getActiveMicrophones_cb _hidl_cb) { | 471 | Return<void> StreamIn::getActiveMicrophones(getActiveMicrophones_cb _hidl_cb) { |
457 | _hidl_cb(Result::NOT_SUPPORTED, {}); // TODO: retrieve from legacy | 472 | Result retval = Result::NOT_SUPPORTED; |
473 | size_t actual_mics = AUDIO_MICROPHONE_MAX_COUNT; | ||
474 | audio_microphone_characteristic_t mic_array[AUDIO_MICROPHONE_MAX_COUNT]; | ||
475 | |||
476 | hidl_vec<MicrophoneInfo> microphones; | ||
477 | if (mStream->get_active_microphones != NULL && | ||
478 | mStream->get_active_microphones(mStream, &mic_array[0], &actual_mics) == 0) { | ||
479 | microphones.resize(actual_mics); | ||
480 | for (size_t i = 0; i < actual_mics; ++i) { | ||
481 | halToMicrophoneCharacteristics(µphones[i], mic_array[i]); | ||
482 | } | ||
483 | retval = Result::OK; | ||
484 | } | ||
485 | |||
486 | _hidl_cb(retval, microphones); | ||
458 | return Void(); | 487 | return Void(); |
459 | } | 488 | } |
460 | #endif | 489 | #endif |
diff --git a/audio/core/all-versions/default/include/core/all-versions/default/StreamOut.impl.h b/audio/core/all-versions/default/include/core/all-versions/default/StreamOut.impl.h index 605b8241..77098a81 100644 --- a/audio/core/all-versions/default/include/core/all-versions/default/StreamOut.impl.h +++ b/audio/core/all-versions/default/include/core/all-versions/default/StreamOut.impl.h | |||
@@ -547,8 +547,24 @@ Return<void> StreamOut::debug(const hidl_handle& fd, const hidl_vec<hidl_string> | |||
547 | } | 547 | } |
548 | 548 | ||
549 | #ifdef AUDIO_HAL_VERSION_4_0 | 549 | #ifdef AUDIO_HAL_VERSION_4_0 |
550 | Return<void> StreamOut::updateSourceMetadata(const SourceMetadata& /*sourceMetadata*/) { | 550 | Return<void> StreamOut::updateSourceMetadata(const SourceMetadata& sourceMetadata) { |
551 | return Void(); // TODO: propagate to legacy | 551 | if (mStream->update_source_metadata == nullptr) { |
552 | return Void(); // not supported by the HAL | ||
553 | } | ||
554 | std::vector<playback_track_metadata> halTracks; | ||
555 | halTracks.reserve(sourceMetadata.tracks.size()); | ||
556 | for (auto& metadata : sourceMetadata.tracks) { | ||
557 | halTracks.push_back({ | ||
558 | .usage = static_cast<audio_usage_t>(metadata.usage), | ||
559 | .content_type = static_cast<audio_content_type_t>(metadata.contentType), | ||
560 | .gain = metadata.gain, | ||
561 | }); | ||
562 | } | ||
563 | const source_metadata_t halMetadata = { | ||
564 | .track_count = halTracks.size(), .tracks = halTracks.data(), | ||
565 | }; | ||
566 | mStream->update_source_metadata(mStream, &halMetadata); | ||
567 | return Void(); | ||
552 | } | 568 | } |
553 | Return<Result> StreamOut::selectPresentation(int32_t /*presentationId*/, int32_t /*programId*/) { | 569 | Return<Result> StreamOut::selectPresentation(int32_t /*presentationId*/, int32_t /*programId*/) { |
554 | return Result::NOT_SUPPORTED; // TODO: propagate to legacy | 570 | return Result::NOT_SUPPORTED; // TODO: propagate to legacy |
diff --git a/automotive/vehicle/2.0/Android.bp b/automotive/vehicle/2.0/Android.bp index 902a4e83..3e32b3e8 100644 --- a/automotive/vehicle/2.0/Android.bp +++ b/automotive/vehicle/2.0/Android.bp | |||
@@ -43,7 +43,6 @@ hidl_interface { | |||
43 | "VehicleAreaWindow", | 43 | "VehicleAreaWindow", |
44 | "VehicleAreaZone", | 44 | "VehicleAreaZone", |
45 | "VehicleDisplay", | 45 | "VehicleDisplay", |
46 | "VehicleDrivingStatus", | ||
47 | "VehicleGear", | 46 | "VehicleGear", |
48 | "VehicleHvacFanDirection", | 47 | "VehicleHvacFanDirection", |
49 | "VehicleHwKeyInputAction", | 48 | "VehicleHwKeyInputAction", |
diff --git a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehiclePropertyStore.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehiclePropertyStore.h index eda94b77..0a243fe3 100644 --- a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehiclePropertyStore.h +++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehiclePropertyStore.h | |||
@@ -67,7 +67,7 @@ public: | |||
67 | 67 | ||
68 | /* Stores provided value. Returns true if value was written returns false if config for | 68 | /* Stores provided value. Returns true if value was written returns false if config for |
69 | * example wasn't registered. */ | 69 | * example wasn't registered. */ |
70 | bool writeValue(const VehiclePropValue& propValue); | 70 | bool writeValue(const VehiclePropValue& propValue, bool updateStatus); |
71 | 71 | ||
72 | void removeValue(const VehiclePropValue& propValue); | 72 | void removeValue(const VehiclePropValue& propValue); |
73 | void removeValuesForProperty(int32_t propId); | 73 | void removeValuesForProperty(int32_t propId); |
diff --git a/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp b/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp index f2aa4210..94ace455 100644 --- a/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp +++ b/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp | |||
@@ -41,7 +41,8 @@ void VehiclePropertyStore::registerProperty(const VehiclePropConfig& config, | |||
41 | mConfigs.insert({ config.prop, RecordConfig { config, tokenFunc } }); | 41 | mConfigs.insert({ config.prop, RecordConfig { config, tokenFunc } }); |
42 | } | 42 | } |
43 | 43 | ||
44 | bool VehiclePropertyStore::writeValue(const VehiclePropValue& propValue) { | 44 | bool VehiclePropertyStore::writeValue(const VehiclePropValue& propValue, |
45 | bool updateStatus) { | ||
45 | MuxGuard g(mLock); | 46 | MuxGuard g(mLock); |
46 | if (!mConfigs.count(propValue.prop)) return false; | 47 | if (!mConfigs.count(propValue.prop)) return false; |
47 | 48 | ||
@@ -52,7 +53,9 @@ bool VehiclePropertyStore::writeValue(const VehiclePropValue& propValue) { | |||
52 | } else { | 53 | } else { |
53 | valueToUpdate->timestamp = propValue.timestamp; | 54 | valueToUpdate->timestamp = propValue.timestamp; |
54 | valueToUpdate->value = propValue.value; | 55 | valueToUpdate->value = propValue.value; |
55 | valueToUpdate->status = propValue.status; | 56 | if (updateStatus) { |
57 | valueToUpdate->status = propValue.status; | ||
58 | } | ||
56 | } | 59 | } |
57 | return true; | 60 | return true; |
58 | } | 61 | } |
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h index e54de007..479f8af6 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h | |||
@@ -46,18 +46,35 @@ constexpr int ALL_WHEELS = | |||
46 | * | 46 | * |
47 | * It has the following format: | 47 | * It has the following format: |
48 | * | 48 | * |
49 | * int32Values[0] - command (1 - start fake data generation, 0 - stop) | 49 | * int32Values[0] - command (see FakeDataCommand below for possible values) |
50 | * int32Values[1] - VehicleProperty to which command applies | 50 | * int32Values[1] - VehicleProperty to which command applies |
51 | * | ||
52 | * For start command, additional data should be provided: | ||
53 | * int64Values[0] - periodic interval in nanoseconds | ||
54 | * floatValues[0] - initial value | ||
55 | * floatValues[1] - dispersion defines min and max range relative to initial value | ||
56 | * floatValues[2] - increment, with every timer tick the value will be incremented by this amount | ||
57 | */ | 51 | */ |
58 | const int32_t kGenerateFakeDataControllingProperty = | 52 | const int32_t kGenerateFakeDataControllingProperty = |
59 | 0x0666 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; | 53 | 0x0666 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; |
60 | 54 | ||
55 | enum class FakeDataCommand : int32_t { | ||
56 | /** Stops generating of fake data that was triggered by Start command */ | ||
57 | Stop = 0, | ||
58 | |||
59 | /** | ||
60 | * Starts fake data generation. Caller must provide additional data: | ||
61 | * int64Values[0] - periodic interval in nanoseconds | ||
62 | * floatValues[0] - initial value | ||
63 | * floatValues[1] - dispersion defines min and max range relative to initial value | ||
64 | * floatValues[2] - increment, with every timer tick the value will be incremented by this | ||
65 | * amount | ||
66 | */ | ||
67 | Start = 1, | ||
68 | |||
69 | /** | ||
70 | * Injects key press event (HAL incorporates UP/DOWN acction and triggers 2 HAL events for every | ||
71 | * key-press). Caller must provide the following data: int32Values[2] - Android key code | ||
72 | * int32Values[3] - target display (0 - for main display, 1 - for instrument cluster, see | ||
73 | * VehicleDisplay) | ||
74 | */ | ||
75 | KeyPress = 2, | ||
76 | }; | ||
77 | |||
61 | const int32_t kHvacPowerProperties[] = { | 78 | const int32_t kHvacPowerProperties[] = { |
62 | toInt(VehicleProperty::HVAC_FAN_SPEED), | 79 | toInt(VehicleProperty::HVAC_FAN_SPEED), |
63 | toInt(VehicleProperty::HVAC_FAN_DIRECTION), | 80 | toInt(VehicleProperty::HVAC_FAN_DIRECTION), |
@@ -329,14 +346,6 @@ const ConfigDeclaration kVehicleProperties[]{ | |||
329 | 346 | ||
330 | {.config = | 347 | {.config = |
331 | { | 348 | { |
332 | .prop = toInt(VehicleProperty::DRIVING_STATUS), | ||
333 | .access = VehiclePropertyAccess::READ, | ||
334 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, | ||
335 | }, | ||
336 | .initialValue = {.int32Values = {toInt(VehicleDrivingStatus::UNRESTRICTED)}}}, | ||
337 | |||
338 | {.config = | ||
339 | { | ||
340 | .prop = toInt(VehicleProperty::GEAR_SELECTION), | 349 | .prop = toInt(VehicleProperty::GEAR_SELECTION), |
341 | .access = VehiclePropertyAccess::READ, | 350 | .access = VehiclePropertyAccess::READ, |
342 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, | 351 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, |
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp index dc34a50a..3979ac21 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp | |||
@@ -85,11 +85,6 @@ static std::unique_ptr<Obd2SensorStore> fillDefaultObd2Frame(size_t numVendorInt | |||
85 | return sensorStore; | 85 | return sensorStore; |
86 | } | 86 | } |
87 | 87 | ||
88 | enum class FakeDataCommand : int32_t { | ||
89 | Stop = 0, | ||
90 | Start = 1, | ||
91 | }; | ||
92 | |||
93 | EmulatedVehicleHal::EmulatedVehicleHal(VehiclePropertyStore* propStore) | 88 | EmulatedVehicleHal::EmulatedVehicleHal(VehiclePropertyStore* propStore) |
94 | : mPropStore(propStore), | 89 | : mPropStore(propStore), |
95 | mHvacPowerProps(std::begin(kHvacPowerProperties), std::end(kHvacPowerProperties)), | 90 | mHvacPowerProps(std::begin(kHvacPowerProperties), std::end(kHvacPowerProperties)), |
@@ -132,6 +127,8 @@ VehicleHal::VehiclePropValuePtr EmulatedVehicleHal::get( | |||
132 | } | 127 | } |
133 | 128 | ||
134 | StatusCode EmulatedVehicleHal::set(const VehiclePropValue& propValue) { | 129 | StatusCode EmulatedVehicleHal::set(const VehiclePropValue& propValue) { |
130 | static constexpr bool shouldUpdateStatus = false; | ||
131 | |||
135 | if (propValue.prop == kGenerateFakeDataControllingProperty) { | 132 | if (propValue.prop == kGenerateFakeDataControllingProperty) { |
136 | StatusCode status = handleGenerateFakeDataRequest(propValue); | 133 | StatusCode status = handleGenerateFakeDataRequest(propValue); |
137 | if (status != StatusCode::OK) { | 134 | if (status != StatusCode::OK) { |
@@ -182,7 +179,7 @@ StatusCode EmulatedVehicleHal::set(const VehiclePropValue& propValue) { | |||
182 | return StatusCode::NOT_AVAILABLE; | 179 | return StatusCode::NOT_AVAILABLE; |
183 | } | 180 | } |
184 | 181 | ||
185 | if (!mPropStore->writeValue(propValue)) { | 182 | if (!mPropStore->writeValue(propValue, shouldUpdateStatus)) { |
186 | return StatusCode::INVALID_ARG; | 183 | return StatusCode::INVALID_ARG; |
187 | } | 184 | } |
188 | 185 | ||
@@ -204,6 +201,8 @@ static bool isDiagnosticProperty(VehiclePropConfig propConfig) { | |||
204 | 201 | ||
205 | // Parse supported properties list and generate vector of property values to hold current values. | 202 | // Parse supported properties list and generate vector of property values to hold current values. |
206 | void EmulatedVehicleHal::onCreate() { | 203 | void EmulatedVehicleHal::onCreate() { |
204 | static constexpr bool shouldUpdateStatus = true; | ||
205 | |||
207 | for (auto& it : kVehicleProperties) { | 206 | for (auto& it : kVehicleProperties) { |
208 | VehiclePropConfig cfg = it.config; | 207 | VehiclePropConfig cfg = it.config; |
209 | int32_t numAreas = cfg.areaConfigs.size(); | 208 | int32_t numAreas = cfg.areaConfigs.size(); |
@@ -245,7 +244,7 @@ void EmulatedVehicleHal::onCreate() { | |||
245 | } else { | 244 | } else { |
246 | prop.value = it.initialValue; | 245 | prop.value = it.initialValue; |
247 | } | 246 | } |
248 | mPropStore->writeValue(prop); | 247 | mPropStore->writeValue(prop, shouldUpdateStatus); |
249 | } | 248 | } |
250 | } | 249 | } |
251 | initObd2LiveFrame(*mPropStore->getConfigOrDie(OBD2_LIVE_FRAME)); | 250 | initObd2LiveFrame(*mPropStore->getConfigOrDie(OBD2_LIVE_FRAME)); |
@@ -305,6 +304,8 @@ bool EmulatedVehicleHal::isContinuousProperty(int32_t propId) const { | |||
305 | } | 304 | } |
306 | 305 | ||
307 | bool EmulatedVehicleHal::setPropertyFromVehicle(const VehiclePropValue& propValue) { | 306 | bool EmulatedVehicleHal::setPropertyFromVehicle(const VehiclePropValue& propValue) { |
307 | static constexpr bool shouldUpdateStatus = true; | ||
308 | |||
308 | if (propValue.prop == kGenerateFakeDataControllingProperty) { | 309 | if (propValue.prop == kGenerateFakeDataControllingProperty) { |
309 | StatusCode status = handleGenerateFakeDataRequest(propValue); | 310 | StatusCode status = handleGenerateFakeDataRequest(propValue); |
310 | if (status != StatusCode::OK) { | 311 | if (status != StatusCode::OK) { |
@@ -312,7 +313,7 @@ bool EmulatedVehicleHal::setPropertyFromVehicle(const VehiclePropValue& propValu | |||
312 | } | 313 | } |
313 | } | 314 | } |
314 | 315 | ||
315 | if (mPropStore->writeValue(propValue)) { | 316 | if (mPropStore->writeValue(propValue, shouldUpdateStatus)) { |
316 | doHalEvent(getValuePool()->obtain(propValue)); | 317 | doHalEvent(getValuePool()->obtain(propValue)); |
317 | return true; | 318 | return true; |
318 | } else { | 319 | } else { |
@@ -360,10 +361,20 @@ StatusCode EmulatedVehicleHal::handleGenerateFakeDataRequest(const VehiclePropVa | |||
360 | break; | 361 | break; |
361 | } | 362 | } |
362 | case FakeDataCommand::Stop: { | 363 | case FakeDataCommand::Stop: { |
363 | ALOGI("%s, FakeDataCommandStop", __func__); | 364 | ALOGI("%s, FakeDataCommand::Stop", __func__); |
364 | mFakeValueGenerator.stopGeneratingHalEvents(propId); | 365 | mFakeValueGenerator.stopGeneratingHalEvents(propId); |
365 | break; | 366 | break; |
366 | } | 367 | } |
368 | case FakeDataCommand::KeyPress: { | ||
369 | ALOGI("%s, FakeDataCommand::KeyPress", __func__); | ||
370 | int32_t keyCode = request.value.int32Values[2]; | ||
371 | int32_t display = request.value.int32Values[3]; | ||
372 | doHalEvent( | ||
373 | createHwInputKeyProp(VehicleHwKeyInputAction::ACTION_DOWN, keyCode, display)); | ||
374 | doHalEvent(createHwInputKeyProp(VehicleHwKeyInputAction::ACTION_UP, keyCode, display)); | ||
375 | break; | ||
376 | } | ||
377 | |||
367 | default: { | 378 | default: { |
368 | ALOGE("%s: unexpected command: %d", __func__, command); | 379 | ALOGE("%s: unexpected command: %d", __func__, command); |
369 | return StatusCode::INVALID_ARG; | 380 | return StatusCode::INVALID_ARG; |
@@ -372,7 +383,22 @@ StatusCode EmulatedVehicleHal::handleGenerateFakeDataRequest(const VehiclePropVa | |||
372 | return StatusCode::OK; | 383 | return StatusCode::OK; |
373 | } | 384 | } |
374 | 385 | ||
386 | VehicleHal::VehiclePropValuePtr EmulatedVehicleHal::createHwInputKeyProp( | ||
387 | VehicleHwKeyInputAction action, int32_t keyCode, int32_t targetDisplay) { | ||
388 | auto keyEvent = getValuePool()->obtain(VehiclePropertyType::INT32_VEC, 3); | ||
389 | keyEvent->prop = toInt(VehicleProperty::HW_KEY_INPUT); | ||
390 | keyEvent->areaId = 0; | ||
391 | keyEvent->timestamp = elapsedRealtimeNano(); | ||
392 | keyEvent->status = VehiclePropertyStatus::AVAILABLE; | ||
393 | keyEvent->value.int32Values[0] = toInt(action); | ||
394 | keyEvent->value.int32Values[1] = keyCode; | ||
395 | keyEvent->value.int32Values[2] = targetDisplay; | ||
396 | return keyEvent; | ||
397 | } | ||
398 | |||
375 | void EmulatedVehicleHal::onFakeValueGenerated(int32_t propId, float value) { | 399 | void EmulatedVehicleHal::onFakeValueGenerated(int32_t propId, float value) { |
400 | static constexpr bool shouldUpdateStatus = false; | ||
401 | |||
376 | VehiclePropValuePtr updatedPropValue {}; | 402 | VehiclePropValuePtr updatedPropValue {}; |
377 | switch (getPropType(propId)) { | 403 | switch (getPropType(propId)) { |
378 | case VehiclePropertyType::FLOAT: | 404 | case VehiclePropertyType::FLOAT: |
@@ -392,7 +418,7 @@ void EmulatedVehicleHal::onFakeValueGenerated(int32_t propId, float value) { | |||
392 | updatedPropValue->areaId = 0; // Add area support if necessary. | 418 | updatedPropValue->areaId = 0; // Add area support if necessary. |
393 | updatedPropValue->timestamp = elapsedRealtimeNano(); | 419 | updatedPropValue->timestamp = elapsedRealtimeNano(); |
394 | updatedPropValue->status = VehiclePropertyStatus::AVAILABLE; | 420 | updatedPropValue->status = VehiclePropertyStatus::AVAILABLE; |
395 | mPropStore->writeValue(*updatedPropValue); | 421 | mPropStore->writeValue(*updatedPropValue, shouldUpdateStatus); |
396 | auto changeMode = mPropStore->getConfigOrDie(propId)->changeMode; | 422 | auto changeMode = mPropStore->getConfigOrDie(propId)->changeMode; |
397 | if (VehiclePropertyChangeMode::ON_CHANGE == changeMode) { | 423 | if (VehiclePropertyChangeMode::ON_CHANGE == changeMode) { |
398 | doHalEvent(move(updatedPropValue)); | 424 | doHalEvent(move(updatedPropValue)); |
@@ -421,16 +447,20 @@ void EmulatedVehicleHal::initStaticConfig() { | |||
421 | } | 447 | } |
422 | 448 | ||
423 | void EmulatedVehicleHal::initObd2LiveFrame(const VehiclePropConfig& propConfig) { | 449 | void EmulatedVehicleHal::initObd2LiveFrame(const VehiclePropConfig& propConfig) { |
450 | static constexpr bool shouldUpdateStatus = true; | ||
451 | |||
424 | auto liveObd2Frame = createVehiclePropValue(VehiclePropertyType::MIXED, 0); | 452 | auto liveObd2Frame = createVehiclePropValue(VehiclePropertyType::MIXED, 0); |
425 | auto sensorStore = fillDefaultObd2Frame(static_cast<size_t>(propConfig.configArray[0]), | 453 | auto sensorStore = fillDefaultObd2Frame(static_cast<size_t>(propConfig.configArray[0]), |
426 | static_cast<size_t>(propConfig.configArray[1])); | 454 | static_cast<size_t>(propConfig.configArray[1])); |
427 | sensorStore->fillPropValue("", liveObd2Frame.get()); | 455 | sensorStore->fillPropValue("", liveObd2Frame.get()); |
428 | liveObd2Frame->prop = OBD2_LIVE_FRAME; | 456 | liveObd2Frame->prop = OBD2_LIVE_FRAME; |
429 | 457 | ||
430 | mPropStore->writeValue(*liveObd2Frame); | 458 | mPropStore->writeValue(*liveObd2Frame, shouldUpdateStatus); |
431 | } | 459 | } |
432 | 460 | ||
433 | void EmulatedVehicleHal::initObd2FreezeFrame(const VehiclePropConfig& propConfig) { | 461 | void EmulatedVehicleHal::initObd2FreezeFrame(const VehiclePropConfig& propConfig) { |
462 | static constexpr bool shouldUpdateStatus = true; | ||
463 | |||
434 | auto sensorStore = fillDefaultObd2Frame(static_cast<size_t>(propConfig.configArray[0]), | 464 | auto sensorStore = fillDefaultObd2Frame(static_cast<size_t>(propConfig.configArray[0]), |
435 | static_cast<size_t>(propConfig.configArray[1])); | 465 | static_cast<size_t>(propConfig.configArray[1])); |
436 | 466 | ||
@@ -442,7 +472,7 @@ void EmulatedVehicleHal::initObd2FreezeFrame(const VehiclePropConfig& propConfig | |||
442 | sensorStore->fillPropValue(dtc, freezeFrame.get()); | 472 | sensorStore->fillPropValue(dtc, freezeFrame.get()); |
443 | freezeFrame->prop = OBD2_FREEZE_FRAME; | 473 | freezeFrame->prop = OBD2_FREEZE_FRAME; |
444 | 474 | ||
445 | mPropStore->writeValue(*freezeFrame); | 475 | mPropStore->writeValue(*freezeFrame, shouldUpdateStatus); |
446 | } | 476 | } |
447 | } | 477 | } |
448 | 478 | ||
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h index 62fc1262..d291dbad 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h | |||
@@ -67,6 +67,8 @@ private: | |||
67 | 67 | ||
68 | StatusCode handleGenerateFakeDataRequest(const VehiclePropValue& request); | 68 | StatusCode handleGenerateFakeDataRequest(const VehiclePropValue& request); |
69 | void onFakeValueGenerated(int32_t propId, float value); | 69 | void onFakeValueGenerated(int32_t propId, float value); |
70 | VehiclePropValuePtr createHwInputKeyProp(VehicleHwKeyInputAction action, int32_t keyCode, | ||
71 | int32_t targetDisplay); | ||
70 | 72 | ||
71 | void onContinuousPropertyTimer(const std::vector<int32_t>& properties); | 73 | void onContinuousPropertyTimer(const std::vector<int32_t>& properties); |
72 | bool isContinuousProperty(int32_t propId) const; | 74 | bool isContinuousProperty(int32_t propId) const; |
diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal index 87daedc9..93a903f7 100644 --- a/automotive/vehicle/2.0/types.hal +++ b/automotive/vehicle/2.0/types.hal | |||
@@ -467,19 +467,6 @@ enum VehicleProperty: int32_t { | |||
467 | | VehicleArea:GLOBAL), | 467 | | VehicleArea:GLOBAL), |
468 | 468 | ||
469 | /** | 469 | /** |
470 | * Driving status policy. | ||
471 | * | ||
472 | * @change_mode VehiclePropertyChangeMode:ON_CHANGE | ||
473 | * @access VehiclePropertyAccess:READ | ||
474 | * @data_enum VehicleDrivingStatus | ||
475 | */ | ||
476 | DRIVING_STATUS = ( | ||
477 | 0x0404 | ||
478 | | VehiclePropertyGroup:SYSTEM | ||
479 | | VehiclePropertyType:INT32 | ||
480 | | VehicleArea:GLOBAL), | ||
481 | |||
482 | /** | ||
483 | * Warning for fuel low level. | 470 | * Warning for fuel low level. |
484 | * | 471 | * |
485 | * @change_mode VehiclePropertyChangeMode:ON_CHANGE | 472 | * @change_mode VehiclePropertyChangeMode:ON_CHANGE |
@@ -2169,20 +2156,6 @@ enum VehiclePropertyStatus : int32_t { | |||
2169 | }; | 2156 | }; |
2170 | 2157 | ||
2171 | /** | 2158 | /** |
2172 | * Car states. | ||
2173 | * | ||
2174 | * The driving states determine what features of the UI will be accessible. | ||
2175 | */ | ||
2176 | enum VehicleDrivingStatus : int32_t { | ||
2177 | UNRESTRICTED = 0x00, | ||
2178 | NO_VIDEO = 0x01, | ||
2179 | NO_KEYBOARD_INPUT = 0x02, | ||
2180 | NO_VOICE_INPUT = 0x04, | ||
2181 | NO_CONFIG = 0x08, | ||
2182 | LIMIT_MESSAGE_LEN = 0x10, | ||
2183 | }; | ||
2184 | |||
2185 | /** | ||
2186 | * Various gears which can be selected by user and chosen in system. | 2159 | * Various gears which can be selected by user and chosen in system. |
2187 | */ | 2160 | */ |
2188 | enum VehicleGear: int32_t { | 2161 | enum VehicleGear: int32_t { |
diff --git a/bluetooth/1.0/default/android.hardware.bluetooth@1.0-service.rc b/bluetooth/1.0/default/android.hardware.bluetooth@1.0-service.rc index 5a01ecc2..a6344416 100644 --- a/bluetooth/1.0/default/android.hardware.bluetooth@1.0-service.rc +++ b/bluetooth/1.0/default/android.hardware.bluetooth@1.0-service.rc | |||
@@ -1,6 +1,6 @@ | |||
1 | service vendor.bluetooth-1-0 /vendor/bin/hw/android.hardware.bluetooth@1.0-service | 1 | service vendor.bluetooth-1-0 /vendor/bin/hw/android.hardware.bluetooth@1.0-service |
2 | class hal | 2 | class hal |
3 | capabilities NET_ADMIN SYS_NICE | 3 | capabilities BLOCK_SUSPEND NET_ADMIN SYS_NICE |
4 | user bluetooth | 4 | user bluetooth |
5 | group bluetooth | 5 | group bluetooth |
6 | writepid /dev/stune/foreground/tasks | 6 | writepid /dev/stune/foreground/tasks |
diff --git a/broadcastradio/2.0/ITunerCallback.hal b/broadcastradio/2.0/ITunerCallback.hal index ede8350e..b20a0b2d 100644 --- a/broadcastradio/2.0/ITunerCallback.hal +++ b/broadcastradio/2.0/ITunerCallback.hal | |||
@@ -17,12 +17,14 @@ package android.hardware.broadcastradio@2.0; | |||
17 | 17 | ||
18 | interface ITunerCallback { | 18 | interface ITunerCallback { |
19 | /** | 19 | /** |
20 | * Method called by the HAL when a tuning operation fails | 20 | * Method called by the HAL when a tuning operation fails asynchronously |
21 | * following a step(), scan() or tune() command. | 21 | * following a step(), scan() or tune() command. |
22 | * | 22 | * |
23 | * @param result OK if tune succeeded; | 23 | * This callback is only called when the step(), scan() or tune() command |
24 | * TIMEOUT in case of time out. | 24 | * returned OK at first. |
25 | * @param selector A ProgramSelector structure passed from tune(), | 25 | * |
26 | * @param result TIMEOUT in case of time out. | ||
27 | * @param selector A ProgramSelector structure passed from tune() call; | ||
26 | * empty for step() and scan(). | 28 | * empty for step() and scan(). |
27 | */ | 29 | */ |
28 | oneway onTuneFailed(Result result, ProgramSelector selector); | 30 | oneway onTuneFailed(Result result, ProgramSelector selector); |
diff --git a/broadcastradio/2.0/types.hal b/broadcastradio/2.0/types.hal index a9b96009..1ce61dfe 100644 --- a/broadcastradio/2.0/types.hal +++ b/broadcastradio/2.0/types.hal | |||
@@ -351,10 +351,16 @@ struct ProgramInfo { | |||
351 | * related content (i.e. DAB soft-links). This field is a list of pointers | 351 | * related content (i.e. DAB soft-links). This field is a list of pointers |
352 | * to other programs on the program list. | 352 | * to other programs on the program list. |
353 | * | 353 | * |
354 | * Please note, that these identifiers does not have to exist on the program | 354 | * This is not a list of programs that carry the same content (i.e. |
355 | * DAB hard-links, RDS AF). Switching to programs from this list usually | ||
356 | * require user action. | ||
357 | * | ||
358 | * Please note, that these identifiers do not have to exist on the program | ||
355 | * list - i.e. DAB tuner may provide information on FM RDS alternatives | 359 | * list - i.e. DAB tuner may provide information on FM RDS alternatives |
356 | * despite not supporting FM RDS. If the system has multiple tuners, another | 360 | * despite not supporting FM RDS. If the system has multiple tuners, another |
357 | * one may have it on its list. | 361 | * one may have it on its list. |
362 | * | ||
363 | * This field is optional (can be empty). | ||
358 | */ | 364 | */ |
359 | vec<ProgramIdentifier> relatedContent; | 365 | vec<ProgramIdentifier> relatedContent; |
360 | 366 | ||
diff --git a/compatibility_matrices/Android.mk b/compatibility_matrices/Android.mk index a10d808d..23be7de2 100644 --- a/compatibility_matrices/Android.mk +++ b/compatibility_matrices/Android.mk | |||
@@ -21,8 +21,9 @@ BUILD_FRAMEWORK_COMPATIBILITY_MATRIX := $(LOCAL_PATH)/compatibility_matrix.mk | |||
21 | # Clear potential input variables to BUILD_FRAMEWORK_COMPATIBILITY_MATRIX | 21 | # Clear potential input variables to BUILD_FRAMEWORK_COMPATIBILITY_MATRIX |
22 | LOCAL_ADD_VBMETA_VERSION := | 22 | LOCAL_ADD_VBMETA_VERSION := |
23 | LOCAL_ASSEMBLE_VINTF_ENV_VARS := | 23 | LOCAL_ASSEMBLE_VINTF_ENV_VARS := |
24 | LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE := | ||
25 | LOCAL_ASSEMBLE_VINTF_ERROR_MESSAGE := | ||
24 | LOCAL_ASSEMBLE_VINTF_FLAGS := | 26 | LOCAL_ASSEMBLE_VINTF_FLAGS := |
25 | LOCAL_WARN_REQUIRED_HALS := | ||
26 | LOCAL_KERNEL_VERSIONS := | 27 | LOCAL_KERNEL_VERSIONS := |
27 | LOCAL_GEN_FILE_DEPENDENCIES := | 28 | LOCAL_GEN_FILE_DEPENDENCIES := |
28 | 29 | ||
@@ -30,18 +31,21 @@ LOCAL_GEN_FILE_DEPENDENCIES := | |||
30 | 31 | ||
31 | 32 | ||
32 | include $(CLEAR_VARS) | 33 | include $(CLEAR_VARS) |
34 | LOCAL_MODULE := framework_compatibility_matrix.legacy.xml | ||
33 | LOCAL_MODULE_STEM := compatibility_matrix.legacy.xml | 35 | LOCAL_MODULE_STEM := compatibility_matrix.legacy.xml |
34 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) | 36 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
35 | LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0 | 37 | LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0 |
36 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) | 38 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
37 | 39 | ||
38 | include $(CLEAR_VARS) | 40 | include $(CLEAR_VARS) |
41 | LOCAL_MODULE := framework_compatibility_matrix.1.xml | ||
39 | LOCAL_MODULE_STEM := compatibility_matrix.1.xml | 42 | LOCAL_MODULE_STEM := compatibility_matrix.1.xml |
40 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) | 43 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
41 | LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0 | 44 | LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0 |
42 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) | 45 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
43 | 46 | ||
44 | include $(CLEAR_VARS) | 47 | include $(CLEAR_VARS) |
48 | LOCAL_MODULE := framework_compatibility_matrix.2.xml | ||
45 | LOCAL_MODULE_STEM := compatibility_matrix.2.xml | 49 | LOCAL_MODULE_STEM := compatibility_matrix.2.xml |
46 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) | 50 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
47 | LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0 | 51 | LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0 |
@@ -50,6 +54,7 @@ include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) | |||
50 | # TODO(b/72409164): STOPSHIP: update kernel version requirements | 54 | # TODO(b/72409164): STOPSHIP: update kernel version requirements |
51 | 55 | ||
52 | include $(CLEAR_VARS) | 56 | include $(CLEAR_VARS) |
57 | LOCAL_MODULE := framework_compatibility_matrix.current.xml | ||
53 | LOCAL_MODULE_STEM := compatibility_matrix.current.xml | 58 | LOCAL_MODULE_STEM := compatibility_matrix.current.xml |
54 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) | 59 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
55 | LOCAL_KERNEL_VERSIONS := 4.4.0 4.9.0 | 60 | LOCAL_KERNEL_VERSIONS := 4.4.0 4.9.0 |
@@ -58,9 +63,9 @@ include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) | |||
58 | # Framework Compatibility Matrix (common to all FCM versions) | 63 | # Framework Compatibility Matrix (common to all FCM versions) |
59 | 64 | ||
60 | include $(CLEAR_VARS) | 65 | include $(CLEAR_VARS) |
61 | LOCAL_MODULE_STEM := compatibility_matrix.device.xml | ||
62 | # define LOCAL_MODULE and LOCAL_MODULE_CLASS for local-generated-sources-dir. | ||
63 | LOCAL_MODULE := framework_compatibility_matrix.device.xml | 66 | LOCAL_MODULE := framework_compatibility_matrix.device.xml |
67 | LOCAL_MODULE_STEM := compatibility_matrix.device.xml | ||
68 | # define LOCAL_MODULE_CLASS for local-generated-sources-dir. | ||
64 | LOCAL_MODULE_CLASS := ETC | 69 | LOCAL_MODULE_CLASS := ETC |
65 | 70 | ||
66 | ifndef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE | 71 | ifndef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE |
@@ -78,7 +83,7 @@ my_gen_check_manifest := $(local-generated-sources-dir)/manifest.check.xml | |||
78 | $(my_gen_check_manifest): PRIVATE_SRC_FILE := $(my_manifest_src_file) | 83 | $(my_gen_check_manifest): PRIVATE_SRC_FILE := $(my_manifest_src_file) |
79 | $(my_gen_check_manifest): $(my_manifest_src_file) $(HOST_OUT_EXECUTABLES)/assemble_vintf | 84 | $(my_gen_check_manifest): $(my_manifest_src_file) $(HOST_OUT_EXECUTABLES)/assemble_vintf |
80 | BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) \ | 85 | BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) \ |
81 | IGNORE_TARGET_FCM_VERSION=true \ | 86 | VINTF_IGNORE_TARGET_FCM_VERSION=true \ |
82 | $(HOST_OUT_EXECUTABLES)/assemble_vintf -i $(PRIVATE_SRC_FILE) -o $@ | 87 | $(HOST_OUT_EXECUTABLES)/assemble_vintf -i $(PRIVATE_SRC_FILE) -o $@ |
83 | 88 | ||
84 | LOCAL_GEN_FILE_DEPENDENCIES += $(my_gen_check_manifest) | 89 | LOCAL_GEN_FILE_DEPENDENCIES += $(my_gen_check_manifest) |
@@ -95,7 +100,8 @@ LOCAL_ASSEMBLE_VINTF_ENV_VARS := \ | |||
95 | PLATFORM_SEPOLICY_VERSION \ | 100 | PLATFORM_SEPOLICY_VERSION \ |
96 | PLATFORM_SEPOLICY_COMPAT_VERSIONS | 101 | PLATFORM_SEPOLICY_COMPAT_VERSIONS |
97 | 102 | ||
98 | LOCAL_WARN_REQUIRED_HALS := \ | 103 | LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE := PRODUCT_ENFORCE_VINTF_MANIFEST=true |
104 | LOCAL_ASSEMBLE_VINTF_ERROR_MESSAGE := \ | ||
99 | "Error: DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX cannot contain required HALs." | 105 | "Error: DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX cannot contain required HALs." |
100 | 106 | ||
101 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) | 107 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
@@ -121,6 +127,14 @@ endif | |||
121 | 127 | ||
122 | LOCAL_ASSEMBLE_VINTF_ENV_VARS := PRODUCT_ENFORCE_VINTF_MANIFEST | 128 | LOCAL_ASSEMBLE_VINTF_ENV_VARS := PRODUCT_ENFORCE_VINTF_MANIFEST |
123 | 129 | ||
130 | # TODO(b/65028233): Enforce no "unused HALs" for devices that does not define | ||
131 | # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE as well | ||
132 | ifeq (true,$(strip $(PRODUCT_ENFORCE_VINTF_MANIFEST))) | ||
133 | ifdef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE | ||
134 | LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE := VINTF_ENFORCE_NO_UNUSED_HALS=true | ||
135 | endif | ||
136 | endif | ||
137 | |||
124 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) | 138 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
125 | BUILT_SYSTEM_COMPATIBILITY_MATRIX := $(LOCAL_BUILT_MODULE) | 139 | BUILT_SYSTEM_COMPATIBILITY_MATRIX := $(LOCAL_BUILT_MODULE) |
126 | 140 | ||
diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 486c548e..467e11ee 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml | |||
@@ -56,6 +56,14 @@ | |||
56 | </interface> | 56 | </interface> |
57 | </hal> | 57 | </hal> |
58 | <hal format="hidl" optional="true"> | 58 | <hal format="hidl" optional="true"> |
59 | <name>android.hardware.bluetooth.a2dp</name> | ||
60 | <version>1.0</version> | ||
61 | <interface> | ||
62 | <name>IBluetoothAudioOffload</name> | ||
63 | <instance>default</instance> | ||
64 | </interface> | ||
65 | </hal> | ||
66 | <hal format="hidl" optional="true"> | ||
59 | <name>android.hardware.boot</name> | 67 | <name>android.hardware.boot</name> |
60 | <version>1.0</version> | 68 | <version>1.0</version> |
61 | <interface> | 69 | <interface> |
@@ -145,7 +153,7 @@ | |||
145 | </hal> | 153 | </hal> |
146 | <hal format="hidl" optional="true"> | 154 | <hal format="hidl" optional="true"> |
147 | <name>android.hardware.gnss</name> | 155 | <name>android.hardware.gnss</name> |
148 | <version>1.0</version> | 156 | <version>1.0-1</version> |
149 | <interface> | 157 | <interface> |
150 | <name>IGnss</name> | 158 | <name>IGnss</name> |
151 | <instance>default</instance> | 159 | <instance>default</instance> |
@@ -242,7 +250,7 @@ | |||
242 | </hal> | 250 | </hal> |
243 | <hal format="hidl" optional="true"> | 251 | <hal format="hidl" optional="true"> |
244 | <name>android.hardware.nfc</name> | 252 | <name>android.hardware.nfc</name> |
245 | <version>1.0</version> | 253 | <version>1.0-1</version> |
246 | <interface> | 254 | <interface> |
247 | <name>INfc</name> | 255 | <name>INfc</name> |
248 | <instance>default</instance> | 256 | <instance>default</instance> |
@@ -266,14 +274,16 @@ | |||
266 | </hal> | 274 | </hal> |
267 | <hal format="hidl" optional="true"> | 275 | <hal format="hidl" optional="true"> |
268 | <name>android.hardware.radio</name> | 276 | <name>android.hardware.radio</name> |
269 | <version>1.0-1</version> | 277 | <version>1.0-2</version> |
270 | <interface> | 278 | <interface> |
271 | <name>IRadio</name> | 279 | <name>IRadio</name> |
272 | <regex-instance>slot[0-9]+</regex-instance> | 280 | <instance>slot1</instance> |
281 | <instance>slot2</instance> | ||
282 | <instance>slot3</instance> | ||
273 | </interface> | 283 | </interface> |
274 | <interface> | 284 | <interface> |
275 | <name>ISap</name> | 285 | <name>ISap</name> |
276 | <regex-instance>slot[0-9]+</regex-instance> | 286 | <instance>slot1</instance> |
277 | </interface> | 287 | </interface> |
278 | </hal> | 288 | </hal> |
279 | <hal format="hidl" optional="true"> | 289 | <hal format="hidl" optional="true"> |
@@ -289,7 +299,8 @@ | |||
289 | <version>1.0</version> | 299 | <version>1.0</version> |
290 | <interface> | 300 | <interface> |
291 | <name>ISecureElement</name> | 301 | <name>ISecureElement</name> |
292 | <instance>eSE1</instance> | 302 | <regex-instance>eSE[1-9][0-9]*</regex-instance> |
303 | <regex-instance>SIM[1-9][0-9]*</regex-instance> | ||
293 | </interface> | 304 | </interface> |
294 | </hal> | 305 | </hal> |
295 | <hal format="hidl" optional="true"> | 306 | <hal format="hidl" optional="true"> |
diff --git a/compatibility_matrices/compatibility_matrix.mk b/compatibility_matrices/compatibility_matrix.mk index abc67965..6dc2b4fb 100644 --- a/compatibility_matrices/compatibility_matrix.mk +++ b/compatibility_matrices/compatibility_matrix.mk | |||
@@ -25,12 +25,33 @@ endef | |||
25 | 25 | ||
26 | # $(warning $(call remove-minor-revision,3.18.0)) | 26 | # $(warning $(call remove-minor-revision,3.18.0)) |
27 | 27 | ||
28 | ifndef LOCAL_MODULE_STEM | 28 | ##### Input Variables: |
29 | $(error LOCAL_MODULE_STEM must be defined.) | 29 | # LOCAL_MODULE: required. Module name for the build system. |
30 | endif | 30 | # LOCAL_MODULE_CLASS: optional. Default is ETC. |
31 | # LOCAL_MODULE_PATH: optional. Path of output file. Default is $(TARGET_OUT)/etc/vintf. | ||
32 | # LOCAL_MODULE_STEM: optional. Name of output file. Default is $(LOCAL_MODULE). | ||
33 | # LOCAL_SRC_FILES: required. Local source files provided to assemble_vintf | ||
34 | # (command line argument -i). | ||
35 | # LOCAL_GENERATED_SOURCES: optional. Global source files provided to assemble_vintf | ||
36 | # (command line argument -i). | ||
37 | # | ||
38 | # LOCAL_ADD_VBMETA_VERSION: Use AVBTOOL to add avb version to the output matrix | ||
39 | # (corresponds to <avb><vbmeta-version> tag) | ||
40 | # LOCAL_ASSEMBLE_VINTF_ENV_VARS: Add a list of environment variable names from global variables in | ||
41 | # the build system that is lazily evaluated (e.g. PRODUCT_ENFORCE_VINTF_MANIFEST). | ||
42 | # LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE: Add a list of environment variables that is local to | ||
43 | # assemble_vintf invocation. Format is "VINTF_ENFORCE_NO_UNUSED_HALS=true". | ||
44 | # LOCAL_ASSEMBLE_VINTF_FLAGS: Add additional command line arguments to assemble_vintf invocation. | ||
45 | # LOCAL_KERNEL_VERSIONS: Parse kernel configurations and add to the output matrix | ||
46 | # (corresponds to <kernel> tags.) | ||
47 | # LOCAL_GEN_FILE_DEPENDENCIES: A list of additional dependencies for the generated file. | ||
31 | 48 | ||
32 | ifndef LOCAL_MODULE | 49 | ifndef LOCAL_MODULE |
33 | LOCAL_MODULE := framework_$(LOCAL_MODULE_STEM) | 50 | $(error LOCAL_MODULE must be defined.) |
51 | endif | ||
52 | |||
53 | ifndef LOCAL_MODULE_STEM | ||
54 | LOCAL_MODULE_STEM := $(LOCAL_MODULE) | ||
34 | endif | 55 | endif |
35 | 56 | ||
36 | ifndef LOCAL_MODULE_CLASS | 57 | ifndef LOCAL_MODULE_CLASS |
@@ -81,13 +102,17 @@ my_matrix_src_files := \ | |||
81 | $(addprefix $(LOCAL_PATH)/,$(LOCAL_SRC_FILES)) \ | 102 | $(addprefix $(LOCAL_PATH)/,$(LOCAL_SRC_FILES)) \ |
82 | $(LOCAL_GENERATED_SOURCES) | 103 | $(LOCAL_GENERATED_SOURCES) |
83 | 104 | ||
84 | ifneq (,$(strip $(LOCAL_WARN_REQUIRED_HALS))) | 105 | $(GEN): PRIVATE_ADDITIONAL_ENV_VARS := $(LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE) |
85 | $(GEN): PRIVATE_ADDITIONAL_ENV_VARS += PRODUCT_ENFORCE_VINTF_MANIFEST=true | 106 | |
86 | $(GEN): PRIVATE_COMMAND_TAIL := || (echo $(strip $(LOCAL_WARN_REQUIRED_HALS)) && false) | 107 | ifneq (,$(strip $(LOCAL_ASSEMBLE_VINTF_ERROR_MESSAGE))) |
108 | $(GEN): PRIVATE_COMMAND_TAIL := || (echo $(strip $(LOCAL_ASSEMBLE_VINTF_ERROR_MESSAGE)) && false) | ||
87 | endif | 109 | endif |
88 | 110 | ||
89 | $(GEN): PRIVATE_SRC_FILES := $(my_matrix_src_files) | 111 | $(GEN): PRIVATE_SRC_FILES := $(my_matrix_src_files) |
90 | $(GEN): $(my_matrix_src_files) $(HOST_OUT_EXECUTABLES)/assemble_vintf | 112 | $(GEN): $(my_matrix_src_files) $(HOST_OUT_EXECUTABLES)/assemble_vintf |
113 | $(foreach varname,$(PRIVATE_ENV_VARS),\ | ||
114 | $(if $(findstring $(varname),$(PRIVATE_ADDITIONAL_ENV_VARS)),\ | ||
115 | $(error $(varname) should not be overridden by LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE.))) | ||
91 | $(foreach varname,$(PRIVATE_ENV_VARS),$(varname)="$($(varname))") \ | 116 | $(foreach varname,$(PRIVATE_ENV_VARS),$(varname)="$($(varname))") \ |
92 | $(PRIVATE_ADDITIONAL_ENV_VARS) \ | 117 | $(PRIVATE_ADDITIONAL_ENV_VARS) \ |
93 | $(HOST_OUT_EXECUTABLES)/assemble_vintf \ | 118 | $(HOST_OUT_EXECUTABLES)/assemble_vintf \ |
@@ -101,8 +126,9 @@ LOCAL_GENERATED_SOURCES := | |||
101 | 126 | ||
102 | LOCAL_ADD_VBMETA_VERSION := | 127 | LOCAL_ADD_VBMETA_VERSION := |
103 | LOCAL_ASSEMBLE_VINTF_ENV_VARS := | 128 | LOCAL_ASSEMBLE_VINTF_ENV_VARS := |
129 | LOCAL_ASSEMBLE_VINTF_ENV_VARS_OVERRIDE := | ||
130 | LOCAL_ASSEMBLE_VINTF_ERROR_MESSAGE := | ||
104 | LOCAL_ASSEMBLE_VINTF_FLAGS := | 131 | LOCAL_ASSEMBLE_VINTF_FLAGS := |
105 | LOCAL_WARN_REQUIRED_HALS := | ||
106 | LOCAL_KERNEL_VERSIONS := | 132 | LOCAL_KERNEL_VERSIONS := |
107 | LOCAL_GEN_FILE_DEPENDENCIES := | 133 | LOCAL_GEN_FILE_DEPENDENCIES := |
108 | my_matrix_src_files := | 134 | my_matrix_src_files := |
diff --git a/current.txt b/current.txt index dbe462fd..06c94d93 100644 --- a/current.txt +++ b/current.txt | |||
@@ -250,12 +250,15 @@ f4945e397b5dea41bb64518dfde59be71245d8a125fd1e0acffeb57ac7b08fed android.hardwar | |||
250 | c8bc853546dd55584611def2a9fa1d99f657e3366c976d2f60fe6b8aa6d2cb87 android.hardware.thermal@1.1::IThermalCallback | 250 | c8bc853546dd55584611def2a9fa1d99f657e3366c976d2f60fe6b8aa6d2cb87 android.hardware.thermal@1.1::IThermalCallback |
251 | 251 | ||
252 | # ABI preserving changes to HALs during Android P | 252 | # ABI preserving changes to HALs during Android P |
253 | eaeb3e4f3237430a7fdc206bffdf844713f5682990b2d49ea24392e15b5d343f android.hardware.broadcastradio@2.0::ITunerCallback | ||
254 | 2804120c1f8522ad15feb7695fe5eece527d399b406c671ea99618194118c316 android.hardware.broadcastradio@2.0::types | ||
253 | cf72ff5a52bfa4d08e9e1000cf3ab5952a2d280c7f13cdad5ab7905c08050766 android.hardware.camera.metadata@3.2::types | 255 | cf72ff5a52bfa4d08e9e1000cf3ab5952a2d280c7f13cdad5ab7905c08050766 android.hardware.camera.metadata@3.2::types |
254 | 3902efc42097cba55f0655aa389e052ea70164e99ced1a6d1ef53dafc13f7650 android.hardware.camera.provider@2.4::ICameraProvider | 256 | 3902efc42097cba55f0655aa389e052ea70164e99ced1a6d1ef53dafc13f7650 android.hardware.camera.provider@2.4::ICameraProvider |
255 | 6fa9804a17a8bb7923a56bd10493a5483c20007e4c9026fd04287bee7c945a8c android.hardware.gnss@1.0::IGnssCallback | 257 | 6fa9804a17a8bb7923a56bd10493a5483c20007e4c9026fd04287bee7c945a8c android.hardware.gnss@1.0::IGnssCallback |
256 | fb92e2b40f8e9d494e8fd3b4ac18499a3216342e7cff160714c3bbf3660b6e79 android.hardware.gnss@1.0::IGnssConfiguration | 258 | fb92e2b40f8e9d494e8fd3b4ac18499a3216342e7cff160714c3bbf3660b6e79 android.hardware.gnss@1.0::IGnssConfiguration |
257 | 251594ea9b27447bfa005ebd806e58fb0ae4aad84a69938129c9800ec0c64eda android.hardware.gnss@1.0::IGnssMeasurementCallback | 259 | 251594ea9b27447bfa005ebd806e58fb0ae4aad84a69938129c9800ec0c64eda android.hardware.gnss@1.0::IGnssMeasurementCallback |
258 | 4e7169919d24fbe5573e5bcd683d0bd7abf553a4e6c34c41f9dfc1e12050db07 android.hardware.gnss@1.0::IGnssNavigationMessageCallback | 260 | 4e7169919d24fbe5573e5bcd683d0bd7abf553a4e6c34c41f9dfc1e12050db07 android.hardware.gnss@1.0::IGnssNavigationMessageCallback |
261 | 08ae9fc24f21f809e9b8501dfbc803662fcd6a8d8e1fb71d9dd7c0c4c6f5d556 android.hardware.neuralnetworks@1.0::types | ||
259 | d4840db8efabdf1e4b344fc981cd36e5fe81a39aff6e199f6d06c1c8da413efd android.hardware.radio@1.0::types | 262 | d4840db8efabdf1e4b344fc981cd36e5fe81a39aff6e199f6d06c1c8da413efd android.hardware.radio@1.0::types |
260 | b280c4704dfcc548a9bf127b59b7c3578f460c50cce70a06b66fe0df8b27cff0 android.hardware.wifi@1.0::types | 263 | b280c4704dfcc548a9bf127b59b7c3578f460c50cce70a06b66fe0df8b27cff0 android.hardware.wifi@1.0::types |
261 | 264 | ||
@@ -294,7 +297,7 @@ f2904a4c108ad1b93eb2fa4e43b82bd01ce1ff26156316e49d1d9fc80dfecaad android.hardwar | |||
294 | 3b17c1fdfc389e0abe626c37054954b07201127d890c2bc05d47613ec1f4de4f android.hardware.automotive.evs@1.0::types | 297 | 3b17c1fdfc389e0abe626c37054954b07201127d890c2bc05d47613ec1f4de4f android.hardware.automotive.evs@1.0::types |
295 | b3caf524c46a47d67e6453a34419e1881942d059e146cda740502670e9a752c3 android.hardware.automotive.vehicle@2.0::IVehicle | 298 | b3caf524c46a47d67e6453a34419e1881942d059e146cda740502670e9a752c3 android.hardware.automotive.vehicle@2.0::IVehicle |
296 | 80fb4156fa91ce86e49bd2cabe215078f6b69591d416a09e914532eae6712052 android.hardware.automotive.vehicle@2.0::IVehicleCallback | 299 | 80fb4156fa91ce86e49bd2cabe215078f6b69591d416a09e914532eae6712052 android.hardware.automotive.vehicle@2.0::IVehicleCallback |
297 | 4ff0dcfb938a5df283eef47de33b4e1284fab73f584cfc0c94e97317bdb7bf26 android.hardware.automotive.vehicle@2.0::types | 300 | a7ac51f419107020b9544efb25e030485e5dc4914c5138c2b8d83a1f52a76825 android.hardware.automotive.vehicle@2.0::types |
298 | 32cc50cc2a7658ec613c0c2dd2accbf6a05113b749852879e818b8b7b438db19 android.hardware.bluetooth.a2dp@1.0::IBluetoothAudioHost | 301 | 32cc50cc2a7658ec613c0c2dd2accbf6a05113b749852879e818b8b7b438db19 android.hardware.bluetooth.a2dp@1.0::IBluetoothAudioHost |
299 | ff4be64d7992f8bec97dff37f35450e79b3430c61f85f54322ce45bef229dc3b android.hardware.bluetooth.a2dp@1.0::IBluetoothAudioOffload | 302 | ff4be64d7992f8bec97dff37f35450e79b3430c61f85f54322ce45bef229dc3b android.hardware.bluetooth.a2dp@1.0::IBluetoothAudioOffload |
300 | 27f22d2e873e6201f9620cf4d8e2facb25bd0dd30a2b911e441b4600d560fa62 android.hardware.bluetooth.a2dp@1.0::types | 303 | 27f22d2e873e6201f9620cf4d8e2facb25bd0dd30a2b911e441b4600d560fa62 android.hardware.bluetooth.a2dp@1.0::types |
@@ -328,7 +331,7 @@ dd83be076b6b3f10ed62ab34d8c8b95f2415961fb785200eb842e7bfb2b0ee92 android.hardwar | |||
328 | 434c4c32c00b0e54bb05e40c79503208b40f786a318029a2a4f66e34f10f2a76 android.hardware.health@2.0::IHealthInfoCallback | 331 | 434c4c32c00b0e54bb05e40c79503208b40f786a318029a2a4f66e34f10f2a76 android.hardware.health@2.0::IHealthInfoCallback |
329 | c9e498f1ade5e26f00d290b4763a9671ec6720f915e7d592844b62e8cb1f9b5c android.hardware.health@2.0::types | 332 | c9e498f1ade5e26f00d290b4763a9671ec6720f915e7d592844b62e8cb1f9b5c android.hardware.health@2.0::types |
330 | a6cf986593c6ad15fe2ae3a1995d2cae233500bc32c055912a42723bdc076868 android.hardware.keymaster@4.0::IKeymasterDevice | 333 | a6cf986593c6ad15fe2ae3a1995d2cae233500bc32c055912a42723bdc076868 android.hardware.keymaster@4.0::IKeymasterDevice |
331 | 3ce01f7a38013f15d2ffc9c66a81eb85061ab6585fb1e659fe6da36bdcbfa9cf android.hardware.keymaster@4.0::types | 334 | e15ebdf1e0a326ff5b8a59668d4d8cd3852bd88388eae91de13f5f7e1af50ed1 android.hardware.keymaster@4.0::types |
332 | 6d5c646a83538f0f9d8438c259932509f4353410c6c76e56db0d6ca98b69c3bb android.hardware.media.bufferpool@1.0::IAccessor | 335 | 6d5c646a83538f0f9d8438c259932509f4353410c6c76e56db0d6ca98b69c3bb android.hardware.media.bufferpool@1.0::IAccessor |
333 | b8c7ed58aa8740361e63d0ce9e7c94227572a629f356958840b34809d2393a7c android.hardware.media.bufferpool@1.0::IClientManager | 336 | b8c7ed58aa8740361e63d0ce9e7c94227572a629f356958840b34809d2393a7c android.hardware.media.bufferpool@1.0::IClientManager |
334 | 4a2c0dc82780e6c90731725a103feab8ab6ecf85a64e049b9cbd2b2c61620fe1 android.hardware.media.bufferpool@1.0::IConnection | 337 | 4a2c0dc82780e6c90731725a103feab8ab6ecf85a64e049b9cbd2b2c61620fe1 android.hardware.media.bufferpool@1.0::IConnection |
@@ -342,9 +345,9 @@ e85f566698d2a2c28100e264fcf2c691a066756ddf8dd341d009ff50cfe10614 android.hardwar | |||
342 | 7899b9305587b2d5cd74a3cc87e9090f58bf4ae74256ce3ee36e7ec011822840 android.hardware.power@1.2::types | 345 | 7899b9305587b2d5cd74a3cc87e9090f58bf4ae74256ce3ee36e7ec011822840 android.hardware.power@1.2::types |
343 | ab132c990a62f0aca35871c092c22fb9c85d478e22124ef6a4d0a2302da76a9f android.hardware.radio@1.2::IRadio | 346 | ab132c990a62f0aca35871c092c22fb9c85d478e22124ef6a4d0a2302da76a9f android.hardware.radio@1.2::IRadio |
344 | cda752aeabaabc20486a82ac57a3dd107785c006094a349bc5e224e8aa22a17c android.hardware.radio@1.2::IRadioIndication | 347 | cda752aeabaabc20486a82ac57a3dd107785c006094a349bc5e224e8aa22a17c android.hardware.radio@1.2::IRadioIndication |
345 | c38b7e1f808565a535ff19fd4c1b512b22dfa0b58ec91dce03f72a8f1eaf6957 android.hardware.radio@1.2::IRadioResponse | 348 | da8c6ae991c6a4b284cc6e445332e064e28ee8a09482ed5afff9d159ec6694b7 android.hardware.radio@1.2::IRadioResponse |
346 | b65332996eb39ba63300a1011404141fa59ce5c252bc17afae637be6eeca5f55 android.hardware.radio@1.2::ISap | 349 | b65332996eb39ba63300a1011404141fa59ce5c252bc17afae637be6eeca5f55 android.hardware.radio@1.2::ISap |
347 | 508ace7d4023b865b8b77c3ca3c86cc9525ef3803dc9c6b461b7c1f91b0fec00 android.hardware.radio@1.2::types | 350 | a9361522cc97ef66209d39ba324095b2f08344054bb4d3481e803eee0480623a android.hardware.radio@1.2::types |
348 | 87385469cf4409f0f33b01508e7a477cf71f2a11e466dd7e3ab5971a1baaa72b android.hardware.radio.config@1.0::IRadioConfig | 351 | 87385469cf4409f0f33b01508e7a477cf71f2a11e466dd7e3ab5971a1baaa72b android.hardware.radio.config@1.0::IRadioConfig |
349 | 228b2ee3c8c276c9f0afad2dc313ca3d6bbd9e482ddf313c7204c60ad9b636ab android.hardware.radio.config@1.0::IRadioConfigIndication | 352 | 228b2ee3c8c276c9f0afad2dc313ca3d6bbd9e482ddf313c7204c60ad9b636ab android.hardware.radio.config@1.0::IRadioConfigIndication |
350 | a2e9b7aa09f79426f765838174e04b6f9a3e6c8b76b923fc1705632207bad44b android.hardware.radio.config@1.0::IRadioConfigResponse | 353 | a2e9b7aa09f79426f765838174e04b6f9a3e6c8b76b923fc1705632207bad44b android.hardware.radio.config@1.0::IRadioConfigResponse |
@@ -364,7 +367,7 @@ a0aefa29881235c21e4761d15c55edc35ef85c2e0d9e01d0966176d1dbf5f811 android.hardwar | |||
364 | 167af870fdb87e1cbbaa0fa62ef35e1031caad20dd1ba695983dedb1e9993486 android.hardware.wifi@1.2::IWifiChipEventCallback | 367 | 167af870fdb87e1cbbaa0fa62ef35e1031caad20dd1ba695983dedb1e9993486 android.hardware.wifi@1.2::IWifiChipEventCallback |
365 | 8c7ef32fc78d5ec6e6956de3784cc2c6f42614b5272d2e461f6d60534ba38ec2 android.hardware.wifi@1.2::IWifiNanIface | 368 | 8c7ef32fc78d5ec6e6956de3784cc2c6f42614b5272d2e461f6d60534ba38ec2 android.hardware.wifi@1.2::IWifiNanIface |
366 | 1e6074efad9da333803fb7c1acdb719d51c30b2e1e92087b0420341631c30b60 android.hardware.wifi@1.2::IWifiNanIfaceEventCallback | 369 | 1e6074efad9da333803fb7c1acdb719d51c30b2e1e92087b0420341631c30b60 android.hardware.wifi@1.2::IWifiNanIfaceEventCallback |
367 | a9d733eb0d555f2a6cb79a212810e81b56ecba0e31a8ffe0916de086a29e4f88 android.hardware.wifi@1.2::IWifiStaIface | 370 | f5682dbf19f712bef9cc3faa5fe3dc670b6ffbcb62a147a1d86b9d43574cd83f android.hardware.wifi@1.2::IWifiStaIface |
368 | 6db2e7d274be2dca9bf3087afd1f774a68c99d2b4dc7eeaf41690e5cebcbef7a android.hardware.wifi@1.2::types | 371 | 6db2e7d274be2dca9bf3087afd1f774a68c99d2b4dc7eeaf41690e5cebcbef7a android.hardware.wifi@1.2::types |
369 | ee08280de21cb41e3ec26d6ed636c701b7f70516e71fb22f4fe60a13e603f406 android.hardware.wifi.hostapd@1.0::IHostapd | 372 | ee08280de21cb41e3ec26d6ed636c701b7f70516e71fb22f4fe60a13e603f406 android.hardware.wifi.hostapd@1.0::IHostapd |
370 | b2479cd7a417a1cf4f3a22db4e4579e21bac38fdcaf381e2bf10176d05397e01 android.hardware.wifi.hostapd@1.0::types | 373 | b2479cd7a417a1cf4f3a22db4e4579e21bac38fdcaf381e2bf10176d05397e01 android.hardware.wifi.hostapd@1.0::types |
diff --git a/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp b/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp index 3a181a96..fbe5237a 100644 --- a/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp +++ b/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp | |||
@@ -2918,6 +2918,28 @@ TEST_F(EncryptionOperationsTest, AesEcbRoundTripSuccess) { | |||
2918 | } | 2918 | } |
2919 | 2919 | ||
2920 | /* | 2920 | /* |
2921 | * EncryptionOperationsTest.AesEcbWithUserId | ||
2922 | * | ||
2923 | * Verifies that AES ECB mode works when Tag::USER_ID is specified. | ||
2924 | */ | ||
2925 | TEST_F(EncryptionOperationsTest, AesEcbWithUserId) { | ||
2926 | string key = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | ||
2927 | ASSERT_EQ(ErrorCode::OK, ImportKey(AuthorizationSetBuilder() | ||
2928 | .Authorization(TAG_NO_AUTH_REQUIRED) | ||
2929 | .Authorization(TAG_USER_ID, 0) | ||
2930 | .AesEncryptionKey(key.size() * 8) | ||
2931 | .EcbMode() | ||
2932 | .Padding(PaddingMode::PKCS7), | ||
2933 | KeyFormat::RAW, key)); | ||
2934 | |||
2935 | string message = "Hello World!"; | ||
2936 | auto params = AuthorizationSetBuilder().BlockMode(BlockMode::ECB).Padding(PaddingMode::PKCS7); | ||
2937 | string ciphertext = EncryptMessage(message, params); | ||
2938 | string plaintext = DecryptMessage(ciphertext, params); | ||
2939 | EXPECT_EQ(message, plaintext); | ||
2940 | } | ||
2941 | |||
2942 | /* | ||
2921 | * EncryptionOperationsTest.AesEcbRoundTripSuccess | 2943 | * EncryptionOperationsTest.AesEcbRoundTripSuccess |
2922 | * | 2944 | * |
2923 | * Verifies that AES encryption fails in the correct way when an unauthorized mode is specified. | 2945 | * Verifies that AES encryption fails in the correct way when an unauthorized mode is specified. |
diff --git a/keymaster/4.0/support/include/keymasterV4_0/keymaster_tags.h b/keymaster/4.0/support/include/keymasterV4_0/keymaster_tags.h index 9d6501b8..ce213bc1 100644 --- a/keymaster/4.0/support/include/keymasterV4_0/keymaster_tags.h +++ b/keymaster/4.0/support/include/keymasterV4_0/keymaster_tags.h | |||
@@ -142,24 +142,28 @@ DECLARE_TYPED_TAG(ROOT_OF_TRUST); | |||
142 | DECLARE_TYPED_TAG(RSA_PUBLIC_EXPONENT); | 142 | DECLARE_TYPED_TAG(RSA_PUBLIC_EXPONENT); |
143 | DECLARE_TYPED_TAG(TRUSTED_CONFIRMATION_REQUIRED); | 143 | DECLARE_TYPED_TAG(TRUSTED_CONFIRMATION_REQUIRED); |
144 | DECLARE_TYPED_TAG(UNIQUE_ID); | 144 | DECLARE_TYPED_TAG(UNIQUE_ID); |
145 | DECLARE_TYPED_TAG(UNLOCKED_DEVICE_REQUIRED); | ||
145 | DECLARE_TYPED_TAG(USAGE_EXPIRE_DATETIME); | 146 | DECLARE_TYPED_TAG(USAGE_EXPIRE_DATETIME); |
146 | DECLARE_TYPED_TAG(USER_AUTH_TYPE); | 147 | DECLARE_TYPED_TAG(USER_AUTH_TYPE); |
148 | DECLARE_TYPED_TAG(USER_ID); | ||
147 | DECLARE_TYPED_TAG(USER_SECURE_ID); | 149 | DECLARE_TYPED_TAG(USER_SECURE_ID); |
148 | 150 | ||
149 | template <typename... Elems> | 151 | template <typename... Elems> |
150 | struct MetaList {}; | 152 | struct MetaList {}; |
151 | 153 | ||
152 | using all_tags_t = MetaList< | 154 | using all_tags_t = |
153 | TAG_INVALID_t, TAG_KEY_SIZE_t, TAG_MAC_LENGTH_t, TAG_CALLER_NONCE_t, TAG_MIN_MAC_LENGTH_t, | 155 | MetaList<TAG_INVALID_t, TAG_KEY_SIZE_t, TAG_MAC_LENGTH_t, TAG_CALLER_NONCE_t, |
154 | TAG_RSA_PUBLIC_EXPONENT_t, TAG_INCLUDE_UNIQUE_ID_t, TAG_ACTIVE_DATETIME_t, | 156 | TAG_MIN_MAC_LENGTH_t, TAG_RSA_PUBLIC_EXPONENT_t, TAG_INCLUDE_UNIQUE_ID_t, |
155 | TAG_ORIGINATION_EXPIRE_DATETIME_t, TAG_USAGE_EXPIRE_DATETIME_t, TAG_MIN_SECONDS_BETWEEN_OPS_t, | 157 | TAG_ACTIVE_DATETIME_t, TAG_ORIGINATION_EXPIRE_DATETIME_t, TAG_USAGE_EXPIRE_DATETIME_t, |
156 | TAG_MAX_USES_PER_BOOT_t, TAG_USER_SECURE_ID_t, TAG_NO_AUTH_REQUIRED_t, TAG_AUTH_TIMEOUT_t, | 158 | TAG_MIN_SECONDS_BETWEEN_OPS_t, TAG_MAX_USES_PER_BOOT_t, TAG_USER_ID_t, |
157 | TAG_ALLOW_WHILE_ON_BODY_t, TAG_APPLICATION_ID_t, TAG_APPLICATION_DATA_t, | 159 | TAG_USER_SECURE_ID_t, TAG_NO_AUTH_REQUIRED_t, TAG_AUTH_TIMEOUT_t, |
158 | TAG_CREATION_DATETIME_t, TAG_ROLLBACK_RESISTANCE_t, TAG_ROOT_OF_TRUST_t, TAG_ASSOCIATED_DATA_t, | 160 | TAG_ALLOW_WHILE_ON_BODY_t, TAG_UNLOCKED_DEVICE_REQUIRED_t, TAG_APPLICATION_ID_t, |
159 | TAG_NONCE_t, TAG_BOOTLOADER_ONLY_t, TAG_OS_VERSION_t, TAG_OS_PATCHLEVEL_t, TAG_UNIQUE_ID_t, | 161 | TAG_APPLICATION_DATA_t, TAG_CREATION_DATETIME_t, TAG_ROLLBACK_RESISTANCE_t, |
160 | TAG_ATTESTATION_CHALLENGE_t, TAG_ATTESTATION_APPLICATION_ID_t, TAG_RESET_SINCE_ID_ROTATION_t, | 162 | TAG_ROOT_OF_TRUST_t, TAG_ASSOCIATED_DATA_t, TAG_NONCE_t, TAG_BOOTLOADER_ONLY_t, |
161 | TAG_PURPOSE_t, TAG_ALGORITHM_t, TAG_BLOCK_MODE_t, TAG_DIGEST_t, TAG_PADDING_t, | 163 | TAG_OS_VERSION_t, TAG_OS_PATCHLEVEL_t, TAG_UNIQUE_ID_t, TAG_ATTESTATION_CHALLENGE_t, |
162 | TAG_BLOB_USAGE_REQUIREMENTS_t, TAG_ORIGIN_t, TAG_USER_AUTH_TYPE_t, TAG_EC_CURVE_t>; | 164 | TAG_ATTESTATION_APPLICATION_ID_t, TAG_RESET_SINCE_ID_ROTATION_t, TAG_PURPOSE_t, |
165 | TAG_ALGORITHM_t, TAG_BLOCK_MODE_t, TAG_DIGEST_t, TAG_PADDING_t, | ||
166 | TAG_BLOB_USAGE_REQUIREMENTS_t, TAG_ORIGIN_t, TAG_USER_AUTH_TYPE_t, TAG_EC_CURVE_t>; | ||
163 | 167 | ||
164 | template <typename TypedTagType> | 168 | template <typename TypedTagType> |
165 | struct TypedTag2ValueType; | 169 | struct TypedTag2ValueType; |
@@ -343,6 +347,7 @@ inline bool operator==(const KeyParameter& a, const KeyParameter& b) { | |||
343 | case Tag::BOOTLOADER_ONLY: | 347 | case Tag::BOOTLOADER_ONLY: |
344 | case Tag::NO_AUTH_REQUIRED: | 348 | case Tag::NO_AUTH_REQUIRED: |
345 | case Tag::ALLOW_WHILE_ON_BODY: | 349 | case Tag::ALLOW_WHILE_ON_BODY: |
350 | case Tag::UNLOCKED_DEVICE_REQUIRED: | ||
346 | case Tag::ROLLBACK_RESISTANCE: | 351 | case Tag::ROLLBACK_RESISTANCE: |
347 | case Tag::RESET_SINCE_ID_ROTATION: | 352 | case Tag::RESET_SINCE_ID_ROTATION: |
348 | case Tag::TRUSTED_CONFIRMATION_REQUIRED: | 353 | case Tag::TRUSTED_CONFIRMATION_REQUIRED: |
@@ -357,6 +362,7 @@ inline bool operator==(const KeyParameter& a, const KeyParameter& b) { | |||
357 | case Tag::OS_VERSION: | 362 | case Tag::OS_VERSION: |
358 | case Tag::OS_PATCHLEVEL: | 363 | case Tag::OS_PATCHLEVEL: |
359 | case Tag::MAC_LENGTH: | 364 | case Tag::MAC_LENGTH: |
365 | case Tag::USER_ID: | ||
360 | case Tag::AUTH_TIMEOUT: | 366 | case Tag::AUTH_TIMEOUT: |
361 | case Tag::VENDOR_PATCHLEVEL: | 367 | case Tag::VENDOR_PATCHLEVEL: |
362 | case Tag::BOOT_PATCHLEVEL: | 368 | case Tag::BOOT_PATCHLEVEL: |
diff --git a/keymaster/4.0/types.hal b/keymaster/4.0/types.hal index 91ec9bf5..47fd1ed0 100644 --- a/keymaster/4.0/types.hal +++ b/keymaster/4.0/types.hal | |||
@@ -118,7 +118,8 @@ enum Tag : uint32_t { | |||
118 | * boot. */ | 118 | * boot. */ |
119 | 119 | ||
120 | /* User authentication */ | 120 | /* User authentication */ |
121 | // 500-501 reserved | 121 | // 500 reserved |
122 | USER_ID = TagType:UINT | 501, /* Android ID of authorized user or authenticator(s), */ | ||
122 | USER_SECURE_ID = TagType:ULONG_REP | 502, /* Secure ID of authorized user or authenticator(s). | 123 | USER_SECURE_ID = TagType:ULONG_REP | 502, /* Secure ID of authorized user or authenticator(s). |
123 | * Disallowed if NO_AUTH_REQUIRED is present. */ | 124 | * Disallowed if NO_AUTH_REQUIRED is present. */ |
124 | NO_AUTH_REQUIRED = TagType:BOOL | 503, /* If key is usable without authentication. */ | 125 | NO_AUTH_REQUIRED = TagType:BOOL | 503, /* If key is usable without authentication. */ |
@@ -191,6 +192,9 @@ enum Tag : uint32_t { | |||
191 | * match the data described in the token, keymaster must return NO_USER_CONFIRMATION. */ | 192 | * match the data described in the token, keymaster must return NO_USER_CONFIRMATION. */ |
192 | TRUSTED_CONFIRMATION_REQUIRED = TagType:BOOL | 508, | 193 | TRUSTED_CONFIRMATION_REQUIRED = TagType:BOOL | 508, |
193 | 194 | ||
195 | UNLOCKED_DEVICE_REQUIRED = TagType:BOOL | 509, /* Require the device screen to be unlocked if | ||
196 | * the key is used. */ | ||
197 | |||
194 | /* Application access control */ | 198 | /* Application access control */ |
195 | APPLICATION_ID = TagType:BYTES | 601, /* Byte string identifying the authorized application. */ | 199 | APPLICATION_ID = TagType:BYTES | 601, /* Byte string identifying the authorized application. */ |
196 | 200 | ||
@@ -471,6 +475,7 @@ enum ErrorCode : int32_t { | |||
471 | PROOF_OF_PRESENCE_REQUIRED = -69, | 475 | PROOF_OF_PRESENCE_REQUIRED = -69, |
472 | CONCURRENT_PROOF_OF_PRESENCE_REQUESTED = -70, | 476 | CONCURRENT_PROOF_OF_PRESENCE_REQUESTED = -70, |
473 | NO_USER_CONFIRMATION = -71, | 477 | NO_USER_CONFIRMATION = -71, |
478 | DEVICE_LOCKED = -72, | ||
474 | 479 | ||
475 | UNIMPLEMENTED = -100, | 480 | UNIMPLEMENTED = -100, |
476 | VERSION_MISMATCH = -101, | 481 | VERSION_MISMATCH = -101, |
diff --git a/neuralnetworks/1.0/types.hal b/neuralnetworks/1.0/types.hal index 8779723d..c97a00be 100644 --- a/neuralnetworks/1.0/types.hal +++ b/neuralnetworks/1.0/types.hal | |||
@@ -84,6 +84,7 @@ enum OperationType : int32_t { | |||
84 | * output.dimension = {5, 4, 3, 2} | 84 | * output.dimension = {5, 4, 3, 2} |
85 | * | 85 | * |
86 | * Supported tensor types: {@link OperandType::TENSOR_FLOAT32} | 86 | * Supported tensor types: {@link OperandType::TENSOR_FLOAT32} |
87 | * {@link OperandType::TENSOR_QUANT8_ASYMM} | ||
87 | * Supported tensor rank: up to 4 | 88 | * Supported tensor rank: up to 4 |
88 | * | 89 | * |
89 | * Inputs: | 90 | * Inputs: |
@@ -645,6 +646,7 @@ enum OperationType : int32_t { | |||
645 | * input operands. It starts with the trailing dimensions, and works its way forward. | 646 | * input operands. It starts with the trailing dimensions, and works its way forward. |
646 | * | 647 | * |
647 | * Supported tensor types: {@link OperandType::TENSOR_FLOAT32} | 648 | * Supported tensor types: {@link OperandType::TENSOR_FLOAT32} |
649 | * {@link OperandType::TENSOR_QUANT8_ASYMM} | ||
648 | * Supported tensor rank: up to 4 | 650 | * Supported tensor rank: up to 4 |
649 | * | 651 | * |
650 | * Inputs: | 652 | * Inputs: |
diff --git a/radio/1.2/Android.bp b/radio/1.2/Android.bp index a9c80b7f..c90a03c3 100644 --- a/radio/1.2/Android.bp +++ b/radio/1.2/Android.bp | |||
@@ -24,6 +24,7 @@ hidl_interface { | |||
24 | "Call", | 24 | "Call", |
25 | "CardStatus", | 25 | "CardStatus", |
26 | "CellConnectionStatus", | 26 | "CellConnectionStatus", |
27 | "CellIdentity", | ||
27 | "CellIdentityCdma", | 28 | "CellIdentityCdma", |
28 | "CellIdentityGsm", | 29 | "CellIdentityGsm", |
29 | "CellIdentityLte", | 30 | "CellIdentityLte", |
@@ -36,6 +37,7 @@ hidl_interface { | |||
36 | "CellInfoLte", | 37 | "CellInfoLte", |
37 | "CellInfoTdscdma", | 38 | "CellInfoTdscdma", |
38 | "CellInfoWcdma", | 39 | "CellInfoWcdma", |
40 | "DataRegStateResult", | ||
39 | "DataRequestReason", | 41 | "DataRequestReason", |
40 | "IncrementalResultsPeriodicityRange", | 42 | "IncrementalResultsPeriodicityRange", |
41 | "IndicationFilter", | 43 | "IndicationFilter", |
@@ -48,6 +50,7 @@ hidl_interface { | |||
48 | "ScanIntervalRange", | 50 | "ScanIntervalRange", |
49 | "SignalStrength", | 51 | "SignalStrength", |
50 | "TdscdmaSignalStrength", | 52 | "TdscdmaSignalStrength", |
53 | "VoiceRegStateResult", | ||
51 | "WcdmaSignalStrength", | 54 | "WcdmaSignalStrength", |
52 | ], | 55 | ], |
53 | gen_java: true, | 56 | gen_java: true, |
diff --git a/radio/1.2/IRadioResponse.hal b/radio/1.2/IRadioResponse.hal index f26c9ecc..300aa372 100644 --- a/radio/1.2/IRadioResponse.hal +++ b/radio/1.2/IRadioResponse.hal | |||
@@ -98,4 +98,31 @@ interface IRadioResponse extends @1.1::IRadioResponse { | |||
98 | * RadioError:INTERNAL_ERR | 98 | * RadioError:INTERNAL_ERR |
99 | */ | 99 | */ |
100 | oneway getSignalStrengthResponse_1_2(RadioResponseInfo info, SignalStrength signalStrength); | 100 | oneway getSignalStrengthResponse_1_2(RadioResponseInfo info, SignalStrength signalStrength); |
101 | |||
102 | /** | ||
103 | * @param info Response info struct containing response type, serial no. and error | ||
104 | * @param voiceRegResponse Current Voice registration response as defined by VoiceRegStateResult | ||
105 | * in types.hal | ||
106 | * | ||
107 | * Valid errors returned: | ||
108 | * RadioError:NONE | ||
109 | * RadioError:RADIO_NOT_AVAILABLE | ||
110 | * RadioError:INTERNAL_ERR | ||
111 | */ | ||
112 | oneway getVoiceRegistrationStateResponse_1_2(RadioResponseInfo info, | ||
113 | VoiceRegStateResult voiceRegResponse); | ||
114 | |||
115 | /** | ||
116 | * @param info Response info struct containing response type, serial no. and error | ||
117 | * @param dataRegResponse Current Data registration response as defined by DataRegStateResult in | ||
118 | * types.hal | ||
119 | * | ||
120 | * Valid errors returned: | ||
121 | * RadioError:NONE | ||
122 | * RadioError:RADIO_NOT_AVAILABLE | ||
123 | * RadioError:INTERNAL_ERR | ||
124 | * RadioError:NOT_PROVISIONED | ||
125 | */ | ||
126 | oneway getDataRegistrationStateResponse_1_2(RadioResponseInfo info, | ||
127 | DataRegStateResult dataRegResponse); | ||
101 | }; | 128 | }; |
diff --git a/radio/1.2/types.hal b/radio/1.2/types.hal index 5e72b3b1..4715facf 100644 --- a/radio/1.2/types.hal +++ b/radio/1.2/types.hal | |||
@@ -32,6 +32,7 @@ import @1.0::GsmSignalStrength; | |||
32 | import @1.0::LteSignalStrength; | 32 | import @1.0::LteSignalStrength; |
33 | import @1.0::RadioConst; | 33 | import @1.0::RadioConst; |
34 | import @1.0::RadioError; | 34 | import @1.0::RadioError; |
35 | import @1.0::RegState; | ||
35 | import @1.0::SignalStrength; | 36 | import @1.0::SignalStrength; |
36 | import @1.0::TdScdmaSignalStrength; | 37 | import @1.0::TdScdmaSignalStrength; |
37 | import @1.0::TimeStampType; | 38 | import @1.0::TimeStampType; |
@@ -462,3 +463,129 @@ struct SignalStrength { | |||
462 | TdScdmaSignalStrength tdScdma; | 463 | TdScdmaSignalStrength tdScdma; |
463 | WcdmaSignalStrength wcdma; | 464 | WcdmaSignalStrength wcdma; |
464 | }; | 465 | }; |
466 | |||
467 | struct CellIdentity { | ||
468 | /** | ||
469 | * Cell type for selecting from union CellInfo. | ||
470 | * Only one of the below vectors must be of size 1 based on a | ||
471 | * valid CellInfoType and others must be of size 0. | ||
472 | * If cell info type is NONE, then all the vectors must be of size 0. | ||
473 | */ | ||
474 | CellInfoType cellInfoType; | ||
475 | vec<CellIdentityGsm> cellIdentityGsm; | ||
476 | vec<CellIdentityWcdma> cellIdentityWcdma; | ||
477 | vec<CellIdentityCdma> cellIdentityCdma; | ||
478 | vec<CellIdentityLte> cellIdentityLte; | ||
479 | vec<CellIdentityTdscdma> cellIdentityTdscdma; | ||
480 | }; | ||
481 | |||
482 | struct VoiceRegStateResult { | ||
483 | /** | ||
484 | * Valid reg states are NOT_REG_MT_NOT_SEARCHING_OP, | ||
485 | * REG_HOME, NOT_REG_MT_SEARCHING_OP, REG_DENIED, | ||
486 | * UNKNOWN, REG_ROAMING defined in RegState | ||
487 | */ | ||
488 | RegState regState; | ||
489 | /** | ||
490 | * Indicates the available voice radio technology, valid values as | ||
491 | * defined by RadioTechnology. | ||
492 | */ | ||
493 | int32_t rat; | ||
494 | /** | ||
495 | * concurrent services support indicator. if registered on a CDMA system. | ||
496 | * false - Concurrent services not supported, | ||
497 | * true - Concurrent services supported | ||
498 | */ | ||
499 | bool cssSupported; | ||
500 | /** | ||
501 | * TSB-58 Roaming Indicator if registered on a CDMA or EVDO system or -1 if not. | ||
502 | * Valid values are 0-255. | ||
503 | */ | ||
504 | int32_t roamingIndicator; | ||
505 | /** | ||
506 | * Indicates whether the current system is in the PRL if registered on a CDMA or EVDO system | ||
507 | * or -1 if not. 0=not in the PRL, 1=in the PRL | ||
508 | */ | ||
509 | int32_t systemIsInPrl; | ||
510 | /** | ||
511 | * Default Roaming Indicator from the PRL if registered on a CDMA or EVDO system or -1 if not. | ||
512 | * Valid values are 0-255. | ||
513 | */ | ||
514 | int32_t defaultRoamingIndicator; | ||
515 | /** | ||
516 | * reasonForDenial if registration state is 3 | ||
517 | * (Registration denied) this is an enumerated reason why | ||
518 | * registration was denied. See 3GPP TS 24.008, | ||
519 | * 10.5.3.6 and Annex G. | ||
520 | * 0 - General | ||
521 | * 1 - Authentication Failure | ||
522 | * 2 - IMSI unknown in HLR | ||
523 | * 3 - Illegal MS | ||
524 | * 4 - Illegal ME | ||
525 | * 5 - PLMN not allowed | ||
526 | * 6 - Location area not allowed | ||
527 | * 7 - Roaming not allowed | ||
528 | * 8 - No Suitable Cells in this Location Area | ||
529 | * 9 - Network failure | ||
530 | * 10 - Persistent location update reject | ||
531 | * 11 - PLMN not allowed | ||
532 | * 12 - Location area not allowed | ||
533 | * 13 - Roaming not allowed in this Location Area | ||
534 | * 15 - No Suitable Cells in this Location Area | ||
535 | * 17 - Network Failure | ||
536 | * 20 - MAC Failure | ||
537 | * 21 - Sync Failure | ||
538 | * 22 - Congestion | ||
539 | * 23 - GSM Authentication unacceptable | ||
540 | * 25 - Not Authorized for this CSG | ||
541 | * 32 - Service option not supported | ||
542 | * 33 - Requested service option not subscribed | ||
543 | * 34 - Service option temporarily out of order | ||
544 | * 38 - Call cannot be identified | ||
545 | * 48-63 - Retry upon entry into a new cell | ||
546 | * 95 - Semantically incorrect message | ||
547 | * 96 - Invalid mandatory information | ||
548 | * 97 - Message type non-existent or not implemented | ||
549 | * 98 - Message type not compatible with protocol state | ||
550 | * 99 - Information element non-existent or not implemented | ||
551 | * 100 - Conditional IE error | ||
552 | * 101 - Message not compatible with protocol state | ||
553 | * 111 - Protocol error, unspecified | ||
554 | */ | ||
555 | int32_t reasonForDenial; | ||
556 | |||
557 | CellIdentity cellIdentity; | ||
558 | }; | ||
559 | |||
560 | struct DataRegStateResult { | ||
561 | /** | ||
562 | * Valid reg states are NOT_REG_MT_NOT_SEARCHING_OP, | ||
563 | * REG_HOME, NOT_REG_MT_SEARCHING_OP, REG_DENIED, | ||
564 | * UNKNOWN, REG_ROAMING defined in RegState | ||
565 | */ | ||
566 | RegState regState; | ||
567 | /** | ||
568 | * Indicates the available data radio technology, | ||
569 | * valid values as defined by RadioTechnology. | ||
570 | */ | ||
571 | int32_t rat; | ||
572 | /** | ||
573 | * If registration state is 3 (Registration | ||
574 | * denied) this is an enumerated reason why | ||
575 | * registration was denied. See 3GPP TS 24.008, | ||
576 | * Annex G.6 "Additional cause codes for GMM". | ||
577 | * 7 == GPRS services not allowed | ||
578 | * 8 == GPRS services and non-GPRS services not allowed | ||
579 | * 9 == MS identity cannot be derived by the network | ||
580 | * 10 == Implicitly detached | ||
581 | * 14 == GPRS services not allowed in this PLMN | ||
582 | * 16 == MSC temporarily not reachable | ||
583 | * 40 == No PDP context activated | ||
584 | */ | ||
585 | int32_t reasonDataDenied; | ||
586 | /** | ||
587 | * The maximum number of simultaneous Data Calls must be established using setupDataCall(). | ||
588 | */ | ||
589 | int32_t maxDataCalls; | ||
590 | CellIdentity cellIdentity; | ||
591 | }; | ||
diff --git a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp index 34a87e13..ee130f85 100644 --- a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp | |||
@@ -673,3 +673,40 @@ TEST_F(RadioHidlTest_v1_2, getCellInfoList_1_2) { | |||
673 | ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, | 673 | ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, |
674 | {RadioError::NONE, RadioError::NO_NETWORK_FOUND})); | 674 | {RadioError::NONE, RadioError::NO_NETWORK_FOUND})); |
675 | } | 675 | } |
676 | |||
677 | /* | ||
678 | * Test IRadio.getVoiceRegistrationState() for the response returned. | ||
679 | */ | ||
680 | TEST_F(RadioHidlTest_v1_2, getVoiceRegistrationState) { | ||
681 | int serial = GetRandomSerialNumber(); | ||
682 | |||
683 | Return<void> res = radio_v1_2->getVoiceRegistrationState(serial); | ||
684 | ASSERT_OK(res); | ||
685 | EXPECT_EQ(std::cv_status::no_timeout, wait()); | ||
686 | EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type); | ||
687 | EXPECT_EQ(serial, radioRsp_v1_2->rspInfo.serial); | ||
688 | |||
689 | ALOGI("getVoiceRegistrationStateResponse_1_2, rspInfo.error = %s\n", | ||
690 | toString(radioRsp_v1_2->rspInfo.error).c_str()); | ||
691 | ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, | ||
692 | {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE})); | ||
693 | } | ||
694 | |||
695 | /* | ||
696 | * Test IRadio.getDataRegistrationState() for the response returned. | ||
697 | */ | ||
698 | TEST_F(RadioHidlTest_v1_2, getDataRegistrationState) { | ||
699 | int serial = GetRandomSerialNumber(); | ||
700 | |||
701 | Return<void> res = radio_v1_2->getDataRegistrationState(serial); | ||
702 | ASSERT_OK(res); | ||
703 | EXPECT_EQ(std::cv_status::no_timeout, wait()); | ||
704 | EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type); | ||
705 | EXPECT_EQ(serial, radioRsp_v1_2->rspInfo.serial); | ||
706 | |||
707 | ALOGI("getVoiceRegistrationStateResponse_1_2, rspInfo.error = %s\n", | ||
708 | toString(radioRsp_v1_2->rspInfo.error).c_str()); | ||
709 | ASSERT_TRUE(CheckAnyOfErrors( | ||
710 | radioRsp_v1_2->rspInfo.error, | ||
711 | {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::NOT_PROVISIONED})); | ||
712 | } | ||
diff --git a/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h b/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h index 66d8ca45..c61913c7 100644 --- a/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h +++ b/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h | |||
@@ -417,6 +417,12 @@ class RadioResponse_v1_2 : public V1_1::IRadioResponse { | |||
417 | 417 | ||
418 | Return<void> getCellInfoListResponse_1_2( | 418 | Return<void> getCellInfoListResponse_1_2( |
419 | const RadioResponseInfo& info, const ::android::hardware::hidl_vec<CellInfo>& cellInfo); | 419 | const RadioResponseInfo& info, const ::android::hardware::hidl_vec<CellInfo>& cellInfo); |
420 | |||
421 | Return<void> getVoiceRegistrationStateResponse_1_2( | ||
422 | const RadioResponseInfo& info, const V1_2::VoiceRegStateResult& voiceRegResponse); | ||
423 | |||
424 | Return<void> getDataRegistrationStateResponse_1_2( | ||
425 | const RadioResponseInfo& info, const V1_2::DataRegStateResult& dataRegResponse); | ||
420 | }; | 426 | }; |
421 | 427 | ||
422 | /* Callback class for radio indication */ | 428 | /* Callback class for radio indication */ |
diff --git a/radio/1.2/vts/functional/radio_response.cpp b/radio/1.2/vts/functional/radio_response.cpp index d96f76b4..9195689c 100644 --- a/radio/1.2/vts/functional/radio_response.cpp +++ b/radio/1.2/vts/functional/radio_response.cpp | |||
@@ -731,4 +731,14 @@ Return<void> RadioResponse_v1_2::getCellInfoListResponse_1_2( | |||
731 | rspInfo = info; | 731 | rspInfo = info; |
732 | parent_v1_2.notify(); | 732 | parent_v1_2.notify(); |
733 | return Void(); | 733 | return Void(); |
734 | } \ No newline at end of file | 734 | } |
735 | |||
736 | Return<void> RadioResponse_v1_2::getVoiceRegistrationStateResponse_1_2( | ||
737 | const RadioResponseInfo& /*info*/, const V1_2::VoiceRegStateResult& /*voiceRegResponse*/) { | ||
738 | return Void(); | ||
739 | } | ||
740 | |||
741 | Return<void> RadioResponse_v1_2::getDataRegistrationStateResponse_1_2( | ||
742 | const RadioResponseInfo& /*info*/, const V1_2::DataRegStateResult& /*dataRegResponse*/) { | ||
743 | return Void(); | ||
744 | } | ||
diff --git a/secure_element/1.0/vts/functional/VtsHalSecureElementV1_0TargetTest.cpp b/secure_element/1.0/vts/functional/VtsHalSecureElementV1_0TargetTest.cpp index 59c354f1..dab81e2a 100644 --- a/secure_element/1.0/vts/functional/VtsHalSecureElementV1_0TargetTest.cpp +++ b/secure_element/1.0/vts/functional/VtsHalSecureElementV1_0TargetTest.cpp | |||
@@ -34,14 +34,13 @@ using ::android::hardware::Void; | |||
34 | using ::android::sp; | 34 | using ::android::sp; |
35 | using ::testing::VtsHalHidlTargetTestEnvBase; | 35 | using ::testing::VtsHalHidlTargetTestEnvBase; |
36 | 36 | ||
37 | #define SELECT_ISD \ | 37 | #define DATA_APDU \ |
38 | { 0x00, 0xA4, 0x04, 0x00, 0x00 } | 38 | { 0x00, 0x08, 0x00, 0x00, 0x00 } |
39 | #define SEQUENCE_COUNTER \ | 39 | #define ANDROID_TEST_AID \ |
40 | { 0x80, 0xCA, 0x00, 0xC1, 0x00 } | 40 | { \ |
41 | #define MANAGE_SELECT \ | 41 | 0xA0, 0x00, 0x00, 0x04, 0x76, 0x41, 0x6E, 0x64, 0x72, 0x6F, 0x69, 0x64, 0x43, 0x54, 0x53, \ |
42 | { 0x00, 0xA4, 0x04, 0x00, 0x00 } | 42 | 0x31 \ |
43 | #define CRS_AID \ | 43 | } |
44 | { 0xA0, 0x00, 0x00, 0x01, 0x51, 0x43, 0x52, 0x53, 0x00 } | ||
45 | 44 | ||
46 | constexpr char kCallbackNameOnStateChange[] = "onStateChange"; | 45 | constexpr char kCallbackNameOnStateChange[] = "onStateChange"; |
47 | 46 | ||
@@ -115,7 +114,7 @@ TEST_F(SecureElementHidlTest, isCardPresent) { | |||
115 | * Check status word in the response | 114 | * Check status word in the response |
116 | */ | 115 | */ |
117 | TEST_F(SecureElementHidlTest, transmit) { | 116 | TEST_F(SecureElementHidlTest, transmit) { |
118 | std::vector<uint8_t> aid = CRS_AID; | 117 | std::vector<uint8_t> aid = ANDROID_TEST_AID; |
119 | SecureElementStatus statusReturned; | 118 | SecureElementStatus statusReturned; |
120 | LogicalChannelResponse response; | 119 | LogicalChannelResponse response; |
121 | se_->openLogicalChannel( | 120 | se_->openLogicalChannel( |
@@ -132,9 +131,9 @@ TEST_F(SecureElementHidlTest, transmit) { | |||
132 | } | 131 | } |
133 | }); | 132 | }); |
134 | EXPECT_EQ(SecureElementStatus::SUCCESS, statusReturned); | 133 | EXPECT_EQ(SecureElementStatus::SUCCESS, statusReturned); |
135 | EXPECT_LE((unsigned int)3, response.selectResponse.size()); | 134 | EXPECT_LE((unsigned int)2, response.selectResponse.size()); |
136 | EXPECT_LE(1, response.channelNumber); | 135 | EXPECT_LE(1, response.channelNumber); |
137 | std::vector<uint8_t> command = SELECT_ISD; | 136 | std::vector<uint8_t> command = DATA_APDU; |
138 | std::vector<uint8_t> transmitResponse; | 137 | std::vector<uint8_t> transmitResponse; |
139 | se_->transmit(command, [&transmitResponse](std::vector<uint8_t> res) { | 138 | se_->transmit(command, [&transmitResponse](std::vector<uint8_t> res) { |
140 | transmitResponse.resize(res.size()); | 139 | transmitResponse.resize(res.size()); |
@@ -145,16 +144,6 @@ TEST_F(SecureElementHidlTest, transmit) { | |||
145 | EXPECT_LE((unsigned int)3, transmitResponse.size()); | 144 | EXPECT_LE((unsigned int)3, transmitResponse.size()); |
146 | EXPECT_EQ(0x90, transmitResponse[transmitResponse.size() - 2]); | 145 | EXPECT_EQ(0x90, transmitResponse[transmitResponse.size() - 2]); |
147 | EXPECT_EQ(0x00, transmitResponse[transmitResponse.size() - 1]); | 146 | EXPECT_EQ(0x00, transmitResponse[transmitResponse.size() - 1]); |
148 | command = SEQUENCE_COUNTER; | ||
149 | se_->transmit(command, [&transmitResponse](std::vector<uint8_t> res) { | ||
150 | transmitResponse.resize(res.size()); | ||
151 | for (size_t i = 0; i < res.size(); i++) { | ||
152 | transmitResponse[i] = res[i]; | ||
153 | } | ||
154 | }); | ||
155 | EXPECT_LE((unsigned int)3, transmitResponse.size()); | ||
156 | EXPECT_EQ(0x90, transmitResponse[transmitResponse.size() - 2]); | ||
157 | EXPECT_EQ(0x00, transmitResponse[transmitResponse.size() - 1]); | ||
158 | EXPECT_EQ(SecureElementStatus::SUCCESS, se_->closeChannel(response.channelNumber)); | 147 | EXPECT_EQ(SecureElementStatus::SUCCESS, se_->closeChannel(response.channelNumber)); |
159 | } | 148 | } |
160 | 149 | ||
@@ -164,7 +153,7 @@ TEST_F(SecureElementHidlTest, transmit) { | |||
164 | * open channel, check the length of selectResponse and close the channel | 153 | * open channel, check the length of selectResponse and close the channel |
165 | */ | 154 | */ |
166 | TEST_F(SecureElementHidlTest, openBasicChannel) { | 155 | TEST_F(SecureElementHidlTest, openBasicChannel) { |
167 | std::vector<uint8_t> aid = CRS_AID; | 156 | std::vector<uint8_t> aid = ANDROID_TEST_AID; |
168 | SecureElementStatus statusReturned; | 157 | SecureElementStatus statusReturned; |
169 | std::vector<uint8_t> response; | 158 | std::vector<uint8_t> response; |
170 | se_->openBasicChannel(aid, 0x00, | 159 | se_->openBasicChannel(aid, 0x00, |
@@ -180,17 +169,6 @@ TEST_F(SecureElementHidlTest, openBasicChannel) { | |||
180 | }); | 169 | }); |
181 | if (statusReturned == SecureElementStatus::SUCCESS) { | 170 | if (statusReturned == SecureElementStatus::SUCCESS) { |
182 | EXPECT_LE((unsigned int)3, response.size()); | 171 | EXPECT_LE((unsigned int)3, response.size()); |
183 | std::vector<uint8_t> command = SELECT_ISD; | ||
184 | std::vector<uint8_t> transmitResponse; | ||
185 | se_->transmit(command, [&transmitResponse](std::vector<uint8_t> res) { | ||
186 | transmitResponse.resize(res.size()); | ||
187 | for (size_t i = 0; i < res.size(); i++) { | ||
188 | transmitResponse[i] = res[i]; | ||
189 | } | ||
190 | }); | ||
191 | EXPECT_LE((unsigned int)3, transmitResponse.size()); | ||
192 | EXPECT_EQ(0x90, transmitResponse[transmitResponse.size() - 2]); | ||
193 | EXPECT_EQ(0x00, transmitResponse[transmitResponse.size() - 1]); | ||
194 | return; | 172 | return; |
195 | } | 173 | } |
196 | EXPECT_EQ(SecureElementStatus::UNSUPPORTED_OPERATION, statusReturned); | 174 | EXPECT_EQ(SecureElementStatus::UNSUPPORTED_OPERATION, statusReturned); |
@@ -221,7 +199,7 @@ TEST_F(SecureElementHidlTest, getAtr) { | |||
221 | * Close Channel | 199 | * Close Channel |
222 | */ | 200 | */ |
223 | TEST_F(SecureElementHidlTest, openCloseLogicalChannel) { | 201 | TEST_F(SecureElementHidlTest, openCloseLogicalChannel) { |
224 | std::vector<uint8_t> aid = CRS_AID; | 202 | std::vector<uint8_t> aid = ANDROID_TEST_AID; |
225 | SecureElementStatus statusReturned; | 203 | SecureElementStatus statusReturned; |
226 | LogicalChannelResponse response; | 204 | LogicalChannelResponse response; |
227 | se_->openLogicalChannel( | 205 | se_->openLogicalChannel( |
@@ -238,7 +216,7 @@ TEST_F(SecureElementHidlTest, openCloseLogicalChannel) { | |||
238 | } | 216 | } |
239 | }); | 217 | }); |
240 | EXPECT_EQ(SecureElementStatus::SUCCESS, statusReturned); | 218 | EXPECT_EQ(SecureElementStatus::SUCCESS, statusReturned); |
241 | EXPECT_LE((unsigned int)3, response.selectResponse.size()); | 219 | EXPECT_LE((unsigned int)2, response.selectResponse.size()); |
242 | EXPECT_LE(1, response.channelNumber); | 220 | EXPECT_LE(1, response.channelNumber); |
243 | EXPECT_EQ(SecureElementStatus::SUCCESS, se_->closeChannel(response.channelNumber)); | 221 | EXPECT_EQ(SecureElementStatus::SUCCESS, se_->closeChannel(response.channelNumber)); |
244 | } | 222 | } |
diff --git a/wifi/1.2/IWifiStaIface.hal b/wifi/1.2/IWifiStaIface.hal index be4e5376..3a7f7772 100644 --- a/wifi/1.2/IWifiStaIface.hal +++ b/wifi/1.2/IWifiStaIface.hal | |||
@@ -17,6 +17,7 @@ | |||
17 | package android.hardware.wifi@1.2; | 17 | package android.hardware.wifi@1.2; |
18 | 18 | ||
19 | import @1.0::WifiStatus; | 19 | import @1.0::WifiStatus; |
20 | import @1.0::MacAddress; | ||
20 | import @1.0::IWifiStaIface; | 21 | import @1.0::IWifiStaIface; |
21 | 22 | ||
22 | /** | 23 | /** |
@@ -51,4 +52,17 @@ interface IWifiStaIface extends @1.0::IWifiStaIface { | |||
51 | * @see installApfPacketFilter() | 52 | * @see installApfPacketFilter() |
52 | */ | 53 | */ |
53 | readApfPacketFilterData() generates (WifiStatus status, vec<uint8_t> data); | 54 | readApfPacketFilterData() generates (WifiStatus status, vec<uint8_t> data); |
55 | |||
56 | /** | ||
57 | * Changes the MAC address of the Sta Interface to the given | ||
58 | * MAC address. | ||
59 | * | ||
60 | * @param mac MAC address to change into. | ||
61 | * @return status WifiStatus of the operation. | ||
62 | * Possible status codes: | ||
63 | * |WifiStatusCode.SUCCESS|, | ||
64 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, | ||
65 | * |WifiStatusCode.ERROR_UNKNOWN| | ||
66 | */ | ||
67 | setMacAddress(MacAddress mac) generates (WifiStatus status); | ||
54 | }; | 68 | }; |
diff --git a/wifi/1.2/default/wifi_sta_iface.cpp b/wifi/1.2/default/wifi_sta_iface.cpp index ab99daa2..daa56101 100644 --- a/wifi/1.2/default/wifi_sta_iface.cpp +++ b/wifi/1.2/default/wifi_sta_iface.cpp | |||
@@ -241,6 +241,13 @@ Return<void> WifiStaIface::getDebugRxPacketFates( | |||
241 | hidl_status_cb); | 241 | hidl_status_cb); |
242 | } | 242 | } |
243 | 243 | ||
244 | Return<void> WifiStaIface::setMacAddress(const hidl_array<uint8_t, 6>& mac, | ||
245 | setMacAddress_cb hidl_status_cb) { | ||
246 | return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, | ||
247 | &WifiStaIface::setMacAddressInternal, hidl_status_cb, | ||
248 | mac); | ||
249 | } | ||
250 | |||
244 | std::pair<WifiStatus, std::string> WifiStaIface::getNameInternal() { | 251 | std::pair<WifiStatus, std::string> WifiStaIface::getNameInternal() { |
245 | return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_}; | 252 | return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_}; |
246 | } | 253 | } |
@@ -594,6 +601,26 @@ WifiStaIface::getDebugRxPacketFatesInternal() { | |||
594 | return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_fates}; | 601 | return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_fates}; |
595 | } | 602 | } |
596 | 603 | ||
604 | WifiStatus WifiStaIface::setMacAddressInternal( | ||
605 | const std::array<uint8_t, 6>& mac) { | ||
606 | if (!iface_tool_.SetWifiUpState(false)) { | ||
607 | LOG(ERROR) << "SetWifiUpState(false) failed."; | ||
608 | return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); | ||
609 | } | ||
610 | |||
611 | if (!iface_tool_.SetMacAddress(ifname_.c_str(), mac)) { | ||
612 | LOG(ERROR) << "SetMacAddress failed."; | ||
613 | return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); | ||
614 | } | ||
615 | |||
616 | if (!iface_tool_.SetWifiUpState(true)) { | ||
617 | LOG(ERROR) << "SetWifiUpState(true) failed."; | ||
618 | return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); | ||
619 | } | ||
620 | LOG(DEBUG) << "Successfully SetMacAddress."; | ||
621 | return createWifiStatus(WifiStatusCode::SUCCESS); | ||
622 | } | ||
623 | |||
597 | } // namespace implementation | 624 | } // namespace implementation |
598 | } // namespace V1_2 | 625 | } // namespace V1_2 |
599 | } // namespace wifi | 626 | } // namespace wifi |
diff --git a/wifi/1.2/default/wifi_sta_iface.h b/wifi/1.2/default/wifi_sta_iface.h index a2128882..71cd17d3 100644 --- a/wifi/1.2/default/wifi_sta_iface.h +++ b/wifi/1.2/default/wifi_sta_iface.h | |||
@@ -21,6 +21,8 @@ | |||
21 | #include <android/hardware/wifi/1.0/IWifiStaIfaceEventCallback.h> | 21 | #include <android/hardware/wifi/1.0/IWifiStaIfaceEventCallback.h> |
22 | #include <android/hardware/wifi/1.2/IWifiStaIface.h> | 22 | #include <android/hardware/wifi/1.2/IWifiStaIface.h> |
23 | 23 | ||
24 | #include <wifi_system/interface_tool.h> | ||
25 | |||
24 | #include "hidl_callback_util.h" | 26 | #include "hidl_callback_util.h" |
25 | #include "wifi_legacy_hal.h" | 27 | #include "wifi_legacy_hal.h" |
26 | 28 | ||
@@ -103,6 +105,8 @@ class WifiStaIface : public V1_2::IWifiStaIface { | |||
103 | getDebugTxPacketFates_cb hidl_status_cb) override; | 105 | getDebugTxPacketFates_cb hidl_status_cb) override; |
104 | Return<void> getDebugRxPacketFates( | 106 | Return<void> getDebugRxPacketFates( |
105 | getDebugRxPacketFates_cb hidl_status_cb) override; | 107 | getDebugRxPacketFates_cb hidl_status_cb) override; |
108 | Return<void> setMacAddress(const hidl_array<uint8_t, 6>& mac, | ||
109 | setMacAddress_cb hidl_status_cb) override; | ||
106 | 110 | ||
107 | private: | 111 | private: |
108 | // Corresponding worker functions for the HIDL methods. | 112 | // Corresponding worker functions for the HIDL methods. |
@@ -146,12 +150,14 @@ class WifiStaIface : public V1_2::IWifiStaIface { | |||
146 | getDebugTxPacketFatesInternal(); | 150 | getDebugTxPacketFatesInternal(); |
147 | std::pair<WifiStatus, std::vector<WifiDebugRxPacketFateReport>> | 151 | std::pair<WifiStatus, std::vector<WifiDebugRxPacketFateReport>> |
148 | getDebugRxPacketFatesInternal(); | 152 | getDebugRxPacketFatesInternal(); |
153 | WifiStatus setMacAddressInternal(const std::array<uint8_t, 6>& mac); | ||
149 | 154 | ||
150 | std::string ifname_; | 155 | std::string ifname_; |
151 | std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_; | 156 | std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_; |
152 | bool is_valid_; | 157 | bool is_valid_; |
153 | hidl_callback_util::HidlCallbackHandler<IWifiStaIfaceEventCallback> | 158 | hidl_callback_util::HidlCallbackHandler<IWifiStaIfaceEventCallback> |
154 | event_cb_handler_; | 159 | event_cb_handler_; |
160 | wifi_system::InterfaceTool iface_tool_; | ||
155 | 161 | ||
156 | DISALLOW_COPY_AND_ASSIGN(WifiStaIface); | 162 | DISALLOW_COPY_AND_ASSIGN(WifiStaIface); |
157 | }; | 163 | }; |
diff --git a/wifi/1.2/vts/functional/Android.bp b/wifi/1.2/vts/functional/Android.bp index d85d42ec..918e4a45 100644 --- a/wifi/1.2/vts/functional/Android.bp +++ b/wifi/1.2/vts/functional/Android.bp | |||
@@ -20,6 +20,7 @@ cc_test { | |||
20 | srcs: [ | 20 | srcs: [ |
21 | "VtsHalWifiV1_2TargetTest.cpp", | 21 | "VtsHalWifiV1_2TargetTest.cpp", |
22 | "wifi_chip_hidl_test.cpp", | 22 | "wifi_chip_hidl_test.cpp", |
23 | "wifi_sta_iface_hidl_test.cpp", | ||
23 | ], | 24 | ], |
24 | static_libs: [ | 25 | static_libs: [ |
25 | "VtsHalWifiV1_0TargetTestUtil", | 26 | "VtsHalWifiV1_0TargetTestUtil", |
diff --git a/wifi/1.2/vts/functional/wifi_sta_iface_hidl_test.cpp b/wifi/1.2/vts/functional/wifi_sta_iface_hidl_test.cpp new file mode 100644 index 00000000..fd4a671c --- /dev/null +++ b/wifi/1.2/vts/functional/wifi_sta_iface_hidl_test.cpp | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2018 The Android Open Source Project | ||
3 | * | ||
4 | * Licensed under the Staache License, Version 2.0 (the "License"); | ||
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
7 | * | ||
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
15 | */ | ||
16 | |||
17 | #include <android-base/logging.h> | ||
18 | |||
19 | #include <android/hardware/wifi/1.2/IWifiStaIface.h> | ||
20 | |||
21 | #include <VtsHalHidlTargetTestBase.h> | ||
22 | |||
23 | #include "wifi_hidl_call_util.h" | ||
24 | #include "wifi_hidl_test_utils.h" | ||
25 | |||
26 | using ::android::sp; | ||
27 | using ::android::hardware::wifi::V1_2::IWifiStaIface; | ||
28 | using ::android::hardware::wifi::V1_0::WifiStatusCode; | ||
29 | |||
30 | /** | ||
31 | * Fixture to use for all STA Iface HIDL interface tests. | ||
32 | */ | ||
33 | class WifiStaIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase { | ||
34 | public: | ||
35 | virtual void SetUp() override { | ||
36 | wifi_sta_iface_ = IWifiStaIface::castFrom(getWifiStaIface()); | ||
37 | ASSERT_NE(nullptr, wifi_sta_iface_.get()); | ||
38 | } | ||
39 | |||
40 | virtual void TearDown() override { stopWifi(); } | ||
41 | |||
42 | protected: | ||
43 | sp<IWifiStaIface> wifi_sta_iface_; | ||
44 | }; | ||
45 | |||
46 | /* | ||
47 | * SetMacAddress: | ||
48 | * Ensures that calls to set MAC address will return a success status | ||
49 | * code. | ||
50 | */ | ||
51 | TEST_F(WifiStaIfaceHidlTest, SetMacAddress) { | ||
52 | const android::hardware::hidl_array<uint8_t, 6> kMac{ | ||
53 | std::array<uint8_t, 6>{{0x12, 0x22, 0x33, 0x52, 0x10, 0x41}}}; | ||
54 | EXPECT_EQ(WifiStatusCode::SUCCESS, | ||
55 | HIDL_INVOKE(wifi_sta_iface_, setMacAddress, kMac).code); | ||
56 | } | ||