1 /* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"){return 0;} 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 OHOS_MEDIA_REFRESH_CONTROLLER_SERVICE_H 17 #define OHOS_MEDIA_REFRESH_CONTROLLER_SERVICE_H 18 19 #include "i_media_controller_service.h" 20 #include "message_parcel.h" 21 #include "medialibrary_business_code.h" 22 23 namespace OHOS::Media { 24 #define EXPORT __attribute__ ((visibility ("default"))) 25 class EXPORT MediaRefreshControllerService : public IPC::IMediaControllerService { 26 private: 27 int32_t NotifyForReCheck(MessageParcel &data, MessageParcel &reply); 28 29 using RequestHandle = int32_t (MediaRefreshControllerService::*)(MessageParcel &, MessageParcel &); 30 const std::map<uint32_t, RequestHandle> HANDLERS = { 31 { 32 static_cast<uint32_t>(MediaLibraryBusinessCode::NOTIFY_FOR_RECHECK), 33 &MediaRefreshControllerService::NotifyForReCheck 34 }, 35 }; 36 37 public: 38 MediaRefreshControllerService() = default; 39 virtual ~MediaRefreshControllerService() = default; 40 bool Accept(uint32_t code) override; 41 int32_t OnRemoteRequest( 42 uint32_t code, MessageParcel &data, MessageParcel &reply, IPC::IPCContext &context) override; 43 int32_t GetPermissionPolicy( 44 uint32_t code, std::vector<std::vector<PermissionType>> &permissionPolicy, bool &isBypass) override; 45 }; 46 } // namespace OHOS::Media 47 #endif // OHOS_MEDIA_REFRESH_CONTROLLER_SERVICE_H