• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "font_sa_load_callback.h"
17 
18 #include <singleton.h>
19 #include "font_hilog.h"
20 #include "font_service_load_manager.h"
21 #include "iremote_object.h"
22 
23 namespace OHOS {
24 namespace Global {
25 namespace FontManager {
OnLoadSystemAbilitySuccess(int32_t systemAbilityId,const sptr<IRemoteObject> & remoteObject)26 void FontSALoadCallback::OnLoadSystemAbilitySuccess(int32_t systemAbilityId,
27     const sptr<IRemoteObject> &remoteObject)
28 {
29     auto loadMgr = DelayedSingleton<FontServiceLoadManager>::GetInstance();
30     if (loadMgr == nullptr) {
31         FONT_LOGE("FontSALoadCallback::OnLoadSystemAbilitySuccess get load manager failed.");
32         return;
33     }
34     loadMgr->OnLoadSystemAbilitySuccess();
35 }
36 
OnLoadSystemAbilityFail(int32_t systemAbilityId)37 void FontSALoadCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId)
38 {
39     auto loadMgr = DelayedSingleton<FontServiceLoadManager>::GetInstance();
40     if (loadMgr == nullptr) {
41         FONT_LOGE("FontSALoadCallback::OnLoadSystemAbilityFail get load manager failed.");
42         return;
43     }
44     loadMgr->OnLoadSystemAbilityFail();
45 }
46 } // namespace FontManager
47 } // namespace Global
48 } // namespace OHOS