179a732c7Sopenharmony_ci/*
279a732c7Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
379a732c7Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
479a732c7Sopenharmony_ci * you may not use this file except in compliance with the License.
579a732c7Sopenharmony_ci * You may obtain a copy of the License at
679a732c7Sopenharmony_ci *
779a732c7Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0
879a732c7Sopenharmony_ci *
979a732c7Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1079a732c7Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1179a732c7Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1279a732c7Sopenharmony_ci * See the License for the specific language governing permissions and
1379a732c7Sopenharmony_ci * limitations under the License.
1479a732c7Sopenharmony_ci */
1579a732c7Sopenharmony_ci
1679a732c7Sopenharmony_ci#ifndef OHOS_DM_MULTIPLE_USER_CONNECTOR_H
1779a732c7Sopenharmony_ci#define OHOS_DM_MULTIPLE_USER_CONNECTOR_H
1879a732c7Sopenharmony_ci
1979a732c7Sopenharmony_ci#include <cstdint>
2079a732c7Sopenharmony_ci#include <mutex>
2179a732c7Sopenharmony_ci#include <string>
2279a732c7Sopenharmony_cinamespace OHOS {
2379a732c7Sopenharmony_cinamespace DistributedHardware {
2479a732c7Sopenharmony_ciclass MultipleUserConnector {
2579a732c7Sopenharmony_cipublic:
2679a732c7Sopenharmony_ci    /**
2779a732c7Sopenharmony_ci     * @tc.name: MultipleUserConnector::GetCurrentAccountUserID
2879a732c7Sopenharmony_ci     * @tc.desc: Get Current Account UserID of the Multiple User Connector
2979a732c7Sopenharmony_ci     * @tc.type: FUNC
3079a732c7Sopenharmony_ci     */
3179a732c7Sopenharmony_ci    static int32_t GetCurrentAccountUserID(void);
3279a732c7Sopenharmony_ci
3379a732c7Sopenharmony_ci    /**
3479a732c7Sopenharmony_ci     * @tc.name: MultipleUserConnector::SetSwitchOldUserId
3579a732c7Sopenharmony_ci     * @tc.desc: Set Switch Old UserId of the Multiple User Connector
3679a732c7Sopenharmony_ci     * @tc.type: FUNC
3779a732c7Sopenharmony_ci     */
3879a732c7Sopenharmony_ci    static void SetSwitchOldUserId(int32_t userId);
3979a732c7Sopenharmony_ci
4079a732c7Sopenharmony_ci    /**
4179a732c7Sopenharmony_ci     * @tc.name: MultipleUserConnector::GetSwitchOldUserId
4279a732c7Sopenharmony_ci     * @tc.desc: Get Switc hOld UserId of the Multiple User Connector
4379a732c7Sopenharmony_ci     * @tc.type: FUNC
4479a732c7Sopenharmony_ci     */
4579a732c7Sopenharmony_ci    static int32_t GetSwitchOldUserId(void);
4679a732c7Sopenharmony_ci
4779a732c7Sopenharmony_ci    /**
4879a732c7Sopenharmony_ci     * @tc.name: MultipleUserConnector::GetOhosAccountId
4979a732c7Sopenharmony_ci     * @tc.desc: Get Current AccountId of the Multiple User Connector
5079a732c7Sopenharmony_ci     * @tc.type: FUNC
5179a732c7Sopenharmony_ci     */
5279a732c7Sopenharmony_ci    static std::string GetOhosAccountId(void);
5379a732c7Sopenharmony_ci
5479a732c7Sopenharmony_ci    /**
5579a732c7Sopenharmony_ci     * @tc.name: MultipleUserConnector::SetSwitchOldAccountId
5679a732c7Sopenharmony_ci     * @tc.desc: Set Switch Old UserId of the Multiple User Connector
5779a732c7Sopenharmony_ci     * @tc.type: FUNC
5879a732c7Sopenharmony_ci     */
5979a732c7Sopenharmony_ci    static void SetSwitchOldAccountId(std::string accountId);
6079a732c7Sopenharmony_ci
6179a732c7Sopenharmony_ci    /**
6279a732c7Sopenharmony_ci     * @tc.name: MultipleUserConnector::GetSwitchOldAccountId
6379a732c7Sopenharmony_ci     * @tc.desc: Get Switc hOld UserId of the Multiple User Connector
6479a732c7Sopenharmony_ci     * @tc.type: FUNC
6579a732c7Sopenharmony_ci     */
6679a732c7Sopenharmony_ci    static std::string GetSwitchOldAccountId(void);
6779a732c7Sopenharmony_ci
6879a732c7Sopenharmony_ci    /**
6979a732c7Sopenharmony_ci     * @tc.name: MultipleUserConnector::SetSwitchOldAccountName
7079a732c7Sopenharmony_ci     * @tc.desc: Set Switch Old AccountName of the Multiple User Connector
7179a732c7Sopenharmony_ci     * @tc.type: FUNC
7279a732c7Sopenharmony_ci     */
7379a732c7Sopenharmony_ci    static void SetSwitchOldAccountName(std::string accountName);
7479a732c7Sopenharmony_ci
7579a732c7Sopenharmony_ci    /**
7679a732c7Sopenharmony_ci     * @tc.name: MultipleUserConnector::GetOhosAccountName
7779a732c7Sopenharmony_ci     * @tc.desc: Get Current AccountName of the Multiple User Connector
7879a732c7Sopenharmony_ci     * @tc.type: FUNC
7979a732c7Sopenharmony_ci     */
8079a732c7Sopenharmony_ci    static std::string GetOhosAccountName(void);
8179a732c7Sopenharmony_ci
8279a732c7Sopenharmony_ci    /**
8379a732c7Sopenharmony_ci     * @tc.name: MultipleUserConnector::GetSwitchOldAccountName
8479a732c7Sopenharmony_ci     * @tc.desc: Get Switc Old AccountName of the Multiple User Connector
8579a732c7Sopenharmony_ci     * @tc.type: FUNC
8679a732c7Sopenharmony_ci     */
8779a732c7Sopenharmony_ci    static std::string GetSwitchOldAccountName(void);
8879a732c7Sopenharmony_ciprivate:
8979a732c7Sopenharmony_ci    static int32_t oldUserId_;
9079a732c7Sopenharmony_ci    static std::string accountId_;
9179a732c7Sopenharmony_ci    static std::string accountName_;
9279a732c7Sopenharmony_ci    static std::mutex lock_;
9379a732c7Sopenharmony_ci};
9479a732c7Sopenharmony_ci} // namespace DistributedHardware
9579a732c7Sopenharmony_ci} // namespace OHOS
9679a732c7Sopenharmony_ci#endif // OHOS_DM_MULTIPLE_USER_CONNECTOR_H
97