diff --git a/services/distributeddataservice/service/data_share/BUILD.gn b/services/distributeddataservice/service/data_share/BUILD.gn index 087ff05e1bc0b10fb1d93442da8101663d724668..b687c8bdcc4f4530ab7bb2f7f72a373d281e5069 100644 --- a/services/distributeddataservice/service/data_share/BUILD.gn +++ b/services/distributeddataservice/service/data_share/BUILD.gn @@ -33,6 +33,9 @@ config("module_public_config") { "../crypto/include", "../permission/include", ] + if (is_emulator) { + defines = [ "IS_EMULATOR" ] + } } group("build_module") { deps = [ ":data_share_service" ] diff --git a/services/distributeddataservice/service/data_share/data_share_service_stub.cpp b/services/distributeddataservice/service/data_share/data_share_service_stub.cpp index 170de1bcb8964843755595f357a3103401f804e7..f9ef5f7dcbd9fc821cc79aefff11b8fa3d52f235 100644 --- a/services/distributeddataservice/service/data_share/data_share_service_stub.cpp +++ b/services/distributeddataservice/service/data_share/data_share_service_stub.cpp @@ -36,12 +36,16 @@ class DataShareServiceStub::QosManager { public: QosManager() { +#ifndef IS_EMULATOR // set thread qos QOS_USER_INTERACTIVE QOS::SetThreadQos(QOS::QosLevel::QOS_USER_INTERACTIVE); +#endif } ~QosManager() { +#ifndef IS_EMULATOR QOS::ResetThreadQos(); +#endif } }; @@ -351,9 +355,6 @@ int DataShareServiceStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Me { // set thread qos DataShareServiceStub::QosManager qos; - // check thread qos - QOS::QosLevel curLevel; - int qosRet = QOS::GetThreadQos(curLevel); int tryTimes = TRY_TIMES; while (!isReady_.load() && tryTimes > 0) { @@ -373,8 +374,7 @@ int DataShareServiceStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Me code = code - DATA_SHARE_CMD_SYSTEM_CODE; } if (code != DATA_SHARE_SERVICE_CMD_QUERY && code != DATA_SHARE_SERVICE_CMD_GET_SILENT_PROXY_STATUS) { - ZLOGI("code:%{public}u, callingPid:%{public}d, qosRet:%{public}d, curLevel:%{public}d", - code, callingPid, qosRet, curLevel); + ZLOGI("code:%{public}u, callingPid:%{public}d", code, callingPid); } if (!CheckInterfaceToken(data)) { DataShareThreadLocal::CleanFromSystemApp();