1 /* 2 * Copyright (c) 2023 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 POWERMGR_IRUNNING_LOCK_ACTION_INFO_H 17 #define POWERMGR_IRUNNING_LOCK_ACTION_INFO_H 18 19 #include "running_lock_info.h" 20 21 namespace OHOS { 22 namespace PowerMgr { 23 /** 24 * Enumerates runninglock operation return status 25 */ 26 enum RunningLockStatus : int32_t { 27 /** 28 * RunningLock status: runninglock operation is successful 29 */ 30 RUNNINGLOCK_SUCCESS = 0, 31 /** 32 * RunningLock status: runninglock operation is failed 33 */ 34 RUNNINGLOCK_FAILURE = -1, 35 /** 36 * RunningLock status: runninglock operation is not supported, not found the runninglock 37 */ 38 RUNNINGLOCK_NOT_SUPPORT = -2, 39 /** 40 * RunningLock status: invalid input parameter for runninglock operation 41 */ 42 RUNNINGLOCK_INVALID_PARAM = -3, 43 }; 44 45 /** 46 * Runninglock parameter: used to convert to HDI RunningLockInfo 47 */ 48 struct RunningLockParam { 49 std::string name; 50 RunningLockType type = RunningLockType::RUNNINGLOCK_BUTT; 51 int32_t timeoutMs = -1; 52 int32_t pid = 0; 53 int32_t uid = 0; 54 }; 55 } // namespace PowerMgr 56 } // namespace OHOS 57 #endif // POWERMGR_IRUNNING_LOCK_ACTION_INFO_H 58