1 /* 2 * Copyright (c) 2022-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 /** 17 * @addtogroup Privacy 18 * @{ 19 * 20 * @brief Provides sensitive data access management. 21 * 22 * @since 8.0 23 * @version 8.0 24 */ 25 26 /** 27 * @file active_change_response_info.h 28 * 29 * @brief Declares enum ActiveChangeType and struct ActiveChangeResponse. 30 * 31 * @since 8.0 32 * @version 8.0 33 */ 34 35 #ifndef ACTIVE_CHANGE_RESPONSE_INFO_H 36 #define ACTIVE_CHANGE_RESPONSE_INFO_H 37 38 #include <string> 39 #include <vector> 40 41 #include "access_token.h" 42 #include "permission_used_type.h" 43 44 namespace OHOS { 45 namespace Security { 46 namespace AccessToken { 47 /** 48 * @brief Permission active state state values 49 */ 50 enum ActiveChangeType { 51 PERM_INACTIVE = 0, 52 PERM_ACTIVE_IN_FOREGROUND = 1, 53 PERM_ACTIVE_IN_BACKGROUND = 2, 54 PERM_TEMPORARY_CALL = 3, 55 }; 56 57 /** 58 * @brief Permission lockscreen state values 59 */ 60 enum LockScreenStatusChangeType { 61 PERM_ACTIVE_IN_UNLOCKED = 1, 62 PERM_ACTIVE_IN_LOCKED = 2, 63 }; 64 65 /** 66 * @brief Permission active state change response struct 67 */ 68 struct ActiveChangeResponse { 69 AccessTokenID callingTokenID; 70 AccessTokenID tokenID; 71 std::string permissionName; 72 std::string deviceId; 73 /** 74 * permission active change type, for details about the valid values, 75 * see the definition above. 76 */ 77 ActiveChangeType type; 78 PermissionUsedType usedType; 79 int32_t pid; 80 }; 81 } // namespace AccessToken 82 } // namespace Security 83 } // namespace OHOS 84 85 #endif // ACTIVE_CHANGE_RESPONSE_INFO_H