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 16 #ifndef DISTRIBUTED_NOTIFICATION_SERVICE_SERVICES_REMINDER_INCLUDE_REMINDER_OS_ACCOUNT_MANAGER_HELPER_H 17 #define DISTRIBUTED_NOTIFICATION_SERVICE_SERVICES_REMINDER_INCLUDE_REMINDER_OS_ACCOUNT_MANAGER_HELPER_H 18 19 #include "errors.h" 20 #include "singleton.h" 21 #include <vector> 22 23 namespace OHOS { 24 namespace Notification { 25 class ReminderOsAccountManagerHelper : public DelayedSingleton<ReminderOsAccountManagerHelper> { 26 public: 27 28 ReminderOsAccountManagerHelper() = default; 29 ~ReminderOsAccountManagerHelper() = default; 30 31 /** 32 * @brief Get OsAccountManagerHelper instance object. 33 */ 34 static ReminderOsAccountManagerHelper &GetInstance(); 35 36 /** 37 * Gets operating system account local ID from uid. 38 * 39 * @param uid Indicates the uid. 40 * @param id Indicates the account ID. 41 * @return Returns result code. 42 */ 43 ErrCode GetOsAccountLocalIdFromUid(const int32_t uid, int32_t &id); 44 45 /** 46 * Gets operating system account local ID from current active. 47 * 48 * @param id Indicates the current active account ID. 49 * @return Returns result code. 50 */ 51 ErrCode GetCurrentActiveUserId(int32_t &id); 52 }; 53 } // namespace OHOS 54 } // namespace Notification 55 #endif // DISTRIBUTED_NOTIFICATION_SERVICE_SERVICES_REMINDER_INCLUDE_REMINDER_OS_ACCOUNT_MANAGER_HELPER_H