Paul Keith | 7a5da24 | 2019-01-20 04:24:30 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The CyanogenMod Project |
dianlujitao | 39b8735 | 2020-06-24 18:00:02 +0800 | [diff] [blame] | 3 | * 2017-2020 The LineageOS Project |
Paul Keith | 7a5da24 | 2019-01-20 04:24:30 +0100 | [diff] [blame] | 4 | * |
| 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 | |
dianlujitao | 44e1a1f | 2020-06-24 22:51:34 +0800 | [diff] [blame] | 18 | #include "livedisplay/sdm/Utils.h" |
LuK1337 | 588974a | 2020-01-07 14:15:27 +0100 | [diff] [blame] | 19 | |
Paul Keith | 7a5da24 | 2019-01-20 04:24:30 +0100 | [diff] [blame] | 20 | namespace vendor { |
| 21 | namespace lineage { |
| 22 | namespace livedisplay { |
| 23 | namespace V2_0 { |
| 24 | namespace sdm { |
dianlujitao | 39b8735 | 2020-06-24 18:00:02 +0800 | [diff] [blame] | 25 | namespace utils { |
Paul Keith | 7a5da24 | 2019-01-20 04:24:30 +0100 | [diff] [blame] | 26 | |
dianlujitao | bb5ff4a | 2020-06-24 19:07:04 +0800 | [diff] [blame] | 27 | status_t CheckFeatureVersion(const std::shared_ptr<SDMController>& controller, |
| 28 | FeatureVerSw feature) { |
dianlujitao | b8a246a | 2020-06-24 18:15:21 +0800 | [diff] [blame] | 29 | 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 | |
dianlujitao | 39b8735 | 2020-06-24 18:00:02 +0800 | [diff] [blame] | 42 | } // namespace utils |
Paul Keith | 7a5da24 | 2019-01-20 04:24:30 +0100 | [diff] [blame] | 43 | } // namespace sdm |
| 44 | } // namespace V2_0 |
| 45 | } // namespace livedisplay |
| 46 | } // namespace lineage |
| 47 | } // namespace vendor |