diff --git a/services/edm/src/query_policy/disallowed_mobile_data_query.cpp b/services/edm/src/query_policy/disallowed_mobile_data_query.cpp index d88c0ec2bc8f4383b5e30c3cf1d23ff62168c577..e7ed2c383095b65668096d181fc6aebbd8ab9195 100644 --- a/services/edm/src/query_policy/disallowed_mobile_data_query.cpp +++ b/services/edm/src/query_policy/disallowed_mobile_data_query.cpp @@ -34,6 +34,8 @@ std::string DisallowedMobileDataQuery::GetPermission(IPlugin::PermissionType per ErrCode DisallowedMobileDataQuery::QueryPolicy(std::string &policyData, MessageParcel &data, MessageParcel &reply, int32_t userId) { + EDMLOGI("DisallowedMobileDataQuery QueryPolicy policyData : %{public}s", policyData.c_str()); + policyData = (policyData == "disallow") ? "true" : "false"; return GetBoolPolicy(policyData, reply); } } // namespace EDM diff --git a/services/edm_plugin/src/disallow_mobile_data_plugin.cpp b/services/edm_plugin/src/disallow_mobile_data_plugin.cpp index 3694ddc53f00ec486382dc0b2d6c57a52e0a254f..31736bbd49f8cb84a48c2dd53e2ca029bc045019 100644 --- a/services/edm_plugin/src/disallow_mobile_data_plugin.cpp +++ b/services/edm_plugin/src/disallow_mobile_data_plugin.cpp @@ -66,8 +66,8 @@ ErrCode DisallowMobileDataPlugin::OnHandlePolicy(std::uint32_t funcCode, Message return EdmReturnErrCode::SYSTEM_ABNORMALLY; } policyData.isChanged = true; - policyData.mergePolicyData = "true"; - policyData.policyData = "true"; + policyData.mergePolicyData = "disallow"; + policyData.policyData = "disallow"; return ERR_OK; } if (!system::SetParameter(PARAM_MOBILE_DATA_POLICY, MOBILE_DATA_NONE)) { @@ -75,12 +75,19 @@ ErrCode DisallowMobileDataPlugin::OnHandlePolicy(std::uint32_t funcCode, Message return EdmReturnErrCode::SYSTEM_ABNORMALLY; } policyData.isChanged = true; - policyData.mergePolicyData = "false"; - policyData.policyData = "false"; + policyData.mergePolicyData = "none"; + policyData.policyData = "none"; return ERR_OK; } if (flag == EdmConstants::MobileData::FORCE_FLAG) { - return OnHandleForceOpen(data); + int32_t ret = OnHandleForceOpen(data); + if (ret != ERR_OK) { + return ret; + } + policyData.isChanged = true; + policyData.mergePolicyData = "force_open"; + policyData.policyData = "force_open"; + return ERR_OK; } return EdmReturnErrCode::SYSTEM_ABNORMALLY; } @@ -113,7 +120,7 @@ ErrCode DisallowMobileDataPlugin::OnHandleForceOpen(MessageParcel &data) ErrCode DisallowMobileDataPlugin::OnAdminRemove(const std::string &adminName, const std::string &policyData, const std::string &mergeData, int32_t userId) { - EDMLOGI("TurnOnOffMobileDataPlugin OnAdminRemove adminName : %{public}s, policyData : %{public}s", + EDMLOGI("DisallowMobileDataPlugin OnAdminRemove adminName : %{public}s, policyData : %{public}s", adminName.c_str(), policyData.c_str()); if (!system::SetParameter(PARAM_MOBILE_DATA_POLICY, MOBILE_DATA_NONE)) { EDMLOGE("DisallowMobileDataPlugin:OnSetPolicy SetParameter fail");