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 #ifndef OSACCOUNT_MANAGER_IMPL_H
16 #define OSACCOUNT_MANAGER_IMPL_H
17 
18 #include <cstdint>
19 #include <vector>
20 
21 namespace OHOS::AccountJsKit {
22     class OsAccountManagerImpl {
23     public:
24         static bool IsOsAccountConstraintEnabled(char *constraint, int32_t *errCode);
25         static int32_t GetOsAccountType(int32_t *errCode);
26         static bool CheckMultiOsAccountEnabled(int32_t *errCode);
27         static int32_t GetOsAccountLocalId(int32_t *errCode);
28         static int32_t GetActivatedOsAccountLocalIds(std::vector<int> &osAccountIds);
29         static uint32_t GetOsAccountCount(int32_t *errCode);
30         static char *QueryDistributedVirtualDeviceId(int32_t *errCode);
31         static int64_t GetSerialNumberForOsAccountLocalId(uint32_t localId, int32_t *errCode);
32         static int32_t GetOsAccountLocalIdForSerialNumber(int64_t serialNumber, int32_t *errCode);
33         static int32_t GetOsAccountLocalIdForDomain(char *domain, char *accountName, int32_t *errCode);
34         static int32_t GetOsAccountLocalIdForUid(int32_t uid, int32_t *errCode);
35         static char *GetOsAccountName(int32_t *errCode);
36         static bool IsOsAccountUnlocked(int32_t *errCode);
37 
38         static char *MallocCString(const std::string &origin);
39 
40     private:
41     };
42 }
43 #endif // OSACCOUNT_MANAGER_IMPL_H