From 8704be1ae1604b700dcb4780239b9694821ed04d Mon Sep 17 00:00:00 2001 From: Sebastiano Barezzi Date: Sat, 8 Jan 2022 21:49:11 +0100 Subject: [PATCH] interfaces: displayfeature: 1.0: Update Change-Id: Iaa192a481702c876722864b6a4f1f54f495622c9 Signed-off-by: Sebastiano Barezzi --- .../hardware/displayfeature/1.0/Android.bp | 2 ++ .../displayfeature/1.0/IDisplayFeature.hal | 13 ++++++++++-- .../1.0/IDisplayFeatureCallback.hal | 21 +++++++++++++++++++ .../hardware/displayfeature/1.0/types.hal | 21 +++++++++++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 interfaces/xiaomi/hardware/displayfeature/1.0/IDisplayFeatureCallback.hal create mode 100644 interfaces/xiaomi/hardware/displayfeature/1.0/types.hal diff --git a/interfaces/xiaomi/hardware/displayfeature/1.0/Android.bp b/interfaces/xiaomi/hardware/displayfeature/1.0/Android.bp index 7ba68f3..4ccd712 100644 --- a/interfaces/xiaomi/hardware/displayfeature/1.0/Android.bp +++ b/interfaces/xiaomi/hardware/displayfeature/1.0/Android.bp @@ -5,7 +5,9 @@ hidl_interface { root: "vendor.xiaomi", system_ext_specific: true, srcs: [ + "types.hal", "IDisplayFeature.hal", + "IDisplayFeatureCallback.hal", ], interfaces: [ "android.hidl.base@1.0", diff --git a/interfaces/xiaomi/hardware/displayfeature/1.0/IDisplayFeature.hal b/interfaces/xiaomi/hardware/displayfeature/1.0/IDisplayFeature.hal index 2e37d8d..dbf77d9 100644 --- a/interfaces/xiaomi/hardware/displayfeature/1.0/IDisplayFeature.hal +++ b/interfaces/xiaomi/hardware/displayfeature/1.0/IDisplayFeature.hal @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 The LineageOS Project + * Copyright (C) 2019-2022 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,15 @@ package vendor.xiaomi.hardware.displayfeature@1.0; +import @1.0::IDisplayFeatureCallback; + interface IDisplayFeature { - setFeature(uint32_t displayId, uint32_t mode, uint32_t value, uint32_t cookie); + notifyBrightness(uint32_t brightness); + registerCallback(uint32_t displayId, IDisplayFeatureCallback callback) generates (Status status); + sendMessage(uint32_t index, uint32_t value, string cmd); + sendPanelCommand(string cmd) generates (Status status); + sendPostProcCommand(uint32_t cmd, uint32_t value) generates (Status status); + sendRefreshCommand() generates (Status status); + setFeature(uint32_t displayId, uint32_t caseId, uint32_t modeId, uint32_t cookie) generates (Status status); + setFunction(uint32_t displayId, uint32_t caseId, uint32_t modeId, uint32_t cookie) generates (Status status); }; diff --git a/interfaces/xiaomi/hardware/displayfeature/1.0/IDisplayFeatureCallback.hal b/interfaces/xiaomi/hardware/displayfeature/1.0/IDisplayFeatureCallback.hal new file mode 100644 index 0000000..516117b --- /dev/null +++ b/interfaces/xiaomi/hardware/displayfeature/1.0/IDisplayFeatureCallback.hal @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2022 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package vendor.xiaomi.hardware.displayfeature@1.0; + +interface IDisplayFeatureCallback { + oneway displayfeatureInfoChanged(uint32_t caseId, uint32_t value, float red, float green, float blue); +}; diff --git a/interfaces/xiaomi/hardware/displayfeature/1.0/types.hal b/interfaces/xiaomi/hardware/displayfeature/1.0/types.hal new file mode 100644 index 0000000..db42ff5 --- /dev/null +++ b/interfaces/xiaomi/hardware/displayfeature/1.0/types.hal @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2022 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package vendor.xiaomi.hardware.displayfeature@1.0; + +// Based on observations using Ghidra, all methods that return Status +// only set the result of __android_log_print and cast it to Status. +enum Status : int32_t {};