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 ABILITY_RUNTIME_CONNECTION_DATA_H 17 #define ABILITY_RUNTIME_CONNECTION_DATA_H 18 19 #include "extension_ability_info.h" 20 #include "parcel.h" 21 22 namespace OHOS { 23 namespace AbilityRuntime { 24 struct ConnectionData : public Parcelable { 25 /** 26 * @brief read this Sequenceable object from a Parcel. 27 * 28 * @param parcel Indicates the Parcel object into which the Sequenceable object has been marshaled. 29 * @return Returns true if read successed; returns false otherwise. 30 */ 31 bool ReadFromParcel(Parcel &parcel); 32 33 /** 34 * @brief Marshals this Sequenceable object into a Parcel. 35 * 36 * @param parcel Indicates the Parcel object to which the Sequenceable object will be marshaled. 37 */ 38 virtual bool Marshalling(Parcel &parcel) const override; 39 40 /** 41 * @brief Unmarshals this Sequenceable object from a Parcel. 42 * 43 * @param parcel Indicates the Parcel object into which the Sequenceable object has been marshaled. 44 */ 45 static ConnectionData *Unmarshalling(Parcel &parcel); 46 47 int32_t extensionPid = -1; 48 int32_t extensionUid = 0; 49 std::string extensionBundleName; 50 std::string extensionModuleName; 51 std::string extensionName; 52 AppExecFwk::ExtensionAbilityType extensionType; 53 int32_t callerUid; 54 int32_t callerPid; 55 std::string callerName; 56 }; 57 } // namespace AbilityRuntime 58 } // namespace OHOS 59 #endif // ABILITY_RUNTIME_CONNECTION_DATA_H 60