• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023-2023 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  * Description: supply cast session manager service proxy class
15  * Author: zhuzhibin
16  * Create: 2022-10-25
17  */
18 
19 #include "cast_engine_log.h"
20 #include "cast_engine_common.h"
21 #include "system_ability_definition.h"
22 #include "cast_session_manager.h"
23 
24 namespace OHOS {
25 namespace CastEngine {
26 namespace CastEngineClient {
27 DEFINE_CAST_ENGINE_LABEL("Cast-Client-LoadServiceCallback");
28 
OnLoadSystemAbilitySuccess(int32_t systemAbilityId,const sptr<IRemoteObject> & remoteObject)29 void CastSessionManager::CastEngineServiceLoadCallback::OnLoadSystemAbilitySuccess(int32_t systemAbilityId,
30     const sptr<IRemoteObject> &remoteObject)
31 {
32     CLOGI("In systemAbilityId: %d", systemAbilityId);
33     if (systemAbilityId != CAST_ENGINE_SA_ID) {
34         CLOGE("Start aystemabilityId is not sinkSAId!");
35         return;
36     }
37 
38     CastSessionManager::GetInstance().NotifyServiceLoadResult(remoteObject);
39 }
40 
OnLoadSystemAbilityFail(int32_t systemAbilityId)41 void CastSessionManager::CastEngineServiceLoadCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId)
42 {
43     CLOGI("In systemAbilityId: %d.", systemAbilityId);
44     if (systemAbilityId != CAST_ENGINE_SA_ID) {
45         CLOGE("Start systemAbilityId is not sinkSAId!");
46         return;
47     }
48 
49     CastSessionManager::GetInstance().NotifyServiceLoadResult(nullptr);
50 }
51 } // namespace CastEngineClient
52 } // namespace CastEngine
53 } // namespace OHOS