From 1e2574d2af942d6d8fd25468c56a8f4db7e73aa1 Mon Sep 17 00:00:00 2001 From: h00514358 Date: Wed, 8 Jun 2022 16:22:55 +0800 Subject: [PATCH 1/3] Modify sensor woring Signed-off-by: h00514358 --- .../src/miscdevice_service_proxy.cpp | 68 +++++++++++++------ 1 file changed, 49 insertions(+), 19 deletions(-) diff --git a/frameworks/native/miscdevice/src/miscdevice_service_proxy.cpp b/frameworks/native/miscdevice/src/miscdevice_service_proxy.cpp index 0766778..b747cb5 100644 --- a/frameworks/native/miscdevice/src/miscdevice_service_proxy.cpp +++ b/frameworks/native/miscdevice/src/miscdevice_service_proxy.cpp @@ -25,6 +25,8 @@ using namespace OHOS::HiviewDFX; namespace { constexpr HiLogLabel LABEL = { LOG_CORE, SensorsLogDomain::MISCDEVICE_SERVICE, "MiscdeviceServiceProxy" }; +constexpr uint23_t MAX_VIBRATOR_COUNT = 0XFF; +constexpr uint23_t MAX_LIGHT_COUNT = 0XFF; } MiscdeviceServiceProxy::MiscdeviceServiceProxy(const sptr &impl) : IRemoteProxy(impl) @@ -43,7 +45,9 @@ bool MiscdeviceServiceProxy::IsAbilityAvailable(MiscdeviceDeviceId groupID) MISC_HILOGE("write groupID failed"); return false; } - int32_t ret = Remote()->SendRequest(IS_ABILITY_AVAILABLE, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(IS_ABILITY_AVAILABLE, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "IsAbilityAvailable", ret); MISC_HILOGE("sendRequest failed, ret : %{public}d", ret); @@ -69,7 +73,9 @@ bool MiscdeviceServiceProxy::IsVibratorEffectAvailable(int32_t vibratorId, const MISC_HILOGE("WriteString failed"); return false; } - int32_t ret = Remote()->SendRequest(IS_VIBRATOR_EFFECT_AVAILABLE, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(IS_VIBRATOR_EFFECT_AVAILABLE, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "IsVibratorEffectAvailable", ret); MISC_HILOGE("SendRequest failed, ret : %{public}d", ret); @@ -88,14 +94,16 @@ std::vector MiscdeviceServiceProxy::GetVibratorIdList() MISC_HILOGE("write descriptor failed"); return idVec; } - int32_t ret = Remote()->SendRequest(GET_VIBRATOR_ID_LIST, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(GET_VIBRATOR_ID_LIST, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "GetVibratorIdList", ret); MISC_HILOGE("SendRequest failed, ret : %{public}d", ret); return idVec; } uint32_t setCount = reply.ReadUint32(); - if (setCount <= 0 || setCount > idVec.max_size()) { + if (setCount <= 0 || setCount > MAX_VIBRATOR_COUNT) { MISC_HILOGE("setCount: %{public}d is invalid", setCount); return idVec; } @@ -121,7 +129,9 @@ int32_t MiscdeviceServiceProxy::Vibrate(int32_t vibratorId, uint32_t timeOut) MISC_HILOGE("WriteUint32 timeOut failed"); return WRITE_MSG_ERR; } - int32_t ret = Remote()->SendRequest(VIBRATE, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(VIBRATE, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "Vibrate", ret); MISC_HILOGE("sendRequest ret : %{public}d", ret); @@ -142,7 +152,9 @@ int32_t MiscdeviceServiceProxy::CancelVibrator(int32_t vibratorId) MISC_HILOGE("WriteInt32 failed"); return WRITE_MSG_ERR; } - int32_t ret = Remote()->SendRequest(CANCEL_VIBRATOR, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(CANCEL_VIBRATOR, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "CancelVibrator", ret); MISC_HILOGE("ret : %{public}d", ret); @@ -171,7 +183,9 @@ int32_t MiscdeviceServiceProxy::PlayVibratorEffect(int32_t vibratorId, const std MISC_HILOGE("WriteBool effect failed"); return WRITE_MSG_ERR; } - int32_t ret = Remote()->SendRequest(PLAY_VIBRATOR_EFFECT, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(PLAY_VIBRATOR_EFFECT, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "PlayVibratorEffect", ret); MISC_HILOGE("ret : %{public}d", ret); @@ -205,7 +219,9 @@ int32_t MiscdeviceServiceProxy::PlayCustomVibratorEffect(int32_t vibratorId, con MISC_HILOGE("WriteInt32 periodCount failed"); return WRITE_MSG_ERR; } - int32_t ret = Remote()->SendRequest(PLAY_CUSTOM_VIBRATOR_EFFECT, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(PLAY_CUSTOM_VIBRATOR_EFFECT, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "PlayCustomVibratorEffect", ret); MISC_HILOGE("ret : %{public}d", ret); @@ -230,7 +246,9 @@ int32_t MiscdeviceServiceProxy::StopVibratorEffect(int32_t vibratorId, const std MISC_HILOGE("WriteString effect failed"); return WRITE_MSG_ERR; } - int32_t ret = Remote()->SendRequest(STOP_VIBRATOR_EFFECT, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(STOP_VIBRATOR_EFFECT, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "StopVibratorEffect", ret); MISC_HILOGE("ret : %{public}d", ret); @@ -255,7 +273,9 @@ int32_t MiscdeviceServiceProxy::SetVibratorParameter(int32_t vibratorId, const s MISC_HILOGE("WriteString cmd failed"); return WRITE_MSG_ERR; } - int32_t ret = Remote()->SendRequest(SET_VIBRATOR_PARA, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(SET_VIBRATOR_PARA, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "SetVibratorParameter", ret); MISC_HILOGE("ret : %{public}d", ret); @@ -280,7 +300,9 @@ std::string MiscdeviceServiceProxy::GetVibratorParameter(int32_t vibratorId, con MISC_HILOGE("WriteString cmd failed"); return ""; } - int32_t ret = Remote()->SendRequest(GET_VIBRATOR_PARA, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(GET_VIBRATOR_PARA, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "SetVibratorParameter", ret); MISC_HILOGE("ret : %{public}d", ret); @@ -299,13 +321,15 @@ std::vector MiscdeviceServiceProxy::GetLightSupportId() MISC_HILOGE("write descriptor failed"); return idVec; } - int32_t ret = Remote()->SendRequest(GET_LIGHT_SUPPORT_ID, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(GET_LIGHT_SUPPORT_ID, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "GetLightSupportId", ret); MISC_HILOGE("sendRequest failed, ret : %{public}d", ret); } int32_t setCount = reply.ReadInt32(); - if (setCount <= 0 || setCount > static_cast(idVec.max_size())) { + if (setCount <= 0 || setCount > MAX_LIGHT_COUNT) { MISC_HILOGE("setCount: %{public}d is invalid", setCount); return idVec; } @@ -331,8 +355,9 @@ bool MiscdeviceServiceProxy::IsLightEffectSupport(int32_t lightId, const std::st MISC_HILOGE("WriteString effectId failed"); return false; } - - int32_t ret = Remote()->SendRequest(IS_LIGHT_EFFECT_SUPPORT, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(IS_LIGHT_EFFECT_SUPPORT, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "IsLightEffectSupport", ret); MISC_HILOGE("sendRequest failed, ret : %{public}d", ret); @@ -366,8 +391,9 @@ int32_t MiscdeviceServiceProxy::Light(int32_t id, uint64_t brightness, uint32_t MISC_HILOGE("WriteUint32 timeOff failed"); return WRITE_MSG_ERR; } - - int32_t ret = Remote()->SendRequest(LIGHT, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(LIGHT, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "Light", ret); MISC_HILOGE("sendRequest failed, ret : %{public}d", ret); @@ -392,7 +418,9 @@ int32_t MiscdeviceServiceProxy::PlayLightEffect(int32_t id, const std::string &t MISC_HILOGE("WriteString type failed"); return WRITE_MSG_ERR; } - int32_t ret = Remote()->SendRequest(PLAY_LIGHT_EFFECT, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(PLAY_LIGHT_EFFECT, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "PlayLightEffect", ret); MISC_HILOGE("sendRequest failed, ret : %{public}d", ret); @@ -413,7 +441,9 @@ int32_t MiscdeviceServiceProxy::StopLightEffect(int32_t id) MISC_HILOGE("WriteInt32 id failed"); return WRITE_MSG_ERR; } - int32_t ret = Remote()->SendRequest(STOP_LIGHT_EFFECT, data, reply, option); + auto remote = Remote(); + CHKPR(remote, INVALID_POINTER); + int32_t ret = remote->SendRequest(STOP_LIGHT_EFFECT, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "StopLightEffect", ret); MISC_HILOGE("sendRequest failed, ret : %{public}d", ret); -- Gitee From b83c234599c5cb592ba8dd0339ceff47cb091960 Mon Sep 17 00:00:00 2001 From: h00514358 Date: Wed, 8 Jun 2022 17:18:42 +0800 Subject: [PATCH 2/3] Modify sensor woring Signed-off-by: h00514358 --- .../src/miscdevice_service_proxy.cpp | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/frameworks/native/miscdevice/src/miscdevice_service_proxy.cpp b/frameworks/native/miscdevice/src/miscdevice_service_proxy.cpp index b747cb5..3aa1d9e 100644 --- a/frameworks/native/miscdevice/src/miscdevice_service_proxy.cpp +++ b/frameworks/native/miscdevice/src/miscdevice_service_proxy.cpp @@ -25,8 +25,8 @@ using namespace OHOS::HiviewDFX; namespace { constexpr HiLogLabel LABEL = { LOG_CORE, SensorsLogDomain::MISCDEVICE_SERVICE, "MiscdeviceServiceProxy" }; -constexpr uint23_t MAX_VIBRATOR_COUNT = 0XFF; -constexpr uint23_t MAX_LIGHT_COUNT = 0XFF; +constexpr uint32_t MAX_VIBRATOR_COUNT = 0XFF; +constexpr uint32_t MAX_LIGHT_COUNT = 0XFF; } MiscdeviceServiceProxy::MiscdeviceServiceProxy(const sptr &impl) : IRemoteProxy(impl) @@ -46,7 +46,7 @@ bool MiscdeviceServiceProxy::IsAbilityAvailable(MiscdeviceDeviceId groupID) return false; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(IS_ABILITY_AVAILABLE, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "IsAbilityAvailable", ret); @@ -74,7 +74,7 @@ bool MiscdeviceServiceProxy::IsVibratorEffectAvailable(int32_t vibratorId, const return false; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(IS_VIBRATOR_EFFECT_AVAILABLE, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "IsVibratorEffectAvailable", ret); @@ -95,7 +95,10 @@ std::vector MiscdeviceServiceProxy::GetVibratorIdList() return idVec; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + if (remote == nullptr) { + MISC_HILOGE("remote is null"); + return idVec; + } int32_t ret = remote->SendRequest(GET_VIBRATOR_ID_LIST, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "GetVibratorIdList", ret); @@ -130,7 +133,7 @@ int32_t MiscdeviceServiceProxy::Vibrate(int32_t vibratorId, uint32_t timeOut) return WRITE_MSG_ERR; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(VIBRATE, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "Vibrate", ret); @@ -153,7 +156,7 @@ int32_t MiscdeviceServiceProxy::CancelVibrator(int32_t vibratorId) return WRITE_MSG_ERR; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(CANCEL_VIBRATOR, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "CancelVibrator", ret); @@ -184,7 +187,7 @@ int32_t MiscdeviceServiceProxy::PlayVibratorEffect(int32_t vibratorId, const std return WRITE_MSG_ERR; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(PLAY_VIBRATOR_EFFECT, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "PlayVibratorEffect", ret); @@ -220,7 +223,7 @@ int32_t MiscdeviceServiceProxy::PlayCustomVibratorEffect(int32_t vibratorId, con return WRITE_MSG_ERR; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(PLAY_CUSTOM_VIBRATOR_EFFECT, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "PlayCustomVibratorEffect", ret); @@ -247,7 +250,7 @@ int32_t MiscdeviceServiceProxy::StopVibratorEffect(int32_t vibratorId, const std return WRITE_MSG_ERR; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(STOP_VIBRATOR_EFFECT, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "StopVibratorEffect", ret); @@ -274,7 +277,7 @@ int32_t MiscdeviceServiceProxy::SetVibratorParameter(int32_t vibratorId, const s return WRITE_MSG_ERR; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(SET_VIBRATOR_PARA, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "SetVibratorParameter", ret); @@ -301,7 +304,7 @@ std::string MiscdeviceServiceProxy::GetVibratorParameter(int32_t vibratorId, con return ""; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + CHKPS(remote); int32_t ret = remote->SendRequest(GET_VIBRATOR_PARA, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "SetVibratorParameter", ret); @@ -322,7 +325,10 @@ std::vector MiscdeviceServiceProxy::GetLightSupportId() return idVec; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + if (remote == nullptr) { + MISC_HILOGE("remote is null"); + return idVec; + } int32_t ret = remote->SendRequest(GET_LIGHT_SUPPORT_ID, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "GetLightSupportId", ret); @@ -356,7 +362,7 @@ bool MiscdeviceServiceProxy::IsLightEffectSupport(int32_t lightId, const std::st return false; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + CHKPF(remote); int32_t ret = remote->SendRequest(IS_LIGHT_EFFECT_SUPPORT, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "IsLightEffectSupport", ret); @@ -392,7 +398,7 @@ int32_t MiscdeviceServiceProxy::Light(int32_t id, uint64_t brightness, uint32_t return WRITE_MSG_ERR; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(LIGHT, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "Light", ret); @@ -419,7 +425,7 @@ int32_t MiscdeviceServiceProxy::PlayLightEffect(int32_t id, const std::string &t return WRITE_MSG_ERR; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(PLAY_LIGHT_EFFECT, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "PlayLightEffect", ret); @@ -442,7 +448,7 @@ int32_t MiscdeviceServiceProxy::StopLightEffect(int32_t id) return WRITE_MSG_ERR; } auto remote = Remote(); - CHKPR(remote, INVALID_POINTER); + CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(STOP_LIGHT_EFFECT, data, reply, option); if (ret != NO_ERROR) { DmdReport::ReportException(MISC_SERVICE_IPC_EXCEPTION, "StopLightEffect", ret); -- Gitee From 300fbfd0fe5c4430096868fbe1373b108e1babd0 Mon Sep 17 00:00:00 2001 From: h00514358 Date: Thu, 9 Jun 2022 09:30:40 +0800 Subject: [PATCH 3/3] Modify sensor woring Signed-off-by: h00514358 --- .../src/miscdevice_service_proxy.cpp | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/frameworks/native/miscdevice/src/miscdevice_service_proxy.cpp b/frameworks/native/miscdevice/src/miscdevice_service_proxy.cpp index 3aa1d9e..85294e1 100644 --- a/frameworks/native/miscdevice/src/miscdevice_service_proxy.cpp +++ b/frameworks/native/miscdevice/src/miscdevice_service_proxy.cpp @@ -45,7 +45,7 @@ bool MiscdeviceServiceProxy::IsAbilityAvailable(MiscdeviceDeviceId groupID) MISC_HILOGE("write groupID failed"); return false; } - auto remote = Remote(); + sptr remote = Remote(); CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(IS_ABILITY_AVAILABLE, data, reply, option); if (ret != NO_ERROR) { @@ -73,7 +73,7 @@ bool MiscdeviceServiceProxy::IsVibratorEffectAvailable(int32_t vibratorId, const MISC_HILOGE("WriteString failed"); return false; } - auto remote = Remote(); + sptr remote = Remote(); CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(IS_VIBRATOR_EFFECT_AVAILABLE, data, reply, option); if (ret != NO_ERROR) { @@ -94,7 +94,7 @@ std::vector MiscdeviceServiceProxy::GetVibratorIdList() MISC_HILOGE("write descriptor failed"); return idVec; } - auto remote = Remote(); + sptr remote = Remote(); if (remote == nullptr) { MISC_HILOGE("remote is null"); return idVec; @@ -132,7 +132,7 @@ int32_t MiscdeviceServiceProxy::Vibrate(int32_t vibratorId, uint32_t timeOut) MISC_HILOGE("WriteUint32 timeOut failed"); return WRITE_MSG_ERR; } - auto remote = Remote(); + sptr remote = Remote(); CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(VIBRATE, data, reply, option); if (ret != NO_ERROR) { @@ -155,7 +155,7 @@ int32_t MiscdeviceServiceProxy::CancelVibrator(int32_t vibratorId) MISC_HILOGE("WriteInt32 failed"); return WRITE_MSG_ERR; } - auto remote = Remote(); + sptr remote = Remote(); CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(CANCEL_VIBRATOR, data, reply, option); if (ret != NO_ERROR) { @@ -186,7 +186,7 @@ int32_t MiscdeviceServiceProxy::PlayVibratorEffect(int32_t vibratorId, const std MISC_HILOGE("WriteBool effect failed"); return WRITE_MSG_ERR; } - auto remote = Remote(); + sptr remote = Remote(); CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(PLAY_VIBRATOR_EFFECT, data, reply, option); if (ret != NO_ERROR) { @@ -222,7 +222,7 @@ int32_t MiscdeviceServiceProxy::PlayCustomVibratorEffect(int32_t vibratorId, con MISC_HILOGE("WriteInt32 periodCount failed"); return WRITE_MSG_ERR; } - auto remote = Remote(); + sptr remote = Remote(); CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(PLAY_CUSTOM_VIBRATOR_EFFECT, data, reply, option); if (ret != NO_ERROR) { @@ -249,7 +249,7 @@ int32_t MiscdeviceServiceProxy::StopVibratorEffect(int32_t vibratorId, const std MISC_HILOGE("WriteString effect failed"); return WRITE_MSG_ERR; } - auto remote = Remote(); + sptr remote = Remote(); CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(STOP_VIBRATOR_EFFECT, data, reply, option); if (ret != NO_ERROR) { @@ -276,7 +276,7 @@ int32_t MiscdeviceServiceProxy::SetVibratorParameter(int32_t vibratorId, const s MISC_HILOGE("WriteString cmd failed"); return WRITE_MSG_ERR; } - auto remote = Remote(); + sptr remote = Remote(); CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(SET_VIBRATOR_PARA, data, reply, option); if (ret != NO_ERROR) { @@ -303,7 +303,7 @@ std::string MiscdeviceServiceProxy::GetVibratorParameter(int32_t vibratorId, con MISC_HILOGE("WriteString cmd failed"); return ""; } - auto remote = Remote(); + sptr remote = Remote(); CHKPS(remote); int32_t ret = remote->SendRequest(GET_VIBRATOR_PARA, data, reply, option); if (ret != NO_ERROR) { @@ -324,7 +324,7 @@ std::vector MiscdeviceServiceProxy::GetLightSupportId() MISC_HILOGE("write descriptor failed"); return idVec; } - auto remote = Remote(); + sptr remote = Remote(); if (remote == nullptr) { MISC_HILOGE("remote is null"); return idVec; @@ -361,7 +361,7 @@ bool MiscdeviceServiceProxy::IsLightEffectSupport(int32_t lightId, const std::st MISC_HILOGE("WriteString effectId failed"); return false; } - auto remote = Remote(); + sptr remote = Remote(); CHKPF(remote); int32_t ret = remote->SendRequest(IS_LIGHT_EFFECT_SUPPORT, data, reply, option); if (ret != NO_ERROR) { @@ -397,7 +397,7 @@ int32_t MiscdeviceServiceProxy::Light(int32_t id, uint64_t brightness, uint32_t MISC_HILOGE("WriteUint32 timeOff failed"); return WRITE_MSG_ERR; } - auto remote = Remote(); + sptr remote = Remote(); CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(LIGHT, data, reply, option); if (ret != NO_ERROR) { @@ -424,7 +424,7 @@ int32_t MiscdeviceServiceProxy::PlayLightEffect(int32_t id, const std::string &t MISC_HILOGE("WriteString type failed"); return WRITE_MSG_ERR; } - auto remote = Remote(); + sptr remote = Remote(); CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(PLAY_LIGHT_EFFECT, data, reply, option); if (ret != NO_ERROR) { @@ -447,7 +447,7 @@ int32_t MiscdeviceServiceProxy::StopLightEffect(int32_t id) MISC_HILOGE("WriteInt32 id failed"); return WRITE_MSG_ERR; } - auto remote = Remote(); + sptr remote = Remote(); CHKPR(remote, ERROR); int32_t ret = remote->SendRequest(STOP_LIGHT_EFFECT, data, reply, option); if (ret != NO_ERROR) { -- Gitee