• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) Huawei Technologies Co., Ltd. 2024. All rights reserved.
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 "account_listener.h"
17 #include "account_observer.h"
18 #include "os_account_manager.h"
19 #include "media_log.h"
20 
21 namespace {
22     constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN_SCREENCAPTURE, "AccountListener"};
23 }
24 
25 
26 namespace OHOS {
27 namespace Media {
28 
AccountListener(const AccountSA::OsAccountSubscribeInfo & subscribeInfo)29 AccountListener::AccountListener(const AccountSA::OsAccountSubscribeInfo &subscribeInfo)
30     : AccountSA::OsAccountSubscriber(subscribeInfo)
31 {}
32 
~AccountListener()33 AccountListener::~AccountListener() {}
34 
OnAccountsSwitch(const int & newId,const int & oldId)35 void AccountListener::OnAccountsSwitch(const int &newId, const int &oldId)
36 {
37     MEDIA_LOGI("accounts switch");
38     AccountObserver::GetInstance().OnAccountsSwitch();
39 }
40 
41 } // namespace Media
42 } // namespace OHOS