1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #include "battery_status.h" 16 17 namespace OHOS::FileManagement::CloudSync { 18 constexpr int32_t DEFAULT_BATTERY_CAPCITY = 100; 19 SetChargingStatus(bool status)20void BatteryStatus::SetChargingStatus(bool status) 21 { 22 } 23 GetInitChargingStatus()24void BatteryStatus::GetInitChargingStatus() 25 { 26 } 27 GetCapacity()28int32_t BatteryStatus::GetCapacity() 29 { 30 int32_t capacity = DEFAULT_BATTERY_CAPCITY; 31 return capacity; 32 } 33 IsAllowUpload(bool forceFlag)34bool BatteryStatus::IsAllowUpload(bool forceFlag) 35 { 36 return true; 37 } 38 IsBatteryCapcityOkay()39bool BatteryStatus::IsBatteryCapcityOkay() 40 { 41 if (level_ == LEVEL_TOO_LOW) { 42 return false; 43 } 44 return true; 45 } 46 GetCapacityLevel()47BatteryStatus::CapacityLevel BatteryStatus::GetCapacityLevel() 48 { 49 return level_; 50 } 51 IsCharging()52bool BatteryStatus::IsCharging() 53 { 54 return true; 55 } 56 } // namespace OHOS::FileManagement::CloudSync