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_DISTRIBUTED_DATA_APP_FEATURE_STUB_IMPL_H 17 #define OHOS_DISTRIBUTED_DATA_APP_FEATURE_STUB_IMPL_H 18 #include "feature/feature_system.h" 19 #include "iremote_stub.h" 20 namespace OHOS::DistributedData { 21 class FeatureStub : public IRemoteBroker { 22 public: 23 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.DistributedData.ServiceProxy"); 24 }; 25 26 class FeatureStubImpl final : public IRemoteStub<FeatureStub> { 27 public: 28 explicit FeatureStubImpl(std::shared_ptr<FeatureSystem::Feature> feature); 29 ~FeatureStubImpl(); 30 int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, 31 MessageOption &option) override; 32 int32_t OnInitialize(); 33 int32_t OnAppExit(pid_t uid, pid_t pid, uint32_t tokenId, const std::string &bundleName); 34 int32_t OnAppUninstall(const std::string &bundleName, int32_t user, int32_t index, uint32_t tokenId); 35 int32_t ResolveAutoLaunch(const std::string &identifier, DistributedDB::AutoLaunchParam ¶m); 36 int32_t OnUserChange(uint32_t code, const std::string &user, const std::string &account); 37 int32_t Online(const std::string &device); 38 int32_t Offline(const std::string &device); 39 int32_t OnReady(const std::string &device); 40 private: 41 std::shared_ptr<FeatureSystem::Feature> featureImpl_; 42 }; 43 } 44 #endif // OHOS_DISTRIBUTED_DATA_APP_FEATURE_STUB_IMPL_H 45