充电状态OTA不判断电量 2652/1 2652/head 2653/target/1
authorxue <2144439972@qq.com>
Sun, 2 Nov 2025 01:49:13 +0000 (09:49 +0800)
committerxue <2144439972@qq.com>
Sun, 2 Nov 2025 01:49:13 +0000 (09:49 +0800)
code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp

index 8a62942..3f3236d 100644 (file)
@@ -141,12 +141,16 @@ namespace OHOS
 
     bool OtaModel::IsBatterySufficient() const
     {
+        if(IsBatteryCharging() == true)//充电时,不检查电量
+        {
+            return true;
+        }
         float voltage = 0.0F;
         int Batteryvalue = 0;
 #ifdef SUPPORT_BATTERY_SERVICE
         Batteryvalue = battery_get_voltage(&voltage);
 #endif
-        return (Batteryvalue >= 50);
+        return (Batteryvalue >= 30);
     }
 
     bool OtaModel::IsMemorySufficient() const