diff options
author | Barış Kaya <bkaya@google.com> | 2023-09-20 13:25:00 +0100 |
---|---|---|
committer | Barış Kaya <bkaya@google.com> | 2023-09-20 13:32:02 +0100 |
commit | dfbf5867782453579c3071de2287ce5a2b32aab9 (patch) | |
tree | 11d3dc1410c91fa73aa41e6b114a22b45defb33e | |
parent | 6a008f161d9130eb96b7c6c45dfd721e049d681b (diff) | |
download | gamesdk-dfbf5867782453579c3071de2287ce5a2b32aab9.tar.gz |
Add a new error message to predictQualityLevels.
Bug: b/300512786
Test: Tested using experimentsdemo
Change-Id: I03002431fa293c7d65679d4de9ef20ffe21294fa
-rw-r--r-- | games-performance-tuner/http_backend/predict_quality_levels.cpp | 6 | ||||
-rw-r--r-- | include/tuningfork/tuningfork.h | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/games-performance-tuner/http_backend/predict_quality_levels.cpp b/games-performance-tuner/http_backend/predict_quality_levels.cpp index 8419ec66..ae6ee4bc 100644 --- a/games-performance-tuner/http_backend/predict_quality_levels.cpp +++ b/games-performance-tuner/http_backend/predict_quality_levels.cpp @@ -65,10 +65,14 @@ static TuningFork_ErrorCode DecodeResponse(const std::string& response, if (jresponse.find("qualityLevels") == jresponse.end()) { ALOGE("Quality levels not found in response"); - return TUNINGFORK_ERROR_PREDICT_QUALITY_LEVELS_PARSE_ERROR; + return TUNINGFORK_ERROR_PREDICT_QUALITY_LEVELS_INSUFFICIENT_DATA; } Json::array quality_levels = jresponse["qualityLevels"].array_items(); + if (quality_levels.empty()) { + ALOGE("No quality levels reported"); + return TUNINGFORK_ERROR_PREDICT_QUALITY_LEVELS_INSUFFICIENT_DATA; + } for (auto& quality_level : quality_levels) { // Fetch the fidelity parameters first for this level ProtobufSerialization fps; diff --git a/include/tuningfork/tuningfork.h b/include/tuningfork/tuningfork.h index fc28e2ed..a871c137 100644 --- a/include/tuningfork/tuningfork.h +++ b/include/tuningfork/tuningfork.h @@ -223,6 +223,10 @@ typedef enum TuningFork_ErrorCode { TUNINGFORK_ERROR_PREDICT_QUALITY_LEVELS_RESPONSE_ERROR = 41, ///< The response from predictQualityLevels was not a success ///< code + TUNINGFORK_ERROR_PREDICT_QUALITY_LEVELS_INSUFFICIENT_DATA = + 42, ///< There wasn't enough data to make a successful quality level + ///< prediction. + // Error codes 100-150 are reserved for engines integrations. } TuningFork_ErrorCode; |