1 /* 2 * Copyright (c) 2022 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 #ifndef FOUNDATION_EVENT_CESFWK_SERVICES_INCLUDE_OS_ACCOUNT_MANAGER_HELPER_H 17 #define FOUNDATION_EVENT_CESFWK_SERVICES_INCLUDE_OS_ACCOUNT_MANAGER_HELPER_H 18 19 #include <vector> 20 21 #include "errors.h" 22 #include "singleton.h" 23 24 namespace OHOS { 25 namespace EventFwk { 26 class OsAccountManagerHelper : public DelayedSingleton<OsAccountManagerHelper> { 27 public: OsAccountManagerHelper()28 OsAccountManagerHelper() {} ~OsAccountManagerHelper()29 virtual ~OsAccountManagerHelper() {} 30 31 /** 32 * Queries active operating system account IDs. 33 * 34 * @param ids Indicates the account IDs. 35 * @return Returns result code. 36 */ 37 ErrCode QueryActiveOsAccountIds(std::vector<int32_t>& ids); 38 39 /** 40 * Gets operating system account local ID from uid. 41 * 42 * @param uid Indicates the uid. 43 * @param ids Indicates the account ID. 44 * @return Returns result code. 45 */ 46 ErrCode GetOsAccountLocalIdFromUid(const int32_t uid, int32_t &id); 47 }; 48 } // namespace EventFwk 49 } // namespace OHOS 50 51 #endif // FOUNDATION_EVENT_CESFWK_SERVICES_INCLUDE_OS_ACCOUNT_MANAGER_HELPER_H