commit | d4918ea19499d6229abd95ff342d84f1194a1856 | [log] [tgz] |
---|---|---|
author | felipeal <felipeal@google.com> | Tue Sep 15 04:04:42 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Sep 15 04:04:42 2020 +0000 |
tree | 679c5857bb27f825fe027bdd3c8834d3124a84ae | |
parent | dab2441bcb190bfdb1ca79c7e9218206abf982eb [diff] | |
parent | 645bd8a6fa4a6de8007d87b83be520adb197ce3b [diff] |
Fixed EmulatedUserHal so it supports SwitchUserMessageType::VEHICLE_REQUEST am: 5d40b783d1 am: 645bd8a6fa Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1425311 Change-Id: Ic828eb136b8f686ada88166a56695c78d336d520
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp index ea38cb3..d0011a8 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp
@@ -155,6 +155,15 @@ } if (value.areaId != 0) { + if (value.value.int32Values.size() >= 2 && + static_cast<SwitchUserMessageType>(value.value.int32Values[1]) == + SwitchUserMessageType::VEHICLE_REQUEST) { + // User HAL can also request a user switch, so we need to check it first + ALOGD("set(SWITCH_USER) called from lshal to emulate a vehicle request: %s", + toString(value).c_str()); + return std::unique_ptr<VehiclePropValue>(new VehiclePropValue(value)); + } + // Otherwise, we store it ALOGD("set(SWITCH_USER) called from lshal; storing it: %s", toString(value).c_str()); mSwitchUserResponseFromCmd.reset(new VehiclePropValue(value)); return {};