• 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 FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_FREE_INSTALL_FREE_INSTALL_PARAMS_H
17 #define FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_FREE_INSTALL_FREE_INSTALL_PARAMS_H
18 
19 #include <string>
20 
21 #include "iremote_object.h"
22 #include "want.h"
23 
24 namespace OHOS {
25 namespace AppExecFwk {
26 
27 enum UpgradeFlag {
28     NOT_UPGRADE = 0,
29     SINGLE_UPGRADE = 1,
30     RELATION_UPGRADE = 2,
31 };
32 
33 enum FreeInstallErrorCode {
34     CONNECT_ERROR = 0x820101,
35     SERVICE_CENTER_CRASH = 0x820102,
36     SERVICE_CENTER_TIMEOUT = 0x820103,
37     UNDEFINED_ERROR = 0x820104,
38 };
39 
40 enum ServiceCenterFunction {
41     CONNECT_DISPATCHER_INFO = 1,
42     CONNECT_SILENT_INSTALL = 2,
43     CONNECT_UPGRADE_CHECK = 3,
44     CONNECT_UPGRADE_INSTALL = 4,
45     CONNECT_QUERY_RPCID = 5,
46     CONNECT_PRELOAD_INSTALL = 6,
47 };
48 
49 enum ServiceCenterResultCode {
50     FREE_INSTALL_OK = 0,
51     FREE_INSTALL_DOWNLOADING = 1,
52 };
53 
54 enum ServiceCenterConnectState {
55     CONNECTED = 0,
56     CONNECTING = 1,
57     DISCONNECTED = 2,
58 };
59 
60 struct FreeInstallParams : public virtual RefBase {
61     sptr<IRemoteObject> callback;
62     OHOS::AAFwk::Want want;
63     int32_t userId;
64     ServiceCenterFunction serviceCenterFunction;
65 };
66 }  // namespace AppExecFwk
67 }  // namespace OHOS
68 #endif  // FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_FREE_INSTALL_FREE_INSTALL_PARAMS_H
69