增加获取云盘空间的接口

Signed-off-by: 崔季风 <cuijifeng@huawei.com>
This commit is contained in:
崔季风 2024-11-12 22:05:22 +08:00
parent e800308253
commit 4151843bb3
6 changed files with 19 additions and 0 deletions

View File

@ -23,6 +23,7 @@ namespace OHOS::FileManagement::CloudFile {
class CloudFileKitImpl final : public CloudFileKit {
public:
int32_t GetCloudUserInfo(const int32_t userId, CloudUserInfo &userInfo) override;
uint64_t GetRemainSpace(const int32_t userId) override;
int32_t GetAppSwitchStatus(const std::string &bundleName, const int32_t userId, bool &switchStatus) override;
int32_t ResolveNotificationEvent(const int32_t userId,
const std::string &extraData,

View File

@ -37,6 +37,11 @@ int32_t CloudFileKitImpl::GetCloudUserInfo(const int32_t userId, CloudUserInfo &
return E_OK;
}
uint64_t CloudFileKitImpl::GetRemainSpace(const int32_t userId)
{
return E_OK;
}
int32_t CloudFileKitImpl::GetAppSwitchStatus(const std::string &bundleName,
const int32_t userId,
bool &switchStatus)

View File

@ -39,6 +39,11 @@ int32_t CloudFileKit::GetCloudUserInfo(const int32_t userId, CloudUserInfo &user
return E_OK;
}
uint64_t CloudFileKit::GetRemainSpace(const int32_t userId)
{
return E_OK;
}
int32_t CloudFileKit::GetAppSwitchStatus(const std::string &bundleName, const int32_t userId, bool &switchStatus)
{
switchStatus = true;

View File

@ -44,6 +44,12 @@ int32_t CloudStatus::GetCurrentCloudInfo(const std::string &bundleName, const in
return E_OK;
}
uint64_t CloudStatus::GetCurrentRemainSpace(const int32_t userId)
{
auto instance = CloudFile::CloudFileKit::GetInstance();
return instance->GetRemainSpace(userId);
}
bool CloudStatus::IsCloudStatusOkay(const std::string &bundleName, const int32_t userId)
{
std::lock_guard<std::mutex> lock(mutex_);

View File

@ -34,6 +34,7 @@ public:
virtual ~CloudFileKit() = default;
virtual int32_t GetCloudUserInfo(const int32_t userId, CloudUserInfo &userInfo);
virtual uint64_t GetRemainSpace(const int32_t userId);
virtual int32_t GetAppSwitchStatus(const std::string &bundleName, const int32_t userId, bool &switchStatus);
virtual int32_t ResolveNotificationEvent(const int32_t userId,
const std::string &extraData,

View File

@ -26,6 +26,7 @@ namespace OHOS::FileManagement::CloudSync {
class CloudStatus {
public:
static int32_t GetCurrentCloudInfo(const std::string &bundleName, const int32_t userId);
static uint64_t GetCurrentRemainSpace(const int32_t userId);
static bool IsCloudStatusOkay(const std::string &bundleName, const int32_t userId);
static int32_t ChangeAppSwitch(const std::string &bundleName, const int32_t userId, bool appSwitchStatus);
static bool IsAccountIdChanged(const std::string &accountId);