diff --git a/interfaces/inner_api/ability_manager/BUILD.gn b/interfaces/inner_api/ability_manager/BUILD.gn index 808091d0d8..47aeae3414 100644 --- a/interfaces/inner_api/ability_manager/BUILD.gn +++ b/interfaces/inner_api/ability_manager/BUILD.gn @@ -75,7 +75,6 @@ ohos_shared_library("ability_manager") { "${ability_runtime_services_path}/abilitymgr/src/acquire_share_data_callback_proxy.cpp", "${ability_runtime_services_path}/abilitymgr/src/acquire_share_data_callback_stub.cpp", "${ability_runtime_services_path}/abilitymgr/src/caller_info.cpp", - "${ability_runtime_services_path}/abilitymgr/src/erms_mgr_param.cpp", "${ability_runtime_services_path}/abilitymgr/src/extension_running_info.cpp", "${ability_runtime_services_path}/abilitymgr/src/image_info.cpp", "${ability_runtime_services_path}/abilitymgr/src/launch_param.cpp", diff --git a/interfaces/inner_api/ability_manager/include/erms_mgr_param.h b/interfaces/inner_api/ability_manager/include/erms_mgr_param.h index 2f7b9fdb33..7e720b8364 100644 --- a/interfaces/inner_api/ability_manager/include/erms_mgr_param.h +++ b/interfaces/inner_api/ability_manager/include/erms_mgr_param.h @@ -19,7 +19,6 @@ #include #include -#include "parcel.h" #include "want.h" namespace OHOS { @@ -27,29 +26,17 @@ namespace AppExecFwk { namespace ErmsParams { using Want = OHOS::AAFwk::Want; -struct ExperienceRule : public Parcelable { +struct ExperienceRule { bool isAllow = false; std::shared_ptr replaceWant = nullptr; int64_t sceneCode = 0L; int64_t allowTypes; - - bool ReadFromParcel(Parcel &parcel); - - bool Marshalling(Parcel &parcel) const override; - - static ExperienceRule *Unmarshalling(Parcel &parcel); }; -struct CallerInfo : public Parcelable { +struct CallerInfo { std::string packageName; int64_t uid = 0L; int64_t pid = 0L; - - bool ReadFromParcel(Parcel &parcel); - - bool Marshalling(Parcel &parcel) const override; - - static CallerInfo *Unmarshalling(Parcel &parcel); }; } // namespace ErmsParams } // namespace AppExecFwk diff --git a/services/abilitymgr/src/erms_mgr_param.cpp b/services/abilitymgr/src/erms_mgr_param.cpp deleted file mode 100644 index c2be10dbd3..0000000000 --- a/services/abilitymgr/src/erms_mgr_param.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "erms_mgr_param.h" - -#include -#include - -#include "iremote_broker.h" -#include "iremote_object.h" - -namespace OHOS { -namespace AppExecFwk { -using ErmsCallerInfo = OHOS::AppExecFwk::ErmsParams::CallerInfo; -using ExperienceRule = OHOS::AppExecFwk::ErmsParams::ExperienceRule; - -bool ExperienceRule::ReadFromParcel(Parcel &parcel) -{ - return true; -} - -ExperienceRule *ExperienceRule::Unmarshalling(Parcel &parcel) -{ - ExperienceRule *info = new (std::nothrow) ExperienceRule(); - return info; -} - -bool ExperienceRule::Marshalling(Parcel &parcel) const -{ - return true; -} - -bool ErmsCallerInfo::ReadFromParcel(Parcel &parcel) -{ - return true; -} - -ErmsCallerInfo *ErmsCallerInfo::Unmarshalling(Parcel &parcel) -{ - ErmsCallerInfo *info = new (std::nothrow) CallerInfo(); - return info; -} - -bool ErmsCallerInfo::Marshalling(Parcel &parcel) const -{ - return true; -} -} // namespace AppExecFwk -} // namespace OHOS diff --git a/test/moduletest/ability_test/ability_test.cpp b/test/moduletest/ability_test/ability_test.cpp index fe6288d896..7eb96047d5 100644 --- a/test/moduletest/ability_test/ability_test.cpp +++ b/test/moduletest/ability_test/ability_test.cpp @@ -1362,50 +1362,5 @@ HWTEST_F(AbilityTerminateTest, EXPECT_EQ(0, erms->QueryLastSyncTime()); GTEST_LOG_(INFO) << "AppExecFwk_IEcologicalRuleManager_QueryLastSyncTime_0100"; } - -/** - * @tc.number: AppExecFwk_ExperienceRule_ReadFromParcel_0100 - * @tc.name: ReadFromParcel - * @tc.desc: test ReadFromParcel function - */ -HWTEST_F(AbilityTerminateTest, - AppExecFwk_ExperienceRule_ReadFromParcel_0100, Function | MediumTest | Level1) -{ - GTEST_LOG_(INFO) << "AppExecFwk_ExperienceRule_ReadFromParcel_0100"; - ErmsParams::ExperienceRule rule; - Parcel parcel; - EXPECT_EQ(true, rule.ReadFromParcel(parcel)); - GTEST_LOG_(INFO) << "AppExecFwk_ExperienceRule_ReadFromParcel_0100"; -} - -/** - * @tc.number: AppExecFwk_ExperienceRule_Marshalling_0100 - * @tc.name: Marshalling - * @tc.desc: test Marshalling function - */ -HWTEST_F(AbilityTerminateTest, - AppExecFwk_ExperienceRule_Marshalling_0100, Function | MediumTest | Level1) -{ - GTEST_LOG_(INFO) << "AppExecFwk_ExperienceRule_Marshalling_0100"; - ErmsParams::ExperienceRule rule; - Parcel parcel; - EXPECT_EQ(true, rule.Marshalling(parcel)); - GTEST_LOG_(INFO) << "AppExecFwk_ExperienceRule_Marshalling_0100"; -} - -/** - * @tc.number: AppExecFwk_ExperienceRule_Unmarshalling_0100 - * @tc.name: Unmarshalling - * @tc.desc: test Unmarshalling function - */ -HWTEST_F(AbilityTerminateTest, - AppExecFwk_ExperienceRule_Unmarshalling_0100, Function | MediumTest | Level1) -{ - GTEST_LOG_(INFO) << "AppExecFwk_ExperienceRule_Unmarshalling_0100"; - ErmsParams::ExperienceRule rule; - Parcel parcel; - EXPECT_NE(nullptr, rule.Unmarshalling(parcel)); - GTEST_LOG_(INFO) << "AppExecFwk_ExperienceRule_Unmarshalling_0100"; -} } // namespace AppExecFwk } // namespace OHOS