blob: b369a44c9054717a0abde4f877b1f31beb638aca [file] [log] [blame]
Paul Keith7a5da242019-01-20 04:24:30 +01001/*
2 * Copyright (C) 2016 The CyanogenMod Project
dianlujitao39b87352020-06-24 18:00:02 +08003 * 2017-2020 The LineageOS Project
Paul Keith7a5da242019-01-20 04:24:30 +01004 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
dianlujitao44e1a1f2020-06-24 22:51:34 +080018#include "livedisplay/sdm/Utils.h"
LuK1337588974a2020-01-07 14:15:27 +010019
Paul Keith7a5da242019-01-20 04:24:30 +010020namespace vendor {
21namespace lineage {
22namespace livedisplay {
23namespace V2_0 {
24namespace sdm {
dianlujitao39b87352020-06-24 18:00:02 +080025namespace utils {
Paul Keith7a5da242019-01-20 04:24:30 +010026
dianlujitaobb5ff4a2020-06-24 19:07:04 +080027status_t CheckFeatureVersion(const std::shared_ptr<SDMController>& controller,
28 FeatureVerSw feature) {
dianlujitaob8a246a2020-06-24 18:15:21 +080029 SdmFeatureVersion version{};
30 status_t status = controller->getFeatureVersion(feature, &version);
31 if (status != android::OK) {
32 return status;
33 }
34
35 if (version.x <= 0 && version.y <= 0 && version.z <= 0) {
36 return android::BAD_VALUE;
37 }
38
39 return android::OK;
40}
41
dianlujitao39b87352020-06-24 18:00:02 +080042} // namespace utils
Paul Keith7a5da242019-01-20 04:24:30 +010043} // namespace sdm
44} // namespace V2_0
45} // namespace livedisplay
46} // namespace lineage
47} // namespace vendor