diff options
author | davidchao <davidchao@google.com> | 2021-01-12 00:45:20 +0800 |
---|---|---|
committer | davidchao <davidchao@google.com> | 2021-01-12 00:55:53 +0800 |
commit | 1b2acacc7a6ca47f4a15366f9d1f8889deabdd9c (patch) | |
tree | 45110a322d205faf66bb61704b46336efe128cd4 /thermal | |
parent | f41885ce916b1dbcb88066063ff8cf4ae0051746 (diff) | |
download | pixel-1b2acacc7a6ca47f4a15366f9d1f8889deabdd9c.tar.gz |
thermal: fix return empty map when the projects don't support power2state
For old projects, CoolingDevices are not parsed successfully if they
do not support power2state.
With this fix, CoolingDevices are parsed correctly.
$ adb shell lshal debug android.hardware.thermal@2.0::IThermal/default
getCurrentCoolingDevices:
Type: BATTERY Name: fcc CurrentValue: 0
Type: CPU Name: thermal-cpufreq-0 CurrentValue: 0
Type: CPU Name: thermal-cpufreq-6 CurrentValue: 0
Type: CPU Name: thermal-cpufreq-7 CurrentValue: 0
Type: GPU Name: thermal-devfreq-0 CurrentValue: 0
Bug: 176954523
Test: CoolingDevices are parsed correctly.
Change-Id: Id93f3283362f8748f5a9db910d4670f6fffb8414
Diffstat (limited to 'thermal')
-rw-r--r-- | thermal/utils/config_parser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/thermal/utils/config_parser.cpp b/thermal/utils/config_parser.cpp index d97513c8..85b2b718 100644 --- a/thermal/utils/config_parser.cpp +++ b/thermal/utils/config_parser.cpp @@ -603,8 +603,8 @@ std::map<std::string, CdevInfo> ParseCoolingDevice(std::string_view config_path) << "]: " << power2state[j]; } } else { - cooling_devices_parsed.clear(); - return cooling_devices_parsed; + LOG(INFO) << "CoolingDevice[" << i << "]'s Name: " << name + << " does not support Power2State"; } cooling_devices_parsed[name] = { |