• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 OHOS_PRIVACY_APP_STATE_DATA_H
17 #define OHOS_PRIVACY_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 state = 0;
45     int32_t accessTokenId = 0;
46     bool isFocused = false;
47     int32_t extensionType = 255;
48     std::vector<int32_t> renderPids;
49 };
50 }  // namespace AccessToken
51 }  // namespace Security
52 }  // namespace OHOS
53 
54 #endif  // OHOS_PRIVACY_APP_STATE_DATA_H
55