15ba71b47Sopenharmony_ci/*
25ba71b47Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
35ba71b47Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
45ba71b47Sopenharmony_ci * you may not use this file except in compliance with the License.
55ba71b47Sopenharmony_ci * You may obtain a copy of the License at
65ba71b47Sopenharmony_ci *
75ba71b47Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
85ba71b47Sopenharmony_ci *
95ba71b47Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
105ba71b47Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
115ba71b47Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
125ba71b47Sopenharmony_ci * See the License for the specific language governing permissions and
135ba71b47Sopenharmony_ci * limitations under the License.
145ba71b47Sopenharmony_ci */
155ba71b47Sopenharmony_ci
165ba71b47Sopenharmony_ci#ifndef LOCAL_ABILITYS_H_
175ba71b47Sopenharmony_ci#define LOCAL_ABILITYS_H_
185ba71b47Sopenharmony_ci
195ba71b47Sopenharmony_ci#include <map>
205ba71b47Sopenharmony_ci#include <mutex>
215ba71b47Sopenharmony_ci#include <string>
225ba71b47Sopenharmony_ci#include "hilog/log.h"
235ba71b47Sopenharmony_ci#include "iremote_object.h"
245ba71b47Sopenharmony_ci
255ba71b47Sopenharmony_cinamespace OHOS {
265ba71b47Sopenharmony_ciclass LocalAbilitys {
275ba71b47Sopenharmony_cipublic:
285ba71b47Sopenharmony_ci    static LocalAbilitys& GetInstance();
295ba71b47Sopenharmony_ci    void AddAbility(int32_t systemAbilityId, const sptr<IRemoteObject>& ability);
305ba71b47Sopenharmony_ci    sptr<IRemoteObject> GetAbility(int32_t systemAbilityId);
315ba71b47Sopenharmony_ci    void RemoveAbility(int32_t systemAbilityId);
325ba71b47Sopenharmony_ci
335ba71b47Sopenharmony_ciprivate:
345ba71b47Sopenharmony_ci    LocalAbilitys() = default;
355ba71b47Sopenharmony_ci    ~LocalAbilitys() = default;
365ba71b47Sopenharmony_ci
375ba71b47Sopenharmony_ci    std::mutex localSALock_;
385ba71b47Sopenharmony_ci    std::map<int32_t, sptr<IRemoteObject>> localSAMap_;
395ba71b47Sopenharmony_ci};
405ba71b47Sopenharmony_ci}
415ba71b47Sopenharmony_ci#endif // !defined(LOCAL_ABILITYS_H_)
42