1 /* 2 * Copyright (C) 2024 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 #ifndef FRAMEWORKS_INNERKITSIMPL_MEDIA_CLOUD_ENHANCEMENT_INCLUDE_CLOUD_ENHANCEMENT_DFX_GET_COUNT_H 17 #define FRAMEWORKS_INNERKITSIMPL_MEDIA_CLOUD_ENHANCEMENT_INCLUDE_CLOUD_ENHANCEMENT_DFX_GET_COUNT_H 18 19 #include <mutex> 20 #include <string> 21 #include <thread> 22 23 namespace OHOS { 24 namespace Media { 25 #define EXPORT __attribute__ ((visibility ("default"))) 26 27 enum class CloudEnhancementTaskCompletedType : int32_t { 28 SUCCESS, 29 FAILED, 30 EDIT_CANCELLATION, 31 DELETE_CANCELLATION, 32 SYNC_CANCELLATION, 33 }; 34 35 class CloudEnhancementGetCount { 36 public: 37 EXPORT static CloudEnhancementGetCount& GetInstance(); 38 EXPORT void AddStartTime(const std::string &photoId); 39 EXPORT void RemoveStartTime(const std::string &photoId); 40 EXPORT void Report(const std::string &completedType, const std::string &photoId); 41 EXPORT std::unordered_map<std::string, int64_t> GetStartTimes(); 42 43 private: 44 CloudEnhancementGetCount(); 45 ~CloudEnhancementGetCount(); 46 47 std::unordered_map<std::string, int64_t> startTimes_; 48 }; 49 50 } // namespace Media 51 } // namespace OHOS 52 #endif // FRAMEWORKS_INNERKITSIMPL_MEDIA_CLOUD_ENHANCEMENT_INCLUDE_CLOUD_ENHANCEMENT_DFX_GET_COUNT_H