diff options
author | Yunhee Seo <yuni.seo@samsung.com> | 2024-08-14 13:48:03 +0900 |
---|---|---|
committer | Yunhee Seo <yuni.seo@samsung.com> | 2024-08-14 15:27:01 +0900 |
commit | 6299d568e844a3066fe8acba25ff0a26fafc226a (patch) | |
tree | 755fd2a3ca28164ab9a6cd7eb2a1d52558dd245f | |
parent | 3280450adf2426aa467f38791fd223078057a1fd (diff) | |
download | device-tm1-accepted/tizen_7.0_unified.tar.gz device-tm1-accepted/tizen_7.0_unified.tar.bz2 device-tm1-accepted/tizen_7.0_unified.zip |
battery: Add handling battery health Under voltage caseaccepted/tizen/7.0/unified/20240821.161634tizen_7.0accepted/tizen_7.0_unified
When the battery health was get, "Under voltage" health was not handled.
If the value of "Under voltage" is not handled, despite obtaining a value,
it will be treated as an error at the capi level.
To avoid above situation, "Under voltage" should be changed to the proper value.
Thus, this handling is necessary.
Change-Id: Ic5393df2e4b037014b6490fe63f1842ac65f6062
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
-rw-r--r-- | hw/battery/battery.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/battery/battery.c b/hw/battery/battery.c index c16fe50..41f6274 100644 --- a/hw/battery/battery.c +++ b/hw/battery/battery.c @@ -238,6 +238,10 @@ static int battery_get_current_state( return ret; } remove_not_string(health); + if (strncmp(health, "Under voltage", sizeof("Under voltage")) == 0) { + strncpy(health, "Dead", sizeof(health) - 1); + health[sizeof(health) - 1] = '\0'; + } info.health = health; ret = get_power_source(&power_source); |