1 /*
2  * Copyright (c) 2020 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_ABILITY_SLITE_ABILITY_RECORD_H
17 #define OHOS_ABILITY_SLITE_ABILITY_RECORD_H
18 
19 #include "ability_info.h"
20 #include "ability_saved_data.h"
21 #include "cmsis_os.h"
22 #include "ability_thread.h"
23 #include "ability_record_state.h"
24 
25 namespace OHOS {
26 namespace AbilitySlite {
27 struct AbilityData {
28     AbilityData();
29 
30     ~AbilityData();
31 
32     void *wantData = nullptr;
33     uint16_t wantDataSize = 0;
34 };
35 
36 struct AbilityRecord {
37 public:
38     AbilityRecord();
39 
40     ~AbilityRecord();
41 
42     void SetAppName(const char *name);
43 
44     void SetAppPath(const char *path);
45 
46     void SetWantData(const void *wantData, uint16_t wantDataSize);
47 
48     char *appName = nullptr;
49     char *appPath = nullptr;
50     AbilityData *abilityData = nullptr;
51     AbilitySavedData *abilitySavedData = nullptr;
52     AbilityThread *abilityThread = nullptr;
53     osMessageQueueId_t jsAppQueueId = nullptr;
54     uint32_t taskId = 0;
55     uint16_t token = 0;
56     uint32_t mission = 0;
57     uint8_t state = SCHEDULE_STOP;
58     bool isTerminated = false;
59     bool isNativeApp = false;
60 };
61 } // namespace AbilitySlite
62 } // namespace OHOS
63 #endif // OHOS_ABILITY_SLITE_ABILITY_RECORD_H
64