• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 
16 #include "hidden_asset_helper.h"
17 
18 namespace OHOS {
19 namespace Media::AccurateRefresh {
20 
IsAsset(const PhotoAssetChangeInfo & assetInfo)21 bool HiddenAssetHelper::IsAsset(const PhotoAssetChangeInfo &assetInfo)
22 {
23     return AlbumAssetHelper::IsCommonSystemAsset(assetInfo, true);
24 }
25 
IsVideoAsset(const PhotoAssetChangeInfo & assetInfo)26 bool HiddenAssetHelper::IsVideoAsset(const PhotoAssetChangeInfo &assetInfo)
27 {
28     return IsAsset(assetInfo) && AlbumAssetHelper::IsVideoAsset(assetInfo);
29 }
30 
IsHiddenAsset(const PhotoAssetChangeInfo & assetInfo)31 bool HiddenAssetHelper::IsHiddenAsset(const PhotoAssetChangeInfo &assetInfo)
32 {
33     return IsAsset(assetInfo);
34 }
IsNewerAsset(const PhotoAssetChangeInfo & compareAssetInfo,const PhotoAssetChangeInfo & currentAssetInfo)35 bool HiddenAssetHelper::IsNewerAsset(const PhotoAssetChangeInfo &compareAssetInfo,
36     const PhotoAssetChangeInfo &currentAssetInfo)
37 {
38     return IsNewerHiddenAsset(compareAssetInfo, currentAssetInfo);
39 }
IsNewerHiddenAsset(const PhotoAssetChangeInfo & compareAssetInfo,const PhotoAssetChangeInfo & currentAssetInfo)40 bool HiddenAssetHelper::IsNewerHiddenAsset(const PhotoAssetChangeInfo &compareAssetInfo,
41     const PhotoAssetChangeInfo &currentAssetInfo)
42 {
43     return IsHiddenAsset(compareAssetInfo) && IsHiddenAsset(currentAssetInfo) &&
44         AlbumAssetHelper::IsNewerByHiddenTime(compareAssetInfo, currentAssetInfo);
45 }
46 
47 } // namespace Media
48 } // namespace OHOS