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 ACCESS_APP_STATE_DATA_H 17 #define ACCESS_APP_STATE_DATA_H 18 19 #include <sys/types.h> 20 21 #include "parcel.h" 22 #include "iremote_object.h" 23 24 namespace OHOS { 25 namespace Security { 26 namespace AccessToken { 27 enum class ApplicationState { 28 APP_STATE_BEGIN = 0, 29 APP_STATE_CREATE = APP_STATE_BEGIN, 30 APP_STATE_READY, 31 APP_STATE_FOREGROUND, 32 APP_STATE_FOCUS, 33 APP_STATE_BACKGROUND, 34 APP_STATE_TERMINATED, 35 APP_STATE_END, 36 }; 37 struct AppStateData : public Parcelable { 38 virtual bool Marshalling(Parcel &parcel) const override; 39 static AppStateData *Unmarshalling(Parcel &parcel); 40 41 std::string bundleName; 42 int32_t pid = -1; 43 int32_t uid = 0; 44 int32_t callerUid = -1; 45 int32_t state = 0; 46 uint32_t accessTokenId = 0; 47 bool isFocused = false; 48 int32_t extensionType = 255; 49 std::vector<int32_t> renderPids; 50 std::string callerBundleName; 51 bool isSplitScreenMode = false; 52 bool isFloatingWindowMode = false; 53 bool isSpecifyTokenId = false; 54 int32_t appIndex = 0; 55 bool isPreloadModule = false; 56 bool isFromWindowFocusChanged = false; 57 }; 58 } // namespace AccessToken 59 } // namespace Security 60 } // namespace OHOS 61 62 #endif // ACCESS_APP_STATE_DATA_H 63