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_DMSFWK_INTERFACE_H 17 #define OHOS_DMSFWK_INTERFACE_H 18 19 #include "ability_info.h" 20 #include "iunknown.h" 21 #include "want.h" 22 23 #ifdef __cplusplus 24 #if __cplusplus 25 extern "C" { 26 #endif 27 #endif 28 #define DISTRIBUTED_SCHEDULE_SERVICE "dtbschedsrv" 29 #define DMSLITE_FEATURE "dmslite" 30 31 typedef enum { 32 DMS_EC_SUCCESS = 0, 33 DMS_EC_START_ABILITY_SYNC_SUCCESS = 1, 34 DMS_EC_START_ABILITY_ASYNC_SUCCESS = 2, 35 DMS_EC_PARSE_TLV_FAILURE = 3, 36 DMS_EC_UNKNOWN_COMMAND_ID = 4, 37 DMS_EC_GET_BMS_FAILURE = 5, 38 DMS_EC_GET_BUNDLEINFO_FAILURE = 6, 39 DMS_EC_CHECK_PERMISSION_FAILURE = 7, 40 DMS_EC_GET_ABILITYMS_FAILURE = 8, 41 DMS_EC_REGISTE_IPC_CALLBACK_FAILURE = 9, 42 DMS_EC_FILL_WANT_FAILURE = 10, 43 DMS_EC_START_ABILITY_SYNC_FAILURE = 11, 44 DMS_EC_START_ABILITY_ASYNC_FAILURE = 12, 45 DMS_EC_FAILURE = 13, 46 DMS_EC_INVALID_PARAMETER = 14, 47 DMS_REC_UNKNOWN_COMMAND_ID = 29360300, 48 DMS_REC_PARSER_TLV_FAIL = 29360301, 49 DMS_REC_PERMISSION_DENIED = 29360302, 50 DMS_REC_OPEN_SESSION_FAIL = 29360303, 51 DMS_REC_DEVICE_BUSY = 29360304, 52 DMS_REC_PACKET_MARSHALL_FAIL = 29360305, 53 DMS_REC_PACKET_UNMARSHALL_FAIL = 29360306, 54 DMS_REC_FREEINSTALL_FAIL = 29360307, 55 } DmsLiteCommonErrorCode; 56 57 typedef struct { 58 void (*OnResultCallback)(const void *data, int32_t ret); 59 } IDmsListener; 60 61 typedef struct { 62 int32_t uid; 63 char* bundleName; 64 } CallerInfo; 65 66 typedef struct { 67 INHERIT_IUNKNOWN; 68 int32_t (*StartRemoteAbility)(const Want *want, const CallerInfo *callerInfo, 69 const IDmsListener *callback); 70 } DmsProxy; 71 72 #ifdef __cplusplus 73 #if __cplusplus 74 } 75 #endif 76 #endif 77 78 #endif // OHOS_DMSFWK_INTERFACE_H 79