diff --git a/dm/include/display_manager_adapter.h b/dm/include/display_manager_adapter.h index b6cfb6850f..c72a4f2d22 100644 --- a/dm/include/display_manager_adapter.h +++ b/dm/include/display_manager_adapter.h @@ -60,7 +60,7 @@ public: virtual sptr GetDisplayInfoByScreenId(ScreenId screenId); virtual std::vector GetAllDisplayIds(); virtual std::shared_ptr GetDisplaySnapshot(DisplayId displayId, DmErrorCode* errorCode = nullptr); - virtual std::shared_ptr GetSnapshotByPicker(Media::Rect &rect, DmErrorCode* errorCode = nullptr); + virtual std::shared_ptr GetSnapshotByPicker(Media::Rect& rect, DmErrorCode* errorCode = nullptr); virtual DMError HasImmersiveWindow(bool& immersive); virtual DMError HasPrivateWindow(DisplayId displayId, bool& hasPrivateWindow); virtual bool WakeUpBegin(PowerStateChangeReason reason); diff --git a/dm/src/display_manager.cpp b/dm/src/display_manager.cpp index 5a1150a601..7f0fb63d60 100644 --- a/dm/src/display_manager.cpp +++ b/dm/src/display_manager.cpp @@ -678,7 +678,7 @@ std::shared_ptr DisplayManager::GetScreenshot(DisplayId display return screenShot; } -std::shared_ptr DisplayManager::GetSnapshotByPicker(Media::Rect &rect, DmErrorCode* errorCode) +std::shared_ptr DisplayManager::GetSnapshotByPicker(Media::Rect& rect, DmErrorCode* errorCode) { std::unique_lock lock(snapBypickerMutex, std::defer_lock); if (!lock.try_lock()) { @@ -712,8 +712,8 @@ std::shared_ptr DisplayManager::GetSnapshotByPicker(Media::Rect return pixelMap; } -std::shared_ptr DisplayManager::GetScreenshot(DisplayId displayId, const Media::Rect &rect, - const Media::Size &size, int rotation, DmErrorCode* errorCode) +std::shared_ptr DisplayManager::GetScreenshot(DisplayId displayId, const Media::Rect& rect, + const Media::Size& size, int rotation, DmErrorCode* errorCode) { std::shared_ptr screenShot = GetScreenshot(displayId, errorCode); if (screenShot == nullptr) { diff --git a/dm/src/display_manager_adapter.cpp b/dm/src/display_manager_adapter.cpp index ece47a378b..5d014b526c 100644 --- a/dm/src/display_manager_adapter.cpp +++ b/dm/src/display_manager_adapter.cpp @@ -62,7 +62,7 @@ std::shared_ptr DisplayManagerAdapter::GetDisplaySnapshot(Displ return displayManagerServiceProxy_->GetDisplaySnapshot(displayId, errorCode); } -std::shared_ptr DisplayManagerAdapter::GetSnapshotByPicker(Media::Rect &rect, DmErrorCode* errorCode) +std::shared_ptr DisplayManagerAdapter::GetSnapshotByPicker(Media::Rect& rect, DmErrorCode* errorCode) { INIT_PROXY_CHECK_RETURN(nullptr); diff --git a/dm_lite/test/unittest/display_lite_test.cpp b/dm_lite/test/unittest/display_lite_test.cpp index 57bbb25b12..0e4c3e3eb0 100644 --- a/dm_lite/test/unittest/display_lite_test.cpp +++ b/dm_lite/test/unittest/display_lite_test.cpp @@ -121,7 +121,7 @@ HWTEST_F(DisplayTestLite, GetId01, Function | SmallTest | Level1) HWTEST_F(DisplayTestLite, GetId02, Function | SmallTest | Level1) { GTEST_LOG_(INFO) << "DisplayLite::GetId start"; - DisplayInfo *displayInfo = new DisplayInfo(); + DisplayInfo* displayInfo = new DisplayInfo(); sptr display = new DisplayLite("", displayInfo); uint64_t id; id = display->GetId(); @@ -154,7 +154,7 @@ HWTEST_F(DisplayTestLite, GetDisplayInfo01, Function | SmallTest | Level1) HWTEST_F(DisplayTestLite, GetDisplayInfo02, Function | SmallTest | Level1) { GTEST_LOG_(INFO) << "DisplayLite::GetId start"; - DisplayInfo *displayInfo = new DisplayInfo(); + DisplayInfo* displayInfo = new DisplayInfo(); sptr display = new DisplayLite("", displayInfo);; displayInfo = display->GetDisplayInfo(); ASSERT_NE(displayInfo, nullptr); diff --git a/dmserver/include/display_manager_interface.h b/dmserver/include/display_manager_interface.h index 1cfa4038f5..a0328b7d9b 100644 --- a/dmserver/include/display_manager_interface.h +++ b/dmserver/include/display_manager_interface.h @@ -161,7 +161,7 @@ public: virtual DMError SetOrientation(ScreenId screenId, Orientation orientation) = 0; virtual std::shared_ptr GetDisplaySnapshot(DisplayId displayId, DmErrorCode* errorCode = nullptr) = 0; - virtual std::shared_ptr GetSnapshotByPicker(Media::Rect &rect, DmErrorCode* errorCode = nullptr) + virtual std::shared_ptr GetSnapshotByPicker(Media::Rect& rect, DmErrorCode* errorCode = nullptr) { *errorCode = DmErrorCode::DM_ERROR_DEVICE_NOT_SUPPORT; return nullptr; diff --git a/dmserver/include/display_manager_proxy.h b/dmserver/include/display_manager_proxy.h index 8efe9854e2..a6413c7fed 100644 --- a/dmserver/include/display_manager_proxy.h +++ b/dmserver/include/display_manager_proxy.h @@ -27,7 +27,7 @@ namespace OHOS::Rosen { class DisplayManagerProxy : public IRemoteProxy { public: - explicit DisplayManagerProxy(const sptr &impl) + explicit DisplayManagerProxy(const sptr& impl) : IRemoteProxy(impl) {}; ~DisplayManagerProxy() {}; diff --git a/dmserver/include/display_manager_stub.h b/dmserver/include/display_manager_stub.h index d88c4a0c65..f6e6f7a082 100644 --- a/dmserver/include/display_manager_stub.h +++ b/dmserver/include/display_manager_stub.h @@ -25,8 +25,8 @@ class DisplayManagerStub : public IRemoteStub { public: DisplayManagerStub() = default; ~DisplayManagerStub() = default; - virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) override; + virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, + MessageOption& option) override; }; } // namespace OHOS::Rosen diff --git a/dmserver/include/sensor_connector.h b/dmserver/include/sensor_connector.h index 434ebda292..24dace7618 100644 --- a/dmserver/include/sensor_connector.h +++ b/dmserver/include/sensor_connector.h @@ -53,7 +53,7 @@ private: static void SubscribeGravitySensor(); static void UnsubscribeGravitySensor(); - static void HandleGravitySensorEventCallback(SensorEvent *event); + static void HandleGravitySensorEventCallback(SensorEvent* event); static bool CheckCallbackTimeInterval(); static int CalcRotationDegree(GravityData* gravityData); static SensorRotation CalcSensorRotation(int sensorDegree); diff --git a/dmserver/src/abstract_screen_controller.cpp b/dmserver/src/abstract_screen_controller.cpp index c306b4b9c1..f2179b46a0 100644 --- a/dmserver/src/abstract_screen_controller.cpp +++ b/dmserver/src/abstract_screen_controller.cpp @@ -797,7 +797,7 @@ void AbstractScreenController::UpdateScreenGroupLayout(sptr } // update display node's start point from left to right. - std::sort(screens.begin(), screens.end(), [](const auto &a, const auto &b) { + std::sort(screens.begin(), screens.end(), [](const auto& a, const auto& b) { return a->startPoint_.posX_ < b->startPoint_.posX_; }); diff --git a/dmserver/src/display_manager_stub.cpp b/dmserver/src/display_manager_stub.cpp index d511aa4449..63870babaf 100644 --- a/dmserver/src/display_manager_stub.cpp +++ b/dmserver/src/display_manager_stub.cpp @@ -30,8 +30,8 @@ namespace { const static uint32_t MAX_SCREEN_SIZE = 32; } -int32_t DisplayManagerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) +int32_t DisplayManagerStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, + MessageOption& option) { WLOGFD("OnRemoteRequest code is %{public}u", code); if (data.ReadInterfaceToken() != GetDescriptor()) { diff --git a/dmserver/src/sensor_connector.cpp b/dmserver/src/sensor_connector.cpp index 11b51987a2..a1955b4ca7 100644 --- a/dmserver/src/sensor_connector.cpp +++ b/dmserver/src/sensor_connector.cpp @@ -124,7 +124,7 @@ void GravitySensorSubscriber::UnsubscribeGravitySensor() isGravitySensorSubscribed_ = false; } -void GravitySensorSubscriber::HandleGravitySensorEventCallback(SensorEvent *event) +void GravitySensorSubscriber::HandleGravitySensorEventCallback(SensorEvent* event) { if (!CheckCallbackTimeInterval() || event == nullptr) { return; diff --git a/extension/window_extension/include/window_extension_context.h b/extension/window_extension/include/window_extension_context.h index 81ce5795e6..86e87a536d 100644 --- a/extension/window_extension/include/window_extension_context.h +++ b/extension/window_extension/include/window_extension_context.h @@ -39,7 +39,7 @@ public: * * @return errCode WM_OK on success, others on failure. */ - WMError StartAbility(const AAFwk::Want &want, const AAFwk::StartOptions &startOptions) const; + WMError StartAbility(const AAFwk::Want& want, const AAFwk::StartOptions& startOptions) const; static const size_t CONTEXT_TYPE_ID; private: diff --git a/extension/window_extension/src/js_window_extension.cpp b/extension/window_extension/src/js_window_extension.cpp index 14d94590c6..139eaaa520 100644 --- a/extension/window_extension/src/js_window_extension.cpp +++ b/extension/window_extension/src/js_window_extension.cpp @@ -51,7 +51,7 @@ public: } }; -napi_value AttachWindowExtensionContext(napi_env env, void *value, void *) +napi_value AttachWindowExtensionContext(napi_env env, void* value, void *) { WLOGI("AttachWindowExtensionContext"); if (value == nullptr) { @@ -82,7 +82,7 @@ napi_value AttachWindowExtensionContext(napi_env env, void *value, void *) return nullptr; } napi_wrap(env, contextObj, workContext, - [](napi_env, void *data, void *) { + [](napi_env, void* data, void *) { WLOGI("Finalizer for weak_ptr service extension context is called"); delete static_cast *>(data); }, nullptr, nullptr); @@ -174,7 +174,7 @@ void JsWindowExtension::BindContext(napi_env env, napi_value obj) napi_set_named_property(env, obj, "context", contextObj); napi_wrap(env, contextObj, workContext, - [](napi_env, void *data, void *) { + [](napi_env, void* data, void *) { WLOGI("Finalizer for weak_ptr extension context is called"); delete static_cast*>(data); }, nullptr, nullptr); diff --git a/extension/window_extension/src/window_extension_context.cpp b/extension/window_extension/src/window_extension_context.cpp index b2a3409786..4bacf24876 100644 --- a/extension/window_extension/src/window_extension_context.cpp +++ b/extension/window_extension/src/window_extension_context.cpp @@ -29,7 +29,7 @@ namespace { const size_t WindowExtensionContext::CONTEXT_TYPE_ID(std::hash {} ("WindowExtensionContext")); int WindowExtensionContext::ILLEGAL_REQUEST_CODE(-1); -WMError WindowExtensionContext::StartAbility(const AAFwk::Want &want, const AAFwk::StartOptions &startOptions) const +WMError WindowExtensionContext::StartAbility(const AAFwk::Want& want, const AAFwk::StartOptions& startOptions) const { WLOGFD("Start ability begin, ability:%{public}s.", want.GetElement().GetAbilityName().c_str()); ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, startOptions, token_, diff --git a/interfaces/innerkits/dm/display_manager.h b/interfaces/innerkits/dm/display_manager.h index 40c98856c1..6a657629b4 100644 --- a/interfaces/innerkits/dm/display_manager.h +++ b/interfaces/innerkits/dm/display_manager.h @@ -229,7 +229,7 @@ public: * @param errorCode error code. * @return PixelMap object of screenshot. */ - std::shared_ptr GetSnapshotByPicker(Media::Rect &rect, DmErrorCode* errorCode = nullptr); + std::shared_ptr GetSnapshotByPicker(Media::Rect& rect, DmErrorCode* errorCode = nullptr); /** * @brief Get screenshot of the target display. @@ -241,8 +241,8 @@ public: * @param errorCode error code. * @return PixelMap object of screenshot. */ - std::shared_ptr GetScreenshot(DisplayId displayId, const Media::Rect &rect, - const Media::Size &size, int rotation, DmErrorCode* errorCode = nullptr); + std::shared_ptr GetScreenshot(DisplayId displayId, const Media::Rect& rect, + const Media::Size& size, int rotation, DmErrorCode* errorCode = nullptr); /** * @brief Begin to wake up screen. diff --git a/interfaces/innerkits/wm/wm_common.h b/interfaces/innerkits/wm/wm_common.h index 496e25e3d0..6f53398bbc 100644 --- a/interfaces/innerkits/wm/wm_common.h +++ b/interfaces/innerkits/wm/wm_common.h @@ -446,7 +446,7 @@ struct PointInfo { * @brief topN main window info. */ struct MainWindowInfo : public Parcelable { - virtual bool Marshalling(Parcel &parcel) const override + virtual bool Marshalling(Parcel& parcel) const override { if (!parcel.WriteInt32(pid_)) { return false; diff --git a/interfaces/kits/cj/display_runtime/cj_display_impl.cpp b/interfaces/kits/cj/display_runtime/cj_display_impl.cpp index 10f2307970..0a6e33c8d2 100644 --- a/interfaces/kits/cj/display_runtime/cj_display_impl.cpp +++ b/interfaces/kits/cj/display_runtime/cj_display_impl.cpp @@ -37,7 +37,7 @@ namespace { static thread_local std::map> g_cjDisplayMap; std::recursive_mutex g_mutex; -void SetCRect(const DMRect &row, CRect *ptr) +void SetCRect(const DMRect& row, CRect* ptr) { ptr->left = row.posX_; ptr->top = row.posY_; @@ -59,7 +59,7 @@ CRect* CreateCBoundingRects(std::vector &bound) return result; } -void SetCWaterfallDisplayAreaRects(const WaterfallDisplayAreaRects &area, CCutoutInfo * info) +void SetCWaterfallDisplayAreaRects(const WaterfallDisplayAreaRects& area, CCutoutInfo * info) { if (info == nullptr || info->boundingRects == nullptr) { return; diff --git a/interfaces/kits/cj/display_runtime/cj_display_manager.cpp b/interfaces/kits/cj/display_runtime/cj_display_manager.cpp index f0f2f4106e..16a74d2ae4 100644 --- a/interfaces/kits/cj/display_runtime/cj_display_manager.cpp +++ b/interfaces/kits/cj/display_runtime/cj_display_manager.cpp @@ -23,7 +23,7 @@ namespace OHOS { namespace Rosen { -static void SetDisplayObject(sptr &obj, RetStruct &ret) +static void SetDisplayObject(sptr &obj, RetStruct& ret) { auto result = DisplayImpl::CreateDisplayImpl(obj); if (result == nullptr || ret.data == nullptr) { @@ -42,7 +42,7 @@ static void SetDisplayObject(sptr &obj, RetStruct &ret) ret.code = static_cast(DmErrorCode::DM_OK); } -static void SetDisplaysArrayObject(std::vector> &list, RetStruct &ret) +static void SetDisplaysArrayObject(std::vector> &list, RetStruct& ret) { int64_t *displayImplIdList = static_cast(malloc(sizeof(int64_t) * list.size())); if (displayImplIdList == nullptr) { diff --git a/interfaces/kits/cj/window_runtime/window_ffi.cpp b/interfaces/kits/cj/window_runtime/window_ffi.cpp index 42a1e655b5..ca8518ed4c 100644 --- a/interfaces/kits/cj/window_runtime/window_ffi.cpp +++ b/interfaces/kits/cj/window_runtime/window_ffi.cpp @@ -398,7 +398,7 @@ int32_t FFiOHOSWindowSetPreferredOrientation(int64_t id, uint32_t orientation) return res; } -int32_t FFiOHOSWindowGetWindowAvoidArea(int64_t id, uint32_t areaType, OHOS::Rosen::CAvoidArea *retPtr) +int32_t FFiOHOSWindowGetWindowAvoidArea(int64_t id, uint32_t areaType, OHOS::Rosen::CAvoidArea* retPtr) { TLOGI(WmsLogTag::WMS_DIALOG, "[Window] FFiOHOSWindowGetWindowAvoidArea start"); auto instance = FFIData::GetData(id); @@ -817,7 +817,7 @@ RetDataI64 FfiOHOSGetMainWindow(int64_t id) return ret; } -RetDataI64 FfiOHOSCreateSubWindow(int64_t id, char *name) +RetDataI64 FfiOHOSCreateSubWindow(int64_t id, char* name) { TLOGI(WmsLogTag::WMS_DIALOG, "[WindowStage] createSubWindow start"); RetDataI64 ret; @@ -842,7 +842,7 @@ RetStruct FfiOHOSGetSubWindow(int64_t id) return ret; } -int32_t FfiOHOSLoadContent(int64_t id, char *path) +int32_t FfiOHOSLoadContent(int64_t id, char* path) { TLOGI(WmsLogTag::WMS_DIALOG, "[WindowStage] loadContent start"); std::string url = path; @@ -854,7 +854,7 @@ int32_t FfiOHOSLoadContent(int64_t id, char *path) return instance->OnLoadContent(url, storageJson, false); } -int32_t FfiOHOSLoadContentByName(int64_t id, char *name) +int32_t FfiOHOSLoadContentByName(int64_t id, char* name) { TLOGI(WmsLogTag::WMS_DIALOG, "[WindowStage] loadContentByName start"); return SUCCESS_CODE; diff --git a/interfaces/kits/cj/window_runtime/window_stage_impl.cpp b/interfaces/kits/cj/window_runtime/window_stage_impl.cpp index e25b5dafde..4055e47607 100644 --- a/interfaces/kits/cj/window_runtime/window_stage_impl.cpp +++ b/interfaces/kits/cj/window_runtime/window_stage_impl.cpp @@ -21,7 +21,7 @@ namespace OHOS { namespace Rosen { -void CreateCjSubWindowArrayObject(std::vector> &vec, RetStruct &ret) +void CreateCjSubWindowArrayObject(std::vector> &vec, RetStruct& ret) { int64_t *windowList = static_cast(malloc(sizeof(int64_t) * vec.size())); if (windowList == nullptr) { @@ -45,7 +45,7 @@ void CreateCjSubWindowArrayObject(std::vector> &vec, RetStruct &ret return; } -int32_t CJWindowStageImpl::GetMainWindow(int64_t &windowId) +int32_t CJWindowStageImpl::GetMainWindow(int64_t& windowId) { auto weakScene = windowScene_.lock(); if (weakScene == nullptr) { @@ -66,7 +66,7 @@ int32_t CJWindowStageImpl::GetMainWindow(int64_t &windowId) return static_cast(WmErrorCode::WM_OK); } -int32_t CJWindowStageImpl::CreateSubWindow(std::string name, int64_t &windowId) +int32_t CJWindowStageImpl::CreateSubWindow(std::string name, int64_t& windowId) { auto weakScene = windowScene_.lock(); if (weakScene == nullptr) { @@ -109,8 +109,8 @@ RetStruct CJWindowStageImpl::GetSubWindow() return ret; } -int32_t CJWindowStageImpl::OnLoadContent(const std::string &contexUrl, - const std::string &storageJson, bool isLoadedByName) +int32_t CJWindowStageImpl::OnLoadContent(const std::string& contexUrl, + const std::string& storageJson, bool isLoadedByName) { auto weakScene = windowScene_.lock(); if (weakScene == nullptr) { diff --git a/interfaces/kits/napi/common/dm_napi_common.cpp b/interfaces/kits/napi/common/dm_napi_common.cpp index a727036e51..10712a1204 100644 --- a/interfaces/kits/napi/common/dm_napi_common.cpp +++ b/interfaces/kits/napi/common/dm_napi_common.cpp @@ -23,7 +23,7 @@ #include "ipc_skeleton.h" namespace OHOS { -napi_status SetMemberInt32(napi_env env, napi_value result, const char *key, int32_t value) +napi_status SetMemberInt32(napi_env env, napi_value result, const char* key, int32_t value) { napi_value num; napi_status ret = napi_ok; @@ -40,7 +40,7 @@ napi_status SetMemberInt32(napi_env env, napi_value result, const char *key, int return ret; } -napi_status SetMemberUint32(napi_env env, napi_value result, const char *key, uint32_t value) +napi_status SetMemberUint32(napi_env env, napi_value result, const char* key, uint32_t value) { napi_value num; napi_status ret = napi_ok; @@ -57,7 +57,7 @@ napi_status SetMemberUint32(napi_env env, napi_value result, const char *key, ui return ret; } -napi_status SetMemberUndefined(napi_env env, napi_value result, const char *key) +napi_status SetMemberUndefined(napi_env env, napi_value result, const char* key) { napi_value undefined; napi_status ret = napi_ok; @@ -74,7 +74,7 @@ napi_status SetMemberUndefined(napi_env env, napi_value result, const char *key) return ret; } -bool CheckCallingPermission(const std::string &permission) +bool CheckCallingPermission(const std::string& permission) { WLOGI("CheckCallingPermission, permission:%{public}s", permission.c_str()); if (!permission.empty() && diff --git a/interfaces/kits/napi/common/dm_napi_common.h b/interfaces/kits/napi/common/dm_napi_common.h index 159d06b2bb..cd02be1c2a 100644 --- a/interfaces/kits/napi/common/dm_napi_common.h +++ b/interfaces/kits/napi/common/dm_napi_common.h @@ -44,9 +44,9 @@ const int PARAM_NUMBER = 2; // 2: callback func input number, also reused by Pro } while (0) namespace OHOS { -napi_status SetMemberInt32(napi_env env, napi_value result, const char *key, int32_t value); -napi_status SetMemberUint32(napi_env env, napi_value result, const char *key, uint32_t value); -napi_status SetMemberUndefined(napi_env env, napi_value result, const char *key); +napi_status SetMemberInt32(napi_env env, napi_value result, const char* key, int32_t value); +napi_status SetMemberUint32(napi_env env, napi_value result, const char* key, uint32_t value); +napi_status SetMemberUndefined(napi_env env, napi_value result, const char* key); bool CheckCallingPermission(const std::string& permission); void SetErrorInfo(napi_env env, Rosen::DmErrorCode wret, const std::string& errMessage, @@ -67,7 +67,7 @@ struct AsyncCallbackInfo { }; template -void AsyncFunc(napi_env env, void *data) +void AsyncFunc(napi_env env, void* data) { AsyncCallbackInfo *info = reinterpret_cast *>(data); if (info->async) { @@ -76,7 +76,7 @@ void AsyncFunc(napi_env env, void *data) } template -void CompleteFunc(napi_env env, napi_status status, void *data) +void CompleteFunc(napi_env env, napi_status status, void* data) { AsyncCallbackInfo *info = reinterpret_cast *>(data); napi_value result[PARAM_NUMBER] = {nullptr}; diff --git a/interfaces/kits/napi/embeddable_window_stage/embeddable_window_stage_module.cpp b/interfaces/kits/napi/embeddable_window_stage/embeddable_window_stage_module.cpp index 21945718b6..1eca9f0e42 100644 --- a/interfaces/kits/napi/embeddable_window_stage/embeddable_window_stage_module.cpp +++ b/interfaces/kits/napi/embeddable_window_stage/embeddable_window_stage_module.cpp @@ -31,7 +31,7 @@ extern "C" __attribute__((constructor)) void NAPI_application_embeddablewindowst } extern "C" __attribute__((visibility("default"))) -void NAPI_application_embeddablewindowstage_GetJSCode(const char **buf, int *bufLen) +void NAPI_application_embeddablewindowstage_GetJSCode(const char **buf, int* bufLen) { if (buf != nullptr) { *buf = _binary_embeddable_window_stage_js_start; @@ -44,7 +44,7 @@ void NAPI_application_embeddablewindowstage_GetJSCode(const char **buf, int *buf // embeddable_window_stage JS register extern "C" __attribute__((visibility("default"))) -void NAPI_application_embeddablewindowstage_GetABCCode(const char **buf, int *buflen) +void NAPI_application_embeddablewindowstage_GetABCCode(const char **buf, int* buflen) { if (buf != nullptr) { *buf = _binary_embeddable_window_stage_abc_start; diff --git a/interfaces/kits/napi/extension_window/extension_window_module.cpp b/interfaces/kits/napi/extension_window/extension_window_module.cpp index 35faa704c7..027b1721cc 100644 --- a/interfaces/kits/napi/extension_window/extension_window_module.cpp +++ b/interfaces/kits/napi/extension_window/extension_window_module.cpp @@ -31,7 +31,7 @@ extern "C" __attribute__((constructor)) void NAPI_application_extensionWindow_Au } extern "C" __attribute__((visibility("default"))) -void NAPI_application_extensionWindow_GetJSCode(const char **buf, int *bufLen) +void NAPI_application_extensionWindow_GetJSCode(const char **buf, int* bufLen) { if (buf != nullptr) { *buf = _binary_extension_window_js_start; @@ -44,7 +44,7 @@ void NAPI_application_extensionWindow_GetJSCode(const char **buf, int *bufLen) // extension_window JS register extern "C" __attribute__((visibility("default"))) -void NAPI_application_extensionWindow_GetABCCode(const char **buf, int *buflen) +void NAPI_application_extensionWindow_GetABCCode(const char **buf, int* buflen) { if (buf != nullptr) { *buf = _binary_extension_window_abc_start; diff --git a/interfaces/kits/napi/extension_window/js_extension_window_listener.cpp b/interfaces/kits/napi/extension_window/js_extension_window_listener.cpp index 015167fd14..7ede0ce022 100644 --- a/interfaces/kits/napi/extension_window/js_extension_window_listener.cpp +++ b/interfaces/kits/napi/extension_window/js_extension_window_listener.cpp @@ -125,7 +125,7 @@ void JsExtensionWindowListener::OnAvoidAreaChanged(const AvoidArea avoidArea, Av TLOGI(WmsLogTag::WMS_UIEXT, "[NAPI]OnAvoidAreaChanged"); // js callback should run in js thread std::unique_ptr complete = std::make_unique ( - [self = weakRef_, avoidArea, type, eng = env_] (napi_env env, NapiAsyncTask &task, int32_t status) { + [self = weakRef_, avoidArea, type, eng = env_] (napi_env env, NapiAsyncTask& task, int32_t status) { auto thisListener = self.promote(); if (thisListener == nullptr || eng == nullptr) { TLOGE(WmsLogTag::WMS_UIEXT, "[NAPI]this listener or eng is nullptr"); diff --git a/interfaces/kits/napi/picture_in_picture_napi/js_pip_controller.cpp b/interfaces/kits/napi/picture_in_picture_napi/js_pip_controller.cpp index d27a9765c6..eacc60a12b 100644 --- a/interfaces/kits/napi/picture_in_picture_napi/js_pip_controller.cpp +++ b/interfaces/kits/napi/picture_in_picture_napi/js_pip_controller.cpp @@ -36,7 +36,7 @@ namespace { const std::string CONTROL_EVENT_CB = "controlEvent"; } -void BindFunctions(napi_env env, napi_value object, const char *moduleName) +void BindFunctions(napi_env env, napi_value object, const char* moduleName) { BindNativeFunction(env, object, "startPiP", moduleName, JsPipController::StartPictureInPicture); BindNativeFunction(env, object, "stopPiP", moduleName, JsPipController::StopPictureInPicture); diff --git a/interfaces/kits/napi/screenshot/native_screenshot_module.cpp b/interfaces/kits/napi/screenshot/native_screenshot_module.cpp index 88717ad133..71f8b10241 100644 --- a/interfaces/kits/napi/screenshot/native_screenshot_module.cpp +++ b/interfaces/kits/napi/screenshot/native_screenshot_module.cpp @@ -61,7 +61,7 @@ static napi_valuetype GetType(napi_env env, napi_value root) return res; } -static void GetDisplayId(napi_env env, std::unique_ptr ¶m, napi_value &argv) +static void GetDisplayId(napi_env env, std::unique_ptr& param, napi_value& argv) { GNAPI_LOG("Get Screenshot Option: GetDisplayId"); napi_value displayId; @@ -76,7 +76,7 @@ static void GetDisplayId(napi_env env, std::unique_ptr ¶m, napi_value } } -static void GetRotation(napi_env env, std::unique_ptr ¶m, napi_value &argv) +static void GetRotation(napi_env env, std::unique_ptr& param, napi_value& argv) { GNAPI_LOG("Get Screenshot Option: GetRotation"); napi_value rotation; @@ -89,7 +89,7 @@ static void GetRotation(napi_env env, std::unique_ptr ¶m, napi_value } } -static void GetScreenRect(napi_env env, std::unique_ptr ¶m, napi_value &argv) +static void GetScreenRect(napi_env env, std::unique_ptr& param, napi_value& argv) { GNAPI_LOG("Get Screenshot Option: GetScreenRect"); napi_value screenRect; @@ -137,7 +137,7 @@ static void GetScreenRect(napi_env env, std::unique_ptr ¶m, napi_valu } } -static void GetImageSize(napi_env env, std::unique_ptr ¶m, napi_value &argv) +static void GetImageSize(napi_env env, std::unique_ptr& param, napi_value& argv) { GNAPI_LOG("Get Screenshot Option: ImageSize"); napi_value imageSize; @@ -163,7 +163,7 @@ static void GetImageSize(napi_env env, std::unique_ptr ¶m, napi_value } } -static void GetScreenshotParam(napi_env env, std::unique_ptr ¶m, napi_value &argv) +static void GetScreenshotParam(napi_env env, std::unique_ptr& param, napi_value& argv) { if (param == nullptr) { GNAPI_LOG("param == nullptr, use default param"); @@ -333,7 +333,7 @@ napi_value MainFunc(napi_env env, napi_callback_info info) } } // namespace save -void SetNamedProperty(napi_env env, napi_value dstObj, const int32_t objValue, const char *propName) +void SetNamedProperty(napi_env env, napi_value dstObj, const int32_t objValue, const char* propName) { napi_value prop = nullptr; napi_create_int32(env, objValue, &prop); diff --git a/interfaces/kits/napi/window_extension_ability/window_extension_ability_module.cpp b/interfaces/kits/napi/window_extension_ability/window_extension_ability_module.cpp index 7ae50a4ab4..5ae7e9265e 100644 --- a/interfaces/kits/napi/window_extension_ability/window_extension_ability_module.cpp +++ b/interfaces/kits/napi/window_extension_ability/window_extension_ability_module.cpp @@ -32,7 +32,7 @@ void NAPI_application_WindowExtensionAbility_AutoRegister() } extern "C" __attribute__((visibility("default"))) -void NAPI_application_WindowExtensionAbility_GetJSCode(const char **buf, int *bufLen) +void NAPI_application_WindowExtensionAbility_GetJSCode(const char** buf, int* bufLen) { if (buf != nullptr) { *buf = _binary_window_extension_ability_js_start; @@ -44,7 +44,7 @@ void NAPI_application_WindowExtensionAbility_GetJSCode(const char **buf, int *bu } extern "C" __attribute__((visibility("default"))) -void NAPI_application_WindowExtensionAbility_GetABCCode(const char **buf, int *buflen) +void NAPI_application_WindowExtensionAbility_GetABCCode(const char** buf, int* buflen) { if (buf != nullptr) { *buf = _binary_window_extension_ability_abc_start; diff --git a/interfaces/kits/napi/window_extension_context/window_extension_context_module.cpp b/interfaces/kits/napi/window_extension_context/window_extension_context_module.cpp index a25a384bfd..5eb2fd6e6c 100644 --- a/interfaces/kits/napi/window_extension_context/window_extension_context_module.cpp +++ b/interfaces/kits/napi/window_extension_context/window_extension_context_module.cpp @@ -31,7 +31,7 @@ extern "C" __attribute__((constructor)) void NAPI_application_WindowExtensionCon } extern "C" __attribute__((visibility("default"))) void NAPI_application_WindowExtensionContext_GetJSCode( - const char **buf, int *bufLen) + const char** buf, int* bufLen) { if (buf != nullptr) { *buf = _binary_window_extension_context_js_start; @@ -44,7 +44,7 @@ extern "C" __attribute__((visibility("default"))) void NAPI_application_WindowEx // window extension context JS register extern "C" __attribute__((visibility("default"))) void NAPI_application_WindowExtensionContext_GetABCCode( - const char **buf, int *buflen) + const char** buf, int* buflen) { if (buf != nullptr) { *buf = _binary_window_extension_context_abc_start; diff --git a/interfaces/kits/napi/window_runtime/window_napi/js_window.cpp b/interfaces/kits/napi/window_runtime/window_napi/js_window.cpp index 1977904c48..1594347beb 100644 --- a/interfaces/kits/napi/window_runtime/window_napi/js_window.cpp +++ b/interfaces/kits/napi/window_runtime/window_napi/js_window.cpp @@ -2493,7 +2493,7 @@ napi_value JsWindow::OnDisableLandscapeMultiWindow(napi_env env, napi_callback_i wptr weakToken(windowToken_); NapiAsyncTask::CompleteCallback complete = - [weakToken, err](napi_env env, NapiAsyncTask &task, int32_t status) mutable { + [weakToken, err](napi_env env, NapiAsyncTask& task, int32_t status) mutable { auto weakWindow = weakToken.promote(); err = (weakWindow == nullptr) ? WmErrorCode::WM_ERROR_STATE_ABNORMALLY : err; if (err != WmErrorCode::WM_OK) { @@ -3930,7 +3930,7 @@ napi_value JsWindow::OnSetSingleFrameComposerEnabled(napi_env env, napi_callback return result; } -void GetSubWindowId(napi_env env, napi_value nativeVal, WmErrorCode &errCode, int32_t &subWindowId) +void GetSubWindowId(napi_env env, napi_value nativeVal, WmErrorCode& errCode, int32_t& subWindowId) { if (nativeVal == nullptr) { WLOGFE("Failed to get subWindowId"); @@ -6051,7 +6051,7 @@ napi_value JsWindow::OnIsFocused(napi_env env, napi_callback_info info) return CreateJsValue(env, isFocused); } -void BindFunctions(napi_env env, napi_value object, const char *moduleName) +void BindFunctions(napi_env env, napi_value object, const char* moduleName) { BindNativeFunction(env, object, "show", moduleName, JsWindow::Show); BindNativeFunction(env, object, "showWindow", moduleName, JsWindow::ShowWindow); diff --git a/interfaces/kits/napi/window_runtime/window_napi/js_window.h b/interfaces/kits/napi/window_runtime/window_napi/js_window.h index a59e8b3ab9..06df4b07ed 100644 --- a/interfaces/kits/napi/window_runtime/window_napi/js_window.h +++ b/interfaces/kits/napi/window_runtime/window_napi/js_window.h @@ -33,7 +33,7 @@ namespace OHOS { namespace Rosen { napi_value CreateJsWindowObject(napi_env env, sptr& window); std::shared_ptr FindJsWindowObject(const std::string& windowName); -void BindFunctions(napi_env env, napi_value object, const char *moduleName); +void BindFunctions(napi_env env, napi_value object, const char* moduleName); napi_value NapiGetUndefined(napi_env env); napi_valuetype GetType(napi_env env, napi_value value); bool NapiIsCallable(napi_env env, napi_value value); diff --git a/interfaces/kits/napi/window_runtime/window_napi/js_window_listener.cpp b/interfaces/kits/napi/window_runtime/window_napi/js_window_listener.cpp index 5bf59340f7..77778e0a65 100644 --- a/interfaces/kits/napi/window_runtime/window_napi/js_window_listener.cpp +++ b/interfaces/kits/napi/window_runtime/window_napi/js_window_listener.cpp @@ -118,7 +118,7 @@ void JsWindowListener::OnSystemBarPropertyChange(DisplayId displayId, const Syst // js callback should run in js thread std::unique_ptr complete = std::make_unique ( [self = weakRef_, displayId, tints, eng = env_] (napi_env env, - NapiAsyncTask &task, int32_t status) { + NapiAsyncTask& task, int32_t status) { auto thisListener = self.promote(); if (thisListener == nullptr || eng == nullptr) { @@ -152,7 +152,7 @@ void JsWindowListener::OnAvoidAreaChanged(const AvoidArea avoidArea, AvoidAreaTy // js callback should run in js thread std::unique_ptr complete = std::make_unique ( [self = weakRef_, avoidArea, type, eng = env_] (napi_env env, - NapiAsyncTask &task, int32_t status) { + NapiAsyncTask& task, int32_t status) { auto thisListener = self.promote(); if (thisListener == nullptr || eng == nullptr) { WLOGFE("[NAPI]this listener or eng is nullptr"); @@ -270,7 +270,7 @@ void JsWindowListener::OnSizeChange(const sptr& info, // js callback should run in js thread std::unique_ptr complete = std::make_unique ( [self = weakRef_, info, eng = env_] (napi_env env, - NapiAsyncTask &task, int32_t status) { + NapiAsyncTask& task, int32_t status) { auto thisListener = self.promote(); if (thisListener == nullptr || eng == nullptr) { WLOGFE("[NAPI]this listener or eng is nullptr"); @@ -291,7 +291,7 @@ void JsWindowListener::OnTouchOutside() const { WLOGI("CALLED"); std::unique_ptr complete = std::make_unique ( - [self = weakRef_] (napi_env env, NapiAsyncTask &task, int32_t status) { + [self = weakRef_] (napi_env env, NapiAsyncTask& task, int32_t status) { auto thisListener = self.promote(); if (thisListener == nullptr) { WLOGFE("[NAPI]this listener is nullptr"); @@ -311,7 +311,7 @@ void JsWindowListener::OnScreenshot() { WLOGI("CALLED"); std::unique_ptr complete = std::make_unique ( - [self = wptr(this)] (napi_env env, NapiAsyncTask &task, int32_t status) { + [self = wptr(this)] (napi_env env, NapiAsyncTask& task, int32_t status) { auto thisListener = self.promote(); if (thisListener == nullptr) { WLOGFE("[NAPI]this listener is nullptr"); @@ -330,7 +330,7 @@ void JsWindowListener::OnScreenshot() void JsWindowListener::OnDialogTargetTouch() const { std::unique_ptr complete = std::make_unique ( - [self = weakRef_] (napi_env env, NapiAsyncTask &task, int32_t status) { + [self = weakRef_] (napi_env env, NapiAsyncTask& task, int32_t status) { auto thisListener = self.promote(); if (thisListener == nullptr) { WLOGFE("[NAPI]this listener is nullptr"); @@ -349,7 +349,7 @@ void JsWindowListener::OnDialogTargetTouch() const void JsWindowListener::OnDialogDeathRecipient() const { std::unique_ptr complete = std::make_unique ( - [self = weakRef_] (napi_env env, NapiAsyncTask &task, int32_t status) { + [self = weakRef_] (napi_env env, NapiAsyncTask& task, int32_t status) { auto thisListener = self.promote(); if (thisListener == nullptr) { WLOGFE("[NAPI]this listener is nullptr"); @@ -368,7 +368,7 @@ void JsWindowListener::OnDialogDeathRecipient() const void JsWindowListener::OnGestureNavigationEnabledUpdate(bool enable) { std::unique_ptr complete = std::make_unique ( - [self = weakRef_, enable, eng = env_] (napi_env env, NapiAsyncTask &task, int32_t status) { + [self = weakRef_, enable, eng = env_] (napi_env env, NapiAsyncTask& task, int32_t status) { auto thisListener = self.promote(); if (thisListener == nullptr || eng == nullptr) { WLOGFE("[NAPI]this listener or eng is nullptr"); @@ -388,7 +388,7 @@ void JsWindowListener::OnGestureNavigationEnabledUpdate(bool enable) void JsWindowListener::OnWaterMarkFlagUpdate(bool showWaterMark) { std::unique_ptr complete = std::make_unique ( - [self = weakRef_, showWaterMark, eng = env_] (napi_env env, NapiAsyncTask &task, int32_t status) { + [self = weakRef_, showWaterMark, eng = env_] (napi_env env, NapiAsyncTask& task, int32_t status) { auto thisListener = self.promote(); if (thisListener == nullptr || eng == nullptr) { WLOGFE("[NAPI]this listener or eng is nullptr"); @@ -418,7 +418,7 @@ int64_t JsWindowListener::GetTimeout() const void JsWindowListener::OnWindowNoInteractionCallback() { std::unique_ptr complete = std::make_unique ( - [self = weakRef_] (napi_env env, NapiAsyncTask &task, int32_t status) { + [self = weakRef_] (napi_env env, NapiAsyncTask& task, int32_t status) { auto thisListener = self.promote(); if (thisListener == nullptr) { WLOGFE("[NAPI]this listener is nullptr"); @@ -440,7 +440,7 @@ void JsWindowListener::OnWindowStatusChange(WindowStatus windowstatus) // js callback should run in js thread std::unique_ptr complete = std::make_unique ( [self = weakRef_, windowstatus, eng = env_] (napi_env env, - NapiAsyncTask &task, int32_t status) { + NapiAsyncTask& task, int32_t status) { auto thisListener = self.promote(); if (thisListener == nullptr || eng == nullptr) { WLOGFE("[NAPI]this listener or eng is nullptr"); @@ -463,7 +463,7 @@ void JsWindowListener::OnWindowStatusChange(WindowStatus windowstatus) void JsWindowListener::OnWindowVisibilityChangedCallback(const bool isVisible) { std::unique_ptr complete = std::make_unique( - [self = weakRef_, isVisible, eng = env_] (napi_env env, NapiAsyncTask &task, int32_t status) { + [self = weakRef_, isVisible, eng = env_] (napi_env env, NapiAsyncTask& task, int32_t status) { auto thisListener = self.promote(); if (thisListener == nullptr || eng == nullptr) { WLOGFE("This listener or eng is nullptr"); @@ -485,7 +485,7 @@ void JsWindowListener::OnWindowTitleButtonRectChanged(const TitleButtonRect& tit WLOGFD("[NAPI]OnWindowTitleButtonRectChanged"); std::unique_ptr complete = std::make_unique ( [self = weakRef_, titleButtonRect, eng = env_] (napi_env env, - NapiAsyncTask &task, int32_t status) { + NapiAsyncTask& task, int32_t status) { auto thisListener = self.promote(); if (thisListener == nullptr || eng == nullptr) { WLOGFE("[NAPI]this listener or eng is nullptr"); diff --git a/interfaces/kits/napi/window_runtime/window_stage_napi/js_window_stage.cpp b/interfaces/kits/napi/window_runtime/window_stage_napi/js_window_stage.cpp index fd5fa9c2ba..79e8071f05 100644 --- a/interfaces/kits/napi/window_runtime/window_stage_napi/js_window_stage.cpp +++ b/interfaces/kits/napi/window_runtime/window_stage_napi/js_window_stage.cpp @@ -728,7 +728,7 @@ napi_value CreateJsWindowStage(napi_env env, std::shared_ptr std::unique_ptr jsWindowStage = std::make_unique(windowScene); napi_wrap(env, objValue, jsWindowStage.release(), JsWindowStage::Finalizer, nullptr, nullptr); - const char *moduleName = "JsWindowStage"; + const char* moduleName = "JsWindowStage"; BindNativeFunction(env, objValue, "setUIContent", moduleName, JsWindowStage::SetUIContent); BindNativeFunction(env, diff --git a/interfaces/kits/napi/window_runtime/window_stage_napi/window_stage_module.cpp b/interfaces/kits/napi/window_runtime/window_stage_napi/window_stage_module.cpp index cfc4be9d0b..5ff86ff130 100644 --- a/interfaces/kits/napi/window_runtime/window_stage_napi/window_stage_module.cpp +++ b/interfaces/kits/napi/window_runtime/window_stage_napi/window_stage_module.cpp @@ -31,7 +31,7 @@ extern "C" __attribute__((constructor)) void NAPI_application_WindowStage_AutoRe } extern "C" __attribute__((visibility("default"))) -void NAPI_application_WindowStage_GetJSCode(const char **buf, int *bufLen) +void NAPI_application_WindowStage_GetJSCode(const char** buf, int* bufLen) { if (buf != nullptr) { *buf = _binary_window_stage_js_start; @@ -44,7 +44,7 @@ void NAPI_application_WindowStage_GetJSCode(const char **buf, int *bufLen) // window_stage JS register extern "C" __attribute__((visibility("default"))) -void NAPI_application_WindowStage_GetABCCode(const char **buf, int *buflen) +void NAPI_application_WindowStage_GetABCCode(const char** buf, int* buflen) { if (buf != nullptr) { *buf = _binary_window_stage_abc_start; diff --git a/previewer/mock/js_window_listener.h b/previewer/mock/js_window_listener.h index beb519922a..4fb1363a26 100644 --- a/previewer/mock/js_window_listener.h +++ b/previewer/mock/js_window_listener.h @@ -39,7 +39,7 @@ public: : env_(env), jsCallBack_(callback), weakRef_(wptr(this)) {} ~JsWindowListener(); void OnAvoidAreaChanged(const AvoidArea avoidArea, AvoidAreaType type) override; - void CallJsMethod(const char* methodName, napi_value const *argv = nullptr, size_t argc = 0); + void CallJsMethod(const char* methodName, napi_value const* argv = nullptr, size_t argc = 0); void SetMainEventHandler(); private: diff --git a/setresolution/include/setresolution_utils.h b/setresolution/include/setresolution_utils.h index 1ab0a2d538..57254b9276 100644 --- a/setresolution/include/setresolution_utils.h +++ b/setresolution/include/setresolution_utils.h @@ -33,7 +33,7 @@ public: SetResolutionUtils() = default; ~SetResolutionUtils() = default; - static void PrintUsage(const std::string &cmdLine); + static void PrintUsage(const std::string& cmdLine); static bool ProcessArgs(int argc, char * const argv[], CmdArgments& cmdArgments); }; } diff --git a/setresolution/src/setresolution_screen.cpp b/setresolution/src/setresolution_screen.cpp index c2eaff341f..cdaa9ea95a 100644 --- a/setresolution/src/setresolution_screen.cpp +++ b/setresolution/src/setresolution_screen.cpp @@ -29,7 +29,7 @@ constexpr int32_t DEBUG_ON_DEFAULT = 0; static const std::string ENG_PARAMETER = "const.debuggable"; static const bool IS_ENG_MODE = static_cast(GetIntParameter(ENG_PARAMETER, DEBUG_ON_DEFAULT)); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { CmdArgments cmdArgments; diff --git a/setresolution/src/setresolution_utils.cpp b/setresolution/src/setresolution_utils.cpp index 71bf54e8df..0d93e5e62a 100644 --- a/setresolution/src/setresolution_utils.cpp +++ b/setresolution/src/setresolution_utils.cpp @@ -20,13 +20,13 @@ #include namespace OHOS { -void SetResolutionUtils::PrintUsage(const std::string &cmdLine) +void SetResolutionUtils::PrintUsage(const std::string& cmdLine) { std::cout << "usage: " << cmdLine.c_str() << " [-w width] [-h height] [-d dpi] [-m]" << std::endl; } -bool SetResolutionUtils::ProcessArgs(int argc, char * const argv[], CmdArgments &cmdArgments) +bool SetResolutionUtils::ProcessArgs(int argc, char * const argv[], CmdArgments& cmdArgments) { int opt = 0; const struct option longOption[] = { diff --git a/snapshot/include/snapshot_utils.h b/snapshot/include/snapshot_utils.h index f1936fb74f..66ca995bff 100644 --- a/snapshot/include/snapshot_utils.h +++ b/snapshot/include/snapshot_utils.h @@ -49,23 +49,23 @@ public: SnapShotUtils() = default; ~SnapShotUtils() = default; - static void PrintUsage(const std::string &cmdLine); - static bool CheckFileNameValid(const std::string &fileName, std::string fileType = "jpeg"); + static void PrintUsage(const std::string& cmdLine); + static bool CheckFileNameValid(const std::string& fileName, std::string fileType = "jpeg"); static std::string GenerateFileName(std::string fileType, int offset = 0); static bool CheckWidthAndHeightValid(int32_t w, int32_t h); - static bool RGBA8888ToRGB888(const uint8_t* rgba8888Buf, uint8_t *rgb888Buf, int32_t size); - static bool RGB565ToRGB888(const uint8_t* rgb565Buf, uint8_t *rgb888Buf, int32_t size); + static bool RGBA8888ToRGB888(const uint8_t* rgba8888Buf, uint8_t* rgb888Buf, int32_t size); + static bool RGB565ToRGB888(const uint8_t* rgb565Buf, uint8_t* rgb888Buf, int32_t size); static bool WriteRgb888ToJpeg(FILE* file, uint32_t width, uint32_t height, const uint8_t* data); - static bool WriteToJpeg(const std::string &fileName, const WriteToJpegParam ¶m); - static bool WriteToJpeg(int fd, const WriteToJpegParam ¶m); - static bool WriteToJpegWithPixelMap(const std::string &fileName, Media::PixelMap &pixelMap); - static bool WriteToJpegWithPixelMap(int fd, Media::PixelMap &pixelMap); + static bool WriteToJpeg(const std::string& fileName, const WriteToJpegParam& param); + static bool WriteToJpeg(int fd, const WriteToJpegParam& param); + static bool WriteToJpegWithPixelMap(const std::string& fileName, Media::PixelMap& pixelMap); + static bool WriteToJpegWithPixelMap(int fd, Media::PixelMap& pixelMap); static bool ProcessArgs(int argc, char * const argv[], CmdArguments& cmdArgments); static bool CheckWHValid(int32_t param); - static bool CheckParamValid(const WriteToJpegParam ¶m); - static bool SaveSnapShot(const std::string &filename, Media::PixelMap &pixelMap, std::string fileType = "jpeg"); + static bool CheckParamValid(const WriteToJpegParam& param); + static bool SaveSnapShot(const std::string& filename, Media::PixelMap& pixelMap, std::string fileType = "jpeg"); private: - static bool ProcessDisplayId(Rosen::DisplayId &displayId, bool isDisplayIdSet); + static bool ProcessDisplayId(Rosen::DisplayId& displayId, bool isDisplayIdSet); }; } diff --git a/snapshot/src/snapshot_display.cpp b/snapshot/src/snapshot_display.cpp index c006af397f..c5bbf8f157 100644 --- a/snapshot/src/snapshot_display.cpp +++ b/snapshot/src/snapshot_display.cpp @@ -38,7 +38,7 @@ static const std::string IS_DEVELOPER_MODE = GetParameter(DEVELOPER_MODE_PARAMET static bool GetScreenshotByCmdArguments(CmdArguments& cmdArguments, sptr display, std::shared_ptr& pixelMap); -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { CmdArguments cmdArguments; cmdArguments.fileName = ""; diff --git a/snapshot/src/snapshot_utils.cpp b/snapshot/src/snapshot_utils.cpp index e9a1c72e4b..99e8db1c40 100644 --- a/snapshot/src/snapshot_utils.cpp +++ b/snapshot/src/snapshot_utils.cpp @@ -80,7 +80,7 @@ const char *DEFAULT_SNAPSHOT_PREFIX = "/snapshot"; const char *VALID_SNAPSHOT_SUFFIX = ".jpeg"; const char *VALID_SNAPSHOT_PNG_SUFFIX = ".png"; -void SnapShotUtils::PrintUsage(const std::string &cmdLine) +void SnapShotUtils::PrintUsage(const std::string& cmdLine) { std::cout << "usage: " << cmdLine.c_str() << " [-i displayId] [-f output_file] [-w width] [-h height] [-t type] [-m]" << std::endl; @@ -108,7 +108,7 @@ std::string SnapShotUtils::GenerateFileName(std::string fileType, int offset) return fileName; } -bool SnapShotUtils::CheckFileNameValid(const std::string &fileName, std::string fileType) +bool SnapShotUtils::CheckFileNameValid(const std::string& fileName, std::string fileType) { std::cout << "fileType: " << fileType << std::endl; size_t fileMinLength = (fileType == "png") ? strlen(VALID_SNAPSHOT_PNG_SUFFIX) : strlen(VALID_SNAPSHOT_SUFFIX); @@ -156,7 +156,7 @@ bool SnapShotUtils::CheckWidthAndHeightValid(int32_t w, int32_t h) return CheckWHValid(w) && CheckWHValid(h); } -bool SnapShotUtils::CheckParamValid(const WriteToJpegParam ¶m) +bool SnapShotUtils::CheckParamValid(const WriteToJpegParam& param) { switch (param.format) { case Media::PixelFormat::RGBA_8888: @@ -188,7 +188,7 @@ bool SnapShotUtils::CheckParamValid(const WriteToJpegParam ¶m) return true; } -bool SnapShotUtils::RGBA8888ToRGB888(const uint8_t* rgba8888Buf, uint8_t *rgb888Buf, int32_t size) +bool SnapShotUtils::RGBA8888ToRGB888(const uint8_t* rgba8888Buf, uint8_t* rgb888Buf, int32_t size) { if (rgba8888Buf == nullptr || rgb888Buf == nullptr || size <= 0) { std::cout << __func__ << ": params are invalid." << std::endl; @@ -203,7 +203,7 @@ bool SnapShotUtils::RGBA8888ToRGB888(const uint8_t* rgba8888Buf, uint8_t *rgb888 return true; } -bool SnapShotUtils::RGB565ToRGB888(const uint8_t* rgb565Buf, uint8_t *rgb888Buf, int32_t size) +bool SnapShotUtils::RGB565ToRGB888(const uint8_t* rgb565Buf, uint8_t* rgb888Buf, int32_t size) { if (rgb565Buf == nullptr || rgb888Buf == nullptr || size <= 0) { std::cout << __func__ << ": params are invalid." << std::endl; @@ -267,7 +267,7 @@ bool SnapShotUtils::WriteRgb888ToJpeg(FILE* file, uint32_t width, uint32_t heigh return true; } -bool SnapShotUtils::WriteToJpeg(const std::string &fileName, const WriteToJpegParam ¶m) +bool SnapShotUtils::WriteToJpeg(const std::string& fileName, const WriteToJpegParam& param) { bool ret = false; if (!CheckFileNameValid(fileName)) { @@ -315,7 +315,7 @@ bool SnapShotUtils::WriteToJpeg(const std::string &fileName, const WriteToJpegPa return ret; } -bool SnapShotUtils::WriteToJpeg(int fd, const WriteToJpegParam ¶m) +bool SnapShotUtils::WriteToJpeg(int fd, const WriteToJpegParam& param) { bool ret = false; if (!CheckParamValid(param)) { @@ -358,7 +358,7 @@ bool SnapShotUtils::WriteToJpeg(int fd, const WriteToJpegParam ¶m) return ret; } -bool SnapShotUtils::SaveSnapShot(const std::string &fileName, Media::PixelMap &pixelMap, std::string fileType) +bool SnapShotUtils::SaveSnapShot(const std::string& fileName, Media::PixelMap& pixelMap, std::string fileType) { OHOS::Media::ImagePacker imagePacker; OHOS::Media::PackOption option; @@ -383,7 +383,7 @@ bool SnapShotUtils::SaveSnapShot(const std::string &fileName, Media::PixelMap &p return true; } -bool SnapShotUtils::WriteToJpegWithPixelMap(const std::string &fileName, Media::PixelMap &pixelMap) +bool SnapShotUtils::WriteToJpegWithPixelMap(const std::string& fileName, Media::PixelMap& pixelMap) { if (pixelMap.GetAllocatorType() == Media::AllocatorType::DMA_ALLOC) { return SaveSnapShot(fileName, pixelMap); @@ -397,7 +397,7 @@ bool SnapShotUtils::WriteToJpegWithPixelMap(const std::string &fileName, Media:: return SnapShotUtils::WriteToJpeg(fileName, param); } -bool SnapShotUtils::WriteToJpegWithPixelMap(int fd, Media::PixelMap &pixelMap) +bool SnapShotUtils::WriteToJpegWithPixelMap(int fd, Media::PixelMap& pixelMap) { WriteToJpegParam param; param.width = static_cast(pixelMap.GetWidth()); @@ -408,7 +408,7 @@ bool SnapShotUtils::WriteToJpegWithPixelMap(int fd, Media::PixelMap &pixelMap) return SnapShotUtils::WriteToJpeg(fd, param); } -bool SnapShotUtils::ProcessDisplayId(Rosen::DisplayId &displayId, bool isDisplayIdSet) +bool SnapShotUtils::ProcessDisplayId(Rosen::DisplayId& displayId, bool isDisplayIdSet) { if (!isDisplayIdSet) { displayId = DisplayManager::GetInstance().GetDefaultDisplayId(); @@ -433,7 +433,7 @@ bool SnapShotUtils::ProcessDisplayId(Rosen::DisplayId &displayId, bool isDisplay return true; } -bool SnapShotUtils::ProcessArgs(int argc, char * const argv[], CmdArguments &cmdArguments) +bool SnapShotUtils::ProcessArgs(int argc, char * const argv[], CmdArguments& cmdArguments) { int opt = 0; const struct option longOption[] = { diff --git a/test/common/mock/iremote_object_mocker.h b/test/common/mock/iremote_object_mocker.h index 8baafb8d8c..fabc89f02b 100644 --- a/test/common/mock/iremote_object_mocker.h +++ b/test/common/mock/iremote_object_mocker.h @@ -35,7 +35,7 @@ public: return 0; } - int SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) + int SendRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { return 0; } @@ -85,7 +85,7 @@ public: return 0; } - int SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) + int SendRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { return sendRequestResult_; } diff --git a/test/common/mock/mock_uicontent.h b/test/common/mock/mock_uicontent.h index d8929af334..6d4b273042 100644 --- a/test/common/mock/mock_uicontent.h +++ b/test/common/mock/mock_uicontent.h @@ -88,10 +88,10 @@ public: int64_t baseParent, std::list& output)); MOCK_METHOD4( FindFocusedElementInfo, void(int64_t elementId, - int32_t focusType, int64_t baseParent, Accessibility::AccessibilityElementInfo &output)); + int32_t focusType, int64_t baseParent, Accessibility::AccessibilityElementInfo& output)); MOCK_METHOD4( FocusMoveSearch, void(int64_t elementId, int32_t direction, int64_t baseParent, - Accessibility::AccessibilityElementInfo &output)); + Accessibility::AccessibilityElementInfo& output)); MOCK_METHOD1(GetAppPaintSize, void(OHOS::Rosen::Rect& drawableRect)); MOCK_METHOD2(SetContainerModalTitleVisible, void(bool customTitleSettedShow, bool floatingTitleSettedShow)); MOCK_METHOD1(SetContainerModalTitleHeight, void(int height)); diff --git a/test/demo/demo_freeze_display.cpp b/test/demo/demo_freeze_display.cpp index 72d3e75e56..fe5ee53d4e 100644 --- a/test/demo/demo_freeze_display.cpp +++ b/test/demo/demo_freeze_display.cpp @@ -19,7 +19,7 @@ using namespace OHOS; using namespace OHOS::Rosen; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { auto displayId = DisplayManager::GetInstance().GetDefaultDisplayId(); std::vector ids; diff --git a/test/demo/demo_mirror_screen_listener.cpp b/test/demo/demo_mirror_screen_listener.cpp index 6c70a30673..b1637fa951 100644 --- a/test/demo/demo_mirror_screen_listener.cpp +++ b/test/demo/demo_mirror_screen_listener.cpp @@ -20,7 +20,7 @@ using namespace OHOS; using namespace OHOS::Rosen; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { std::cout << "===========================Start===========================" << std::endl; std::cout << "Please do screen mirror in 20s..." << std::endl; diff --git a/test/demo/demo_screenshot_listener.cpp b/test/demo/demo_screenshot_listener.cpp index 8a90f5000e..3130037453 100644 --- a/test/demo/demo_screenshot_listener.cpp +++ b/test/demo/demo_screenshot_listener.cpp @@ -20,7 +20,7 @@ using namespace OHOS; using namespace OHOS::Rosen; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { std::cout << "===========================Start===========================" << std::endl; std::cout << "Please do screenshot in 20s..." << std::endl; diff --git a/test/demo/demo_session_manager.cpp b/test/demo/demo_session_manager.cpp index 3cc3dc9094..a083f13f5e 100644 --- a/test/demo/demo_session_manager.cpp +++ b/test/demo/demo_session_manager.cpp @@ -22,7 +22,7 @@ using namespace OHOS; using namespace OHOS::Rosen; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { SessionManager sessionManager; diff --git a/test/demo/demo_snapshot_virtual_screen.cpp b/test/demo/demo_snapshot_virtual_screen.cpp index f5ac77f0dc..34c351ab64 100644 --- a/test/demo/demo_snapshot_virtual_screen.cpp +++ b/test/demo/demo_snapshot_virtual_screen.cpp @@ -69,7 +69,7 @@ static bool InitMirror(SurfaceReader& surfaceReader) return true; } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { SurfaceReader surfaceReader; sptr surfaceReaderHandler = new SurfaceReaderHandlerImpl(); diff --git a/test/demo/demo_system_sub_window.cpp b/test/demo/demo_system_sub_window.cpp index c6075a9422..cce77ed70e 100644 --- a/test/demo/demo_system_sub_window.cpp +++ b/test/demo/demo_system_sub_window.cpp @@ -53,7 +53,7 @@ void OutputWindowInfos(const std::vector>& infos) } } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { std::cout << "===========================Start===========================" << std::endl; std::cout << "Wait 20s, The Windows will close itself" << std::endl; diff --git a/test/demo/demo_visible_window_num_listener.cpp b/test/demo/demo_visible_window_num_listener.cpp index a266e8ac4b..3f62619280 100644 --- a/test/demo/demo_visible_window_num_listener.cpp +++ b/test/demo/demo_visible_window_num_listener.cpp @@ -42,7 +42,7 @@ public: using namespace OHOS; using namespace OHOS::Rosen; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { std::cout << "===========================Start===========================" << std::endl; diff --git a/test/demo/demo_water_mark_listener.cpp b/test/demo/demo_water_mark_listener.cpp index a6607caf50..2990a4da9f 100644 --- a/test/demo/demo_water_mark_listener.cpp +++ b/test/demo/demo_water_mark_listener.cpp @@ -41,7 +41,7 @@ public: using namespace OHOS; using namespace OHOS::Rosen; -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { std::cout << "===========================Start===========================" << std::endl; diff --git a/test/fuzztest/dms/displaymanager_fuzzer/displaymanager_fuzzer.cpp b/test/fuzztest/dms/displaymanager_fuzzer/displaymanager_fuzzer.cpp index fcc8f1941f..9fee1f27ef 100644 --- a/test/fuzztest/dms/displaymanager_fuzzer/displaymanager_fuzzer.cpp +++ b/test/fuzztest/dms/displaymanager_fuzzer/displaymanager_fuzzer.cpp @@ -59,7 +59,7 @@ public: }; template -size_t GetObject(T &object, const uint8_t *data, size_t size) +size_t GetObject(T& object, const uint8_t* data, size_t size) { size_t objectSize = sizeof(object); if (objectSize > size) { diff --git a/test/fuzztest/dms/displaymanageripc_fuzzer/displaymanageripc_fuzzer.cpp b/test/fuzztest/dms/displaymanageripc_fuzzer/displaymanageripc_fuzzer.cpp index 1445bc13fd..b06a76c3b4 100644 --- a/test/fuzztest/dms/displaymanageripc_fuzzer/displaymanageripc_fuzzer.cpp +++ b/test/fuzztest/dms/displaymanageripc_fuzzer/displaymanageripc_fuzzer.cpp @@ -29,7 +29,7 @@ namespace { constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_DISPLAY, "DisplayManagerIPC_Fuzzer"}; } template -size_t GetObject(T &object, const uint8_t *data, size_t size) +size_t GetObject(T& object, const uint8_t* data, size_t size) { size_t objectSize = sizeof(object); if (objectSize > size) { diff --git a/test/fuzztest/dms/screen_fuzzer/screen_fuzzer.cpp b/test/fuzztest/dms/screen_fuzzer/screen_fuzzer.cpp index befdb4c535..c3e67ef38d 100644 --- a/test/fuzztest/dms/screen_fuzzer/screen_fuzzer.cpp +++ b/test/fuzztest/dms/screen_fuzzer/screen_fuzzer.cpp @@ -32,7 +32,7 @@ namespace { constexpr size_t LEN = 10; } template -size_t GetObject(T &object, const uint8_t *data, size_t size) +size_t GetObject(T& object, const uint8_t* data, size_t size) { size_t objectSize = sizeof(object); if (objectSize > size) { @@ -41,7 +41,7 @@ size_t GetObject(T &object, const uint8_t *data, size_t size) return memcpy_s(&object, objectSize, data, objectSize) == EOK ? objectSize : 0; } -sptr CreateScreenInfo(const uint8_t *data, size_t size) +sptr CreateScreenInfo(const uint8_t* data, size_t size) { sptr info = new(std::nothrow) ScreenInfo(); if (info == nullptr) { @@ -68,7 +68,7 @@ sptr CreateScreenInfo(const uint8_t *data, size_t size) GetObject(info->modeId_, data + startPos, size - startPos); return info; } -bool ScreenFuzzTest(sptr screen, sptr display, const uint8_t *data, size_t size) +bool ScreenFuzzTest(sptr screen, sptr display, const uint8_t* data, size_t size) { if (screen == nullptr || display == nullptr) { return false; @@ -94,7 +94,7 @@ bool ScreenFuzzTest(sptr screen, sptr display, const uint8_t *d return true; } -bool ScreenFuzzTestNoDisplay(sptr screen, const uint8_t *data, size_t size) +bool ScreenFuzzTestNoDisplay(sptr screen, const uint8_t* data, size_t size) { if (screen == nullptr) { return false; @@ -122,7 +122,7 @@ bool ScreenFuzzTestNoDisplay(sptr screen, const uint8_t *data, size_t si return true; } -bool ColorGamutsFuzzTest(sptr screen, const uint8_t *data, size_t size) +bool ColorGamutsFuzzTest(sptr screen, const uint8_t* data, size_t size) { if (screen == nullptr) { return false; diff --git a/test/fuzztest/dms/screenmanager_fuzzer/screenmanager_fuzzer.cpp b/test/fuzztest/dms/screenmanager_fuzzer/screenmanager_fuzzer.cpp index 51ae293b3b..62b3885f99 100644 --- a/test/fuzztest/dms/screenmanager_fuzzer/screenmanager_fuzzer.cpp +++ b/test/fuzztest/dms/screenmanager_fuzzer/screenmanager_fuzzer.cpp @@ -56,7 +56,7 @@ public: }; template -size_t GetObject(T &object, const uint8_t *data, size_t size) +size_t GetObject(T& object, const uint8_t* data, size_t size) { size_t objectSize = sizeof(object); if (objectSize > size) { @@ -65,7 +65,7 @@ size_t GetObject(T &object, const uint8_t *data, size_t size) return memcpy_s(&object, objectSize, data, objectSize) == EOK ? objectSize : 0; } -bool ScreenPowerFuzzTest(const uint8_t *data, size_t size) +bool ScreenPowerFuzzTest(const uint8_t* data, size_t size) { uint32_t screenPowerState; uint32_t powerStateChangeReason; @@ -94,7 +94,7 @@ bool ScreenPowerFuzzTest(const uint8_t *data, size_t size) return true; } -bool MakeMirrorWithVirtualScreenFuzzTest(const uint8_t *data, size_t size) +bool MakeMirrorWithVirtualScreenFuzzTest(const uint8_t* data, size_t size) { if (data == nullptr || size < DATA_MIN_SIZE) { return false; @@ -135,7 +135,7 @@ bool MakeMirrorWithVirtualScreenFuzzTest(const uint8_t *data, size_t size) return true; } -bool MakeExpandWithVirtualScreenFuzzTest(const uint8_t *data, size_t size) +bool MakeExpandWithVirtualScreenFuzzTest(const uint8_t* data, size_t size) { if (data == nullptr || size < DATA_MIN_SIZE) { return false; @@ -176,7 +176,7 @@ bool MakeExpandWithVirtualScreenFuzzTest(const uint8_t *data, size_t size) return true; } -bool CreateAndDestroyVirtualScreenFuzzTest(const uint8_t *data, size_t size) +bool CreateAndDestroyVirtualScreenFuzzTest(const uint8_t* data, size_t size) { if (data == nullptr || size < DATA_MIN_SIZE) { return false; @@ -204,7 +204,7 @@ bool CreateAndDestroyVirtualScreenFuzzTest(const uint8_t *data, size_t size) return true; } -bool SetVirtualScreenSurfaceFuzzTest(const uint8_t *data, size_t size) +bool SetVirtualScreenSurfaceFuzzTest(const uint8_t* data, size_t size) { ScreenId screenId; if (data == nullptr || size < sizeof(screenId)) { @@ -217,7 +217,7 @@ bool SetVirtualScreenSurfaceFuzzTest(const uint8_t *data, size_t size) return true; } -bool SetScreenRotationLockedFuzzTest(const uint8_t *data, size_t size) +bool SetScreenRotationLockedFuzzTest(const uint8_t* data, size_t size) { ScreenId screenId; if (data == nullptr || size < sizeof(screenId)) { @@ -231,7 +231,7 @@ bool SetScreenRotationLockedFuzzTest(const uint8_t *data, size_t size) return true; } -bool IsScreenRotationLocked(const uint8_t *data, size_t size) +bool IsScreenRotationLocked(const uint8_t* data, size_t size) { ScreenId screenId; if (data == nullptr || size < sizeof(screenId)) { @@ -245,7 +245,7 @@ bool IsScreenRotationLocked(const uint8_t *data, size_t size) return true; } -bool RemoveVirtualScreenFromGroupFuzzTest(const uint8_t *data, size_t size) +bool RemoveVirtualScreenFromGroupFuzzTest(const uint8_t* data, size_t size) { ScreenId screenId; if (data == nullptr || size < sizeof(screenId)) { @@ -259,7 +259,7 @@ bool RemoveVirtualScreenFromGroupFuzzTest(const uint8_t *data, size_t size) return true; } -bool MakeMirrorFuzzTest(const uint8_t *data, size_t size) +bool MakeMirrorFuzzTest(const uint8_t* data, size_t size) { ScreenId screenId; // 10 screens. @@ -287,7 +287,7 @@ bool MakeMirrorFuzzTest(const uint8_t *data, size_t size) return true; } -bool MakeExpandFuzzTest(const uint8_t *data, size_t size) +bool MakeExpandFuzzTest(const uint8_t* data, size_t size) { ScreenId screenId; // 10 screens. diff --git a/test/fuzztest/window_scene/scenesessionmgrlstubget_fuzzer/scenesessionmgrlstubget_fuzzer.cpp b/test/fuzztest/window_scene/scenesessionmgrlstubget_fuzzer/scenesessionmgrlstubget_fuzzer.cpp index 1d2274e10d..10ae49c0fa 100644 --- a/test/fuzztest/window_scene/scenesessionmgrlstubget_fuzzer/scenesessionmgrlstubget_fuzzer.cpp +++ b/test/fuzztest/window_scene/scenesessionmgrlstubget_fuzzer/scenesessionmgrlstubget_fuzzer.cpp @@ -35,7 +35,7 @@ namespace { constexpr size_t DATA_MIN_SIZE = 2; } -void SceneSessionMgrLsTest(MessageParcel &parcel, MessageParcel &reply, MessageOption &option) +void SceneSessionMgrLsTest(MessageParcel& parcel, MessageParcel& reply, MessageOption& option) { parcel.RewindRead(0); SceneSessionManagerLite::GetInstance().OnRemoteRequest(static_cast(ISceneSessionManagerLite:: diff --git a/test/fuzztest/window_scene/screensessionmanagerclientstub_fuzzer/screensessionmanagerclientstub_fuzzer.cpp b/test/fuzztest/window_scene/screensessionmanagerclientstub_fuzzer/screensessionmanagerclientstub_fuzzer.cpp index ed2731e6e8..9f71d52df4 100644 --- a/test/fuzztest/window_scene/screensessionmanagerclientstub_fuzzer/screensessionmanagerclientstub_fuzzer.cpp +++ b/test/fuzztest/window_scene/screensessionmanagerclientstub_fuzzer/screensessionmanagerclientstub_fuzzer.cpp @@ -34,7 +34,7 @@ namespace { constexpr size_t DATA_MIN_SIZE = 2; } template -size_t GetObject(T &object, const uint8_t *data, size_t size) +size_t GetObject(T& object, const uint8_t* data, size_t size) { size_t objectSize = sizeof(object); if (objectSize > size) { @@ -42,7 +42,7 @@ size_t GetObject(T &object, const uint8_t *data, size_t size) } return memcpy_s(&object, objectSize, data, objectSize) == EOK ? objectSize : 0; } -void ScreenSessionMgrClientStubTest1(MessageParcel &parcel, MessageParcel &reply, MessageOption &option) +void ScreenSessionMgrClientStubTest1(MessageParcel& parcel, MessageParcel& reply, MessageOption& option) { parcel.RewindRead(0); ScreenSessionManagerClient::GetInstance().OnRemoteRequest( @@ -74,7 +74,7 @@ void ScreenSessionMgrClientStubTest1(MessageParcel &parcel, MessageParcel &reply ScreenSessionManagerClientMessage::TRANS_ID_ON_DISPLAY_STATE_CHANGED), parcel, reply, option); return; } -void ScreenSessionMgrClientStubTest2(MessageParcel &parcel, MessageParcel &reply, MessageOption &option) +void ScreenSessionMgrClientStubTest2(MessageParcel& parcel, MessageParcel& reply, MessageOption& option) { parcel.RewindRead(0); ScreenSessionManagerClient::GetInstance().OnRemoteRequest( diff --git a/test/fuzztest/wms/pip_fuzzer/pip_fuzzer.cpp b/test/fuzztest/wms/pip_fuzzer/pip_fuzzer.cpp index f30eefa79a..ff2effb611 100644 --- a/test/fuzztest/wms/pip_fuzzer/pip_fuzzer.cpp +++ b/test/fuzztest/wms/pip_fuzzer/pip_fuzzer.cpp @@ -31,7 +31,7 @@ namespace { } template -size_t GetObject(T &object, const uint8_t *data, size_t size) +size_t GetObject(T& object, const uint8_t* data, size_t size) { size_t objectSize = sizeof(object); if (objectSize > size) { diff --git a/test/fuzztest/wms/window_fuzzer/window_fuzzer.cpp b/test/fuzztest/wms/window_fuzzer/window_fuzzer.cpp index 3ee84d5255..b59133df5b 100644 --- a/test/fuzztest/wms/window_fuzzer/window_fuzzer.cpp +++ b/test/fuzztest/wms/window_fuzzer/window_fuzzer.cpp @@ -221,7 +221,7 @@ public: }; template -size_t GetObject(T &object, const uint8_t *data, size_t size) +size_t GetObject(T& object, const uint8_t* data, size_t size) { size_t objectSize = sizeof(object); if (objectSize > size) { @@ -231,7 +231,7 @@ size_t GetObject(T &object, const uint8_t *data, size_t size) } /* 调用该接口后, 需要释放内存 */ -char *CopyDataToString(const uint8_t *data, size_t size) +char *CopyDataToString(const uint8_t* data, size_t size) { if (size > DATA_MAX_SIZE) { return nullptr; diff --git a/test/fuzztest/wms/windowagent_fuzzer/window_agent_fuzzer.cpp b/test/fuzztest/wms/windowagent_fuzzer/window_agent_fuzzer.cpp index e884c8e0d9..638a277dfa 100644 --- a/test/fuzztest/wms/windowagent_fuzzer/window_agent_fuzzer.cpp +++ b/test/fuzztest/wms/windowagent_fuzzer/window_agent_fuzzer.cpp @@ -34,7 +34,7 @@ namespace { } template -size_t GetObject(T &object, const uint8_t *data, size_t size) +size_t GetObject(T& object, const uint8_t* data, size_t size) { size_t objectSize = sizeof(object); if (objectSize > size) { diff --git a/test/fuzztest/wms/windowipc_fuzzer/windowipc_fuzzer.cpp b/test/fuzztest/wms/windowipc_fuzzer/windowipc_fuzzer.cpp index 6ed5984eb5..6e0f9a69f4 100644 --- a/test/fuzztest/wms/windowipc_fuzzer/windowipc_fuzzer.cpp +++ b/test/fuzztest/wms/windowipc_fuzzer/windowipc_fuzzer.cpp @@ -28,7 +28,7 @@ namespace { constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_DISPLAY, "DisplayManagerIPC_Fuzzer"}; } template -size_t GetObject(T &object, const uint8_t *data, size_t size) +size_t GetObject(T& object, const uint8_t* data, size_t size) { size_t objectSize = sizeof(object); if (objectSize > size) { diff --git a/test/fuzztest/wms/windowmanager_fuzzer/windowmanager_fuzzer.cpp b/test/fuzztest/wms/windowmanager_fuzzer/windowmanager_fuzzer.cpp index be0299b252..85c287e730 100644 --- a/test/fuzztest/wms/windowmanager_fuzzer/windowmanager_fuzzer.cpp +++ b/test/fuzztest/wms/windowmanager_fuzzer/windowmanager_fuzzer.cpp @@ -28,7 +28,7 @@ namespace { } template -size_t GetObject(T &object, const uint8_t *data, size_t size) +size_t GetObject(T& object, const uint8_t* data, size_t size) { size_t objectSize = sizeof(object); if (objectSize > size) { diff --git a/test/fuzztest/wms/windowscene_fuzzer/windowscene_fuzzer.cpp b/test/fuzztest/wms/windowscene_fuzzer/windowscene_fuzzer.cpp index 3546edde0d..b1e93a33cf 100644 --- a/test/fuzztest/wms/windowscene_fuzzer/windowscene_fuzzer.cpp +++ b/test/fuzztest/wms/windowscene_fuzzer/windowscene_fuzzer.cpp @@ -63,7 +63,7 @@ public: }; template -size_t GetObject(T &object, const uint8_t *data, size_t size) +size_t GetObject(T& object, const uint8_t* data, size_t size) { size_t objectSize = sizeof(object); if (objectSize > size) { @@ -72,7 +72,7 @@ size_t GetObject(T &object, const uint8_t *data, size_t size) return memcpy_s(&object, objectSize, data, objectSize) == EOK ? objectSize : 0; } -size_t InitWindowOption1(WindowOption &windowOption, const uint8_t *data, size_t size) +size_t InitWindowOption1(WindowOption& windowOption, const uint8_t* data, size_t size) { size_t startPos = 0; Rect windowRect; @@ -106,7 +106,7 @@ size_t InitWindowOption1(WindowOption &windowOption, const uint8_t *data, size_t return startPos; } -size_t InitWindowOption2(WindowOption &windowOption, const uint8_t *data, size_t size) +size_t InitWindowOption2(WindowOption& windowOption, const uint8_t* data, size_t size) { size_t startPos = 0; uint32_t flags; @@ -150,7 +150,7 @@ size_t InitWindowOption2(WindowOption &windowOption, const uint8_t *data, size_t return startPos; } -size_t InitWindowOption(WindowOption &windowOption, const uint8_t *data, size_t size) +size_t InitWindowOption(WindowOption& windowOption, const uint8_t* data, size_t size) { size_t startPos = 0; startPos += InitWindowOption1(windowOption, data + startPos, size - startPos); diff --git a/test/fuzztest/wms/windowutilmath_fuzzer/windowutilmath_fuzzer.cpp b/test/fuzztest/wms/windowutilmath_fuzzer/windowutilmath_fuzzer.cpp index 6d79c76a78..846252161e 100644 --- a/test/fuzztest/wms/windowutilmath_fuzzer/windowutilmath_fuzzer.cpp +++ b/test/fuzztest/wms/windowutilmath_fuzzer/windowutilmath_fuzzer.cpp @@ -32,7 +32,7 @@ namespace { } template -size_t GetObject(T &object, const uint8_t *data, size_t size) +size_t GetObject(T& object, const uint8_t* data, size_t size) { size_t objectSize = sizeof(object); if (objectSize > size) { @@ -42,7 +42,7 @@ size_t GetObject(T &object, const uint8_t *data, size_t size) } size_t InitMatrix3(OHOS::Rosen::TransformHelper::Matrix3& mat3, - const uint8_t *data, size_t size, size_t startPos) + const uint8_t* data, size_t size, size_t startPos) { if (data == nullptr || size < DATA_MIN_SIZE) { return 0; @@ -58,7 +58,7 @@ size_t InitMatrix3(OHOS::Rosen::TransformHelper::Matrix3& mat3, } void InitMatrix4(OHOS::Rosen::TransformHelper::Matrix4& mat4, - const uint8_t *data, size_t size, size_t& startPos) + const uint8_t* data, size_t size, size_t& startPos) { if (data == nullptr || size < DATA_MIN_SIZE) { return; @@ -73,7 +73,7 @@ void InitMatrix4(OHOS::Rosen::TransformHelper::Matrix4& mat4, } void InitVector2(OHOS::Rosen::TransformHelper::Vector2& vec2, - const uint8_t *data, size_t size, size_t& startPos) + const uint8_t* data, size_t size, size_t& startPos) { if (data == nullptr || size < DATA_MIN_SIZE) { return; @@ -83,7 +83,7 @@ void InitVector2(OHOS::Rosen::TransformHelper::Vector2& vec2, } void InitVector3(OHOS::Rosen::TransformHelper::Vector3& vec3, - const uint8_t *data, size_t size, size_t& startPos) + const uint8_t* data, size_t size, size_t& startPos) { if (data == nullptr || size < DATA_MIN_SIZE) { return; @@ -93,7 +93,7 @@ void InitVector3(OHOS::Rosen::TransformHelper::Vector3& vec3, startPos += GetObject(vec3.y_, data + startPos, size - startPos); } -void WindowUtilMathFuzzPart1(const uint8_t *data, size_t size) +void WindowUtilMathFuzzPart1(const uint8_t* data, size_t size) { if (data == nullptr || size < DATA_MIN_SIZE) { return; @@ -137,7 +137,7 @@ void WindowUtilMathFuzzPart1(const uint8_t *data, size_t size) OHOS::Rosen::TransformHelper::CreateTranslation(vec3); } -void WindowUtilMathFuzzPart2(const uint8_t *data, size_t size) +void WindowUtilMathFuzzPart2(const uint8_t* data, size_t size) { if (data == nullptr || size < DATA_MIN_SIZE) { return; diff --git a/test/systemtest/dms/display_test_utils.h b/test/systemtest/dms/display_test_utils.h index 638374dacf..bf3fd3129d 100644 --- a/test/systemtest/dms/display_test_utils.h +++ b/test/systemtest/dms/display_test_utils.h @@ -44,7 +44,7 @@ public: void SetDefaultWH(const sptr& display); class BufferListener : public IBufferConsumerListener { public: - explicit BufferListener(DisplayTestUtils &displayTestUtils): utils_(displayTestUtils) + explicit BufferListener(DisplayTestUtils& displayTestUtils): utils_(displayTestUtils) { } ~BufferListener() noexcept override = default; diff --git a/utils/include/cutout_info.h b/utils/include/cutout_info.h index 5722168b51..2c01c7b645 100644 --- a/utils/include/cutout_info.h +++ b/utils/include/cutout_info.h @@ -52,9 +52,9 @@ public: DEFINE_VAR_FUNC_GET_SET(std::vector, BoundingRects, boundingRects); private: const static uint32_t MAX_CUTOUT_INFO_SIZE = 20; - bool WriteBoundingRectsVector(const std::vector& boundingRects, Parcel &parcel) const; - static bool ReadBoundingRectsVector(std::vector& unmarBoundingRects, Parcel &parcel); - static bool ReadWaterfallDisplayAreaRects(WaterfallDisplayAreaRects& waterfallDisplayAreaRects, Parcel &parcel); + bool WriteBoundingRectsVector(const std::vector& boundingRects, Parcel& parcel) const; + static bool ReadBoundingRectsVector(std::vector& unmarBoundingRects, Parcel& parcel); + static bool ReadWaterfallDisplayAreaRects(WaterfallDisplayAreaRects& waterfallDisplayAreaRects, Parcel& parcel); }; } // namespace OHOS::Rosen #endif // FOUNDATION_DMSERVER_CUTOUT_INFO_H \ No newline at end of file diff --git a/utils/include/focus_change_info.h b/utils/include/focus_change_info.h index 889924e843..d2aa5fd046 100644 --- a/utils/include/focus_change_info.h +++ b/utils/include/focus_change_info.h @@ -61,7 +61,7 @@ public: } } - static FocusChangeInfo* Unmarshalling(Parcel &parcel) + static FocusChangeInfo* Unmarshalling(Parcel& parcel) { auto focusChangeInfo = new FocusChangeInfo(); bool res = parcel.ReadInt32(focusChangeInfo->windowId_) && parcel.ReadUint64(focusChangeInfo->displayId_) && diff --git a/utils/include/marshalling_helper.h b/utils/include/marshalling_helper.h index 6d594e8259..a5fedcc03a 100644 --- a/utils/include/marshalling_helper.h +++ b/utils/include/marshalling_helper.h @@ -23,7 +23,7 @@ class MarshallingHelper : public Parcelable { public: MarshallingHelper() = delete; template - static bool MarshallingVectorParcelableObj(Parcel &parcel, const std::vector>& data) + static bool MarshallingVectorParcelableObj(Parcel& parcel, const std::vector>& data) { if (data.size() > INT_MAX) { return false; @@ -40,7 +40,7 @@ public: } template - static bool UnmarshallingVectorParcelableObj(Parcel &parcel, std::vector>& data) + static bool UnmarshallingVectorParcelableObj(Parcel& parcel, std::vector>& data) { int32_t len = parcel.ReadInt32(); if (len < 0) { @@ -71,7 +71,7 @@ public: } template - static bool MarshallingVectorObj(Parcel &parcel, const std::vector& data, + static bool MarshallingVectorObj(Parcel& parcel, const std::vector& data, std::function func) { if (data.size() > INT_MAX) { @@ -92,7 +92,7 @@ public: } template - static bool UnmarshallingVectorObj(Parcel &parcel, std::vector& data, std::function func) + static bool UnmarshallingVectorObj(Parcel& parcel, std::vector& data, std::function func) { if (func == nullptr) { return false; diff --git a/utils/include/pip_report.h b/utils/include/pip_report.h index ad3fc79b5a..4f8c9c2ef4 100644 --- a/utils/include/pip_report.h +++ b/utils/include/pip_report.h @@ -26,10 +26,10 @@ class PiPReporter { WM_DECLARE_SINGLE_INSTANCE(PiPReporter); public: - void SetCurrentPackageName(const std::string &packageName); - void ReportPiPStartWindow(int32_t source, int32_t templateType, int32_t isSuccess, const std::string &errorReason); - void ReportPiPStopWindow(int32_t source, int32_t templateType, int32_t isSuccess, const std::string &errorReason); - void ReportPiPActionEvent(int32_t templateType, const std::string &actionEvent); + void SetCurrentPackageName(const std::string& packageName); + void ReportPiPStartWindow(int32_t source, int32_t templateType, int32_t isSuccess, const std::string& errorReason); + void ReportPiPStopWindow(int32_t source, int32_t templateType, int32_t isSuccess, const std::string& errorReason); + void ReportPiPActionEvent(int32_t templateType, const std::string& actionEvent); void ReportPiPControlEvent(int32_t templateType, PiPControlType controlType); void ReportPiPRatio(int32_t windowWidth, int32_t windowHeight); void ReportPiPRestore(); diff --git a/utils/include/surface_draw.h b/utils/include/surface_draw.h index 48d78147f4..a6f6b84517 100644 --- a/utils/include/surface_draw.h +++ b/utils/include/surface_draw.h @@ -45,14 +45,14 @@ public: Rect transparentRect); private: - static bool DoDraw(uint8_t *addr, uint32_t width, uint32_t height, const std::string& imagePath); - static bool DoDraw(uint8_t *addr, uint32_t width, uint32_t height, uint32_t color); - static bool DoDraw(uint8_t *addr, uint32_t width, uint32_t height, std::shared_ptr pixelMap); + static bool DoDraw(uint8_t* addr, uint32_t width, uint32_t height, const std::string& imagePath); + static bool DoDraw(uint8_t* addr, uint32_t width, uint32_t height, uint32_t color); + static bool DoDraw(uint8_t* addr, uint32_t width, uint32_t height, std::shared_ptr pixelMap); static sptr GetLayer(std::shared_ptr surfaceNode); static sptr GetSurfaceBuffer(sptr layer, int32_t bufferWidth, int32_t bufferHeight); - static void DrawPixelmap(Drawing::Canvas &canvas, const std::string& imagePath); - static std::unique_ptr DecodeImageToPixelMap(const std::string &imagePath); + static void DrawPixelmap(Drawing::Canvas& canvas, const std::string& imagePath); + static std::unique_ptr DecodeImageToPixelMap(const std::string& imagePath); static bool DoDrawImageRect(sptr buffer, const Rect& rect, std::shared_ptr pixelMap, uint32_t color, bool fillWindow = false); }; diff --git a/utils/include/surface_reader.h b/utils/include/surface_reader.h index a23191ef38..29ca13712f 100644 --- a/utils/include/surface_reader.h +++ b/utils/include/surface_reader.h @@ -37,7 +37,7 @@ public: private: class BufferListener : public IBufferConsumerListener { public: - explicit BufferListener(SurfaceReader &surfaceReader): surfaceReader_(surfaceReader) + explicit BufferListener(SurfaceReader& surfaceReader): surfaceReader_(surfaceReader) { } ~BufferListener() noexcept override = default; diff --git a/utils/src/cutout_info.cpp b/utils/src/cutout_info.cpp index 5d1cda65be..790cf69694 100644 --- a/utils/src/cutout_info.cpp +++ b/utils/src/cutout_info.cpp @@ -22,7 +22,7 @@ CutoutInfo::CutoutInfo(const std::vector& boundingRects, { } -bool CutoutInfo::Marshalling(Parcel &parcel) const +bool CutoutInfo::Marshalling(Parcel& parcel) const { return parcel.WriteInt32(waterfallDisplayAreaRects_.left.posX_) && parcel.WriteInt32(waterfallDisplayAreaRects_.left.posY_) && @@ -43,7 +43,7 @@ bool CutoutInfo::Marshalling(Parcel &parcel) const WriteBoundingRectsVector(boundingRects_, parcel); } -CutoutInfo *CutoutInfo::Unmarshalling(Parcel &parcel) +CutoutInfo *CutoutInfo::Unmarshalling(Parcel& parcel) { WaterfallDisplayAreaRects waterfallDisplayAreaRects; std::vector boundingRects; @@ -53,7 +53,7 @@ CutoutInfo *CutoutInfo::Unmarshalling(Parcel &parcel) return cutoutInfo; } -bool CutoutInfo::WriteBoundingRectsVector(const std::vector& boundingRects, Parcel &parcel) const +bool CutoutInfo::WriteBoundingRectsVector(const std::vector& boundingRects, Parcel& parcel) const { uint32_t size = static_cast(boundingRects.size()); if (!parcel.WriteUint32(size)) { @@ -71,7 +71,7 @@ bool CutoutInfo::WriteBoundingRectsVector(const std::vector& boundingRec return true; } -bool CutoutInfo::ReadBoundingRectsVector(std::vector& unmarBoundingRects, Parcel &parcel) +bool CutoutInfo::ReadBoundingRectsVector(std::vector& unmarBoundingRects, Parcel& parcel) { uint32_t size; if (!parcel.ReadUint32(size)) { @@ -95,7 +95,7 @@ bool CutoutInfo::ReadBoundingRectsVector(std::vector& unmarBoundingRects return true; } -bool CutoutInfo::ReadWaterfallDisplayAreaRects(WaterfallDisplayAreaRects& waterfallDisplayAreaRects, Parcel &parcel) +bool CutoutInfo::ReadWaterfallDisplayAreaRects(WaterfallDisplayAreaRects& waterfallDisplayAreaRects, Parcel& parcel) { if (!(parcel.ReadInt32(waterfallDisplayAreaRects.left.posX_) && parcel.ReadInt32(waterfallDisplayAreaRects.left.posY_) && diff --git a/utils/src/display_info.cpp b/utils/src/display_info.cpp index 966dcc66da..ecc386822c 100644 --- a/utils/src/display_info.cpp +++ b/utils/src/display_info.cpp @@ -20,7 +20,7 @@ namespace OHOS::Rosen { -bool DisplayInfo::Marshalling(Parcel &parcel) const +bool DisplayInfo::Marshalling(Parcel& parcel) const { return parcel.WriteString(name_) && parcel.WriteUint64(id_) && parcel.WriteUint32(static_cast(type_)) && parcel.WriteInt32(width_) && parcel.WriteInt32(height_) && @@ -42,7 +42,7 @@ bool DisplayInfo::Marshalling(Parcel &parcel) const parcel.WriteFloat(scaleY_) && parcel.WriteFloat(pivotX_) && parcel.WriteFloat(pivotY_); } -DisplayInfo *DisplayInfo::Unmarshalling(Parcel &parcel) +DisplayInfo *DisplayInfo::Unmarshalling(Parcel& parcel) { DisplayInfo *displayInfo = new(std::nothrow) DisplayInfo(); if (displayInfo == nullptr) { diff --git a/utils/src/pip_report.cpp b/utils/src/pip_report.cpp index 3fb82f0e08..5073bc115f 100644 --- a/utils/src/pip_report.cpp +++ b/utils/src/pip_report.cpp @@ -57,7 +57,7 @@ constexpr char EVENT_KEY_ACTION_EVENT[] = "ACTION_EVENT"; constexpr char EVENT_KEY_WINDOW_WIDTH[] = "WINDOW_WIDTH"; constexpr char EVENT_KEY_WINDOW_HEIGHT[] = "WINDOW_HEIGHT"; -void PiPReporter::SetCurrentPackageName(const std::string &packageName) +void PiPReporter::SetCurrentPackageName(const std::string& packageName) { std::lock_guard lock(packageNameMutex_); packageName_ = packageName; @@ -113,7 +113,7 @@ void PiPReporter::ReportPiPStopWindow(int32_t source, int32_t templateType, LOG_WHEN_ERROR(ret); } -void PiPReporter::ReportPiPActionEvent(int32_t templateType, const std::string &actionEvent) +void PiPReporter::ReportPiPActionEvent(int32_t templateType, const std::string& actionEvent) { TLOGI(WmsLogTag::WMS_PIP, "Report pip widow action event"); std::string eventName = "CONTROL_PANNEL_ACTION_EVENT"; diff --git a/utils/src/screen_group_info.cpp b/utils/src/screen_group_info.cpp index 8504c02f75..6d986fb55a 100644 --- a/utils/src/screen_group_info.cpp +++ b/utils/src/screen_group_info.cpp @@ -16,7 +16,7 @@ #include "screen_group_info.h" namespace OHOS::Rosen { -bool ScreenGroupInfo::Marshalling(Parcel &parcel) const +bool ScreenGroupInfo::Marshalling(Parcel& parcel) const { bool res = ScreenInfo::Marshalling(parcel) && parcel.WriteUint32((uint32_t)combination_) && parcel.WriteUInt64Vector(children_); @@ -38,7 +38,7 @@ bool ScreenGroupInfo::Marshalling(Parcel &parcel) const return true; } -ScreenGroupInfo* ScreenGroupInfo::Unmarshalling(Parcel &parcel) +ScreenGroupInfo* ScreenGroupInfo::Unmarshalling(Parcel& parcel) { ScreenGroupInfo* screenGroupInfo = new(std::nothrow) ScreenGroupInfo(); if (screenGroupInfo == nullptr) { diff --git a/utils/src/screen_info.cpp b/utils/src/screen_info.cpp index 11b08c9fb7..5375a4e43c 100644 --- a/utils/src/screen_info.cpp +++ b/utils/src/screen_info.cpp @@ -16,7 +16,7 @@ #include "screen_info.h" namespace OHOS::Rosen { -bool ScreenInfo::Marshalling(Parcel &parcel) const +bool ScreenInfo::Marshalling(Parcel& parcel) const { bool res = parcel.WriteString(name_) && parcel.WriteUint64(id_) && parcel.WriteUint32(virtualWidth_) && parcel.WriteUint32(virtualHeight_) && @@ -44,7 +44,7 @@ bool ScreenInfo::Marshalling(Parcel &parcel) const return true; } -ScreenInfo* ScreenInfo::Unmarshalling(Parcel &parcel) +ScreenInfo* ScreenInfo::Unmarshalling(Parcel& parcel) { ScreenInfo* info = new(std::nothrow) ScreenInfo(); if (info == nullptr) { diff --git a/utils/src/screenshot_info.cpp b/utils/src/screenshot_info.cpp index 70ffd9e5ea..9e2ac9b90a 100644 --- a/utils/src/screenshot_info.cpp +++ b/utils/src/screenshot_info.cpp @@ -16,12 +16,12 @@ #include "screenshot_info.h" namespace OHOS::Rosen { -bool ScreenshotInfo::Marshalling(Parcel &parcel) const +bool ScreenshotInfo::Marshalling(Parcel& parcel) const { return parcel.WriteString(trigger_) && parcel.WriteUint64(displayId_); } -ScreenshotInfo *ScreenshotInfo::Unmarshalling(Parcel &parcel) +ScreenshotInfo *ScreenshotInfo::Unmarshalling(Parcel& parcel) { ScreenshotInfo *info = new(std::nothrow) ScreenshotInfo(); if (info == nullptr) { diff --git a/utils/src/surface_draw.cpp b/utils/src/surface_draw.cpp index c1a7543b5d..48accffba2 100644 --- a/utils/src/surface_draw.cpp +++ b/utils/src/surface_draw.cpp @@ -157,7 +157,7 @@ sptr SurfaceDraw::GetSurfaceBuffer(sptr laye return buffer; } -std::unique_ptr SurfaceDraw::DecodeImageToPixelMap(const std::string &imagePath) +std::unique_ptr SurfaceDraw::DecodeImageToPixelMap(const std::string& imagePath) { OHOS::Media::SourceOptions opts; opts.formatHint = "image/png"; @@ -179,7 +179,7 @@ std::unique_ptr SurfaceDraw::DecodeImageToPixelMap(const return pixelMap; } -void SurfaceDraw::DrawPixelmap(Drawing::Canvas &canvas, const std::string& imagePath) +void SurfaceDraw::DrawPixelmap(Drawing::Canvas& canvas, const std::string& imagePath) { std::unique_ptr pixelmap = DecodeImageToPixelMap(imagePath); if (pixelmap == nullptr) { @@ -195,7 +195,7 @@ void SurfaceDraw::DrawPixelmap(Drawing::Canvas &canvas, const std::string& image RSPixelMapUtil::DrawPixelMap(canvas, *pixelmap, 0, 0); } -bool SurfaceDraw::DoDraw(uint8_t *addr, uint32_t width, uint32_t height, const std::string& imagePath) +bool SurfaceDraw::DoDraw(uint8_t* addr, uint32_t width, uint32_t height, const std::string& imagePath) { Drawing::Bitmap bitmap; Drawing::BitmapFormat format { Drawing::ColorType::COLORTYPE_RGBA_8888, @@ -214,7 +214,7 @@ bool SurfaceDraw::DoDraw(uint8_t *addr, uint32_t width, uint32_t height, const s return true; } -bool SurfaceDraw::DoDraw(uint8_t *addr, uint32_t width, uint32_t height, std::shared_ptr pixelMap) +bool SurfaceDraw::DoDraw(uint8_t* addr, uint32_t width, uint32_t height, std::shared_ptr pixelMap) { Drawing::Bitmap bitmap; Drawing::Canvas canvas; @@ -244,7 +244,7 @@ bool SurfaceDraw::DoDraw(uint8_t *addr, uint32_t width, uint32_t height, std::sh return true; } -bool SurfaceDraw::DoDraw(uint8_t *addr, uint32_t width, uint32_t height, uint32_t color) +bool SurfaceDraw::DoDraw(uint8_t* addr, uint32_t width, uint32_t height, uint32_t color) { Drawing::Bitmap bitmap; Drawing::BitmapFormat format { Drawing::ColorType::COLORTYPE_RGBA_8888, diff --git a/utils/src/window_drawing_content_info.cpp b/utils/src/window_drawing_content_info.cpp index a922c7cc8d..269b79f44f 100644 --- a/utils/src/window_drawing_content_info.cpp +++ b/utils/src/window_drawing_content_info.cpp @@ -21,14 +21,14 @@ namespace { constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "WindowDrawingContentInfo"}; } -bool WindowDrawingContentInfo::Marshalling(Parcel &parcel) const +bool WindowDrawingContentInfo::Marshalling(Parcel& parcel) const { return parcel.WriteUint32(windowId_) && parcel.WriteInt32(pid_) && parcel.WriteInt32(uid_) && parcel.WriteUint32(static_cast(drawingContentState_)) && parcel.WriteUint32(static_cast(windowType_)); } -WindowDrawingContentInfo* WindowDrawingContentInfo::Unmarshalling(Parcel &parcel) +WindowDrawingContentInfo* WindowDrawingContentInfo::Unmarshalling(Parcel& parcel) { auto windowDrawingContentInfo = new (std::nothrow) WindowDrawingContentInfo(); if (windowDrawingContentInfo == nullptr) { diff --git a/utils/src/window_visibility_info.cpp b/utils/src/window_visibility_info.cpp index b8a6a9b6c4..3fff740651 100644 --- a/utils/src/window_visibility_info.cpp +++ b/utils/src/window_visibility_info.cpp @@ -21,7 +21,7 @@ namespace { constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "WindowVisibilityInfo"}; } -bool WindowVisibilityInfo::Marshalling(Parcel &parcel) const +bool WindowVisibilityInfo::Marshalling(Parcel& parcel) const { return parcel.WriteUint32(windowId_) && parcel.WriteInt32(pid_) && parcel.WriteInt32(uid_) && parcel.WriteUint32(static_cast(visibilityState_)) && @@ -31,7 +31,7 @@ bool WindowVisibilityInfo::Marshalling(Parcel &parcel) const parcel.WriteString(bundleName_) && parcel.WriteString(abilityName_); } -WindowVisibilityInfo* WindowVisibilityInfo::Unmarshalling(Parcel &parcel) +WindowVisibilityInfo* WindowVisibilityInfo::Unmarshalling(Parcel& parcel) { auto windowVisibilityInfo = new (std::nothrow) WindowVisibilityInfo(); if (windowVisibilityInfo == nullptr) { diff --git a/window_scene/common/src/session_permission.cpp b/window_scene/common/src/session_permission.cpp index 5dd92d7121..dca5bbccd5 100644 --- a/window_scene/common/src/session_permission.cpp +++ b/window_scene/common/src/session_permission.cpp @@ -58,7 +58,7 @@ sptr GetBundleManagerProxy() return bundleManagerServiceProxy; } -bool GetInputMethodBundleName(std::string &name) +bool GetInputMethodBundleName(std::string& name) { auto imc = MiscServices::InputMethodController::GetInstance(); if (!imc) { diff --git a/window_scene/intention_event/service/event_stage/src/event_stage.cpp b/window_scene/intention_event/service/event_stage/src/event_stage.cpp index f953ddc80c..79ed674b13 100644 --- a/window_scene/intention_event/service/event_stage/src/event_stage.cpp +++ b/window_scene/intention_event/service/event_stage/src/event_stage.cpp @@ -78,7 +78,7 @@ std::vector EventStage::DelEvents(int32_t persistentId, int32_t eventId return {}; } auto &events = events_[persistentId]; - auto fistMatchIter = find_if(events.begin(), events.end(), [eventId](const auto &item) { + auto fistMatchIter = find_if(events.begin(), events.end(), [eventId](const auto& item) { return item.eventId > eventId; }); std::vector timerIds; diff --git a/window_scene/intention_event/utils/include/util.h b/window_scene/intention_event/utils/include/util.h index ef402d5347..9d44cbaf1d 100644 --- a/window_scene/intention_event/utils/include/util.h +++ b/window_scene/intention_event/utils/include/util.h @@ -26,7 +26,7 @@ int64_t GetSysClockTime(); int64_t GetMillisTime(); template -bool AddInt(T op1, T op2, T minVal, T maxVal, T &res) +bool AddInt(T op1, T op2, T minVal, T maxVal, T& res) { if (op1 >= 0) { if (op2 > maxVal - op1) { @@ -41,12 +41,12 @@ bool AddInt(T op1, T op2, T minVal, T maxVal, T &res) return true; } -inline bool AddInt32(int32_t op1, int32_t op2, int32_t &res) +inline bool AddInt32(int32_t op1, int32_t op2, int32_t& res) { return AddInt(op1, op2, INT32_MIN, INT32_MAX, res); } -inline bool AddInt64(int64_t op1, int64_t op2, int64_t &res) +inline bool AddInt64(int64_t op1, int64_t op2, int64_t& res) { return AddInt(op1, op2, INT64_MIN, INT64_MAX, res); } diff --git a/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_session.cpp b/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_session.cpp index 0b1222e1de..07eece84cb 100644 --- a/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_session.cpp +++ b/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_session.cpp @@ -2299,7 +2299,7 @@ void JsSceneSession::TerminateSessionTotal(const SessionInfo& info, TerminateTyp taskScheduler_->PostMainThreadTask(task, "TerminateSessionTotal:name:" + info.abilityName_); } -void JsSceneSession::UpdateSessionLabel(const std::string &label) +void JsSceneSession::UpdateSessionLabel(const std::string& label) { WLOGFI("[NAPI]run UpdateSessionLabel"); @@ -2349,7 +2349,7 @@ void JsSceneSession::ProcessUpdateSessionIconRegister() WLOGFD("ProcessUpdateSessionIconRegister success"); } -void JsSceneSession::UpdateSessionIcon(const std::string &iconPath) +void JsSceneSession::UpdateSessionIcon(const std::string& iconPath) { WLOGFI("[NAPI]run UpdateSessionIcon"); diff --git a/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_session.h b/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_session.h index 8660ae3639..224c27456f 100644 --- a/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_session.h +++ b/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_session.h @@ -235,8 +235,8 @@ private: void TerminateSession(const SessionInfo& info); void TerminateSessionNew(const SessionInfo& info, bool needStartCaller, bool isFromBroker); void TerminateSessionTotal(const SessionInfo& info, TerminateType terminateType); - void UpdateSessionLabel(const std::string &label); - void UpdateSessionIcon(const std::string &iconPath); + void UpdateSessionLabel(const std::string& label); + void UpdateSessionIcon(const std::string& iconPath); void OnSessionException(const SessionInfo& info, bool needRemoveSession); void OnSystemBarPropertyChange(const std::unordered_map& propertyMap); void OnNeedAvoid(bool status); diff --git a/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_session_manager.cpp b/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_session_manager.cpp index af1f159bcf..1348932104 100644 --- a/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_session_manager.cpp +++ b/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_session_manager.cpp @@ -1052,7 +1052,7 @@ napi_value JsSceneSessionManager::OnGetAllAbilityInfos(napi_env env, napi_callba *errCode = static_cast(code); }; auto complete = [obj = this, errCode, infos = scbAbilityInfos] - (napi_env env, NapiAsyncTask &task, int32_t status) { + (napi_env env, NapiAsyncTask& task, int32_t status) { if (*errCode != static_cast(WSErrorCode::WS_OK)) { std::string errMsg = "invalid params can not get All AbilityInfos!"; task.RejectWithCustomize(env, CreateJsValue(env, *errCode), CreateJsValue(env, errMsg)); diff --git a/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_utils.cpp b/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_utils.cpp index bd94b44c2c..08db935e6d 100644 --- a/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_utils.cpp +++ b/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_utils.cpp @@ -796,7 +796,7 @@ napi_value CreateJsSessionInfo(napi_env env, const SessionInfo& sessionInfo) } napi_value CreateJsSessionRecoverInfo( - napi_env env, const SessionInfo &sessionInfo, const sptr property) + napi_env env, const SessionInfo& sessionInfo, const sptr property) { napi_value objValue = nullptr; napi_create_object(env, &objValue); diff --git a/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_utils.h b/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_utils.h index 04dfdcab9e..9b8d4fa58a 100644 --- a/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_utils.h +++ b/window_scene/interfaces/kits/napi/scene_session_manager/js_scene_utils.h @@ -154,7 +154,7 @@ bool ConvertProcessOptionFromJs(napi_env env, napi_value jsObject, std::shared_ptr processOptions); napi_value CreateJsSessionInfo(napi_env env, const SessionInfo& sessionInfo); napi_value CreateJsSessionRecoverInfo( - napi_env env, const SessionInfo &sessionInfo, const sptr property); + napi_env env, const SessionInfo& sessionInfo, const sptr property); void SetJsSessionInfoByWant(napi_env env, const SessionInfo& sessionInfo, napi_value objValue); napi_value CreateJsProcessOption(napi_env env, std::shared_ptr processOptions); napi_value CreateJsSessionStartupVisibility(napi_env env); diff --git a/window_scene/session/container/include/zidl/session_stage_stub.h b/window_scene/session/container/include/zidl/session_stage_stub.h index 91c3a93aaf..c159db3b20 100644 --- a/window_scene/session/container/include/zidl/session_stage_stub.h +++ b/window_scene/session/container/include/zidl/session_stage_stub.h @@ -30,8 +30,8 @@ public: SessionStageStub() = default; ~SessionStageStub() = default; - int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) override; + int OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, + MessageOption& option) override; private: int HandleSetActive(MessageParcel& data, MessageParcel& reply); diff --git a/window_scene/session/container/include/zidl/window_event_channel_stub.h b/window_scene/session/container/include/zidl/window_event_channel_stub.h index 1bbad2e60d..ae52e53bce 100644 --- a/window_scene/session/container/include/zidl/window_event_channel_stub.h +++ b/window_scene/session/container/include/zidl/window_event_channel_stub.h @@ -28,8 +28,8 @@ public: WindowEventChannelStub() = default; ~WindowEventChannelStub() = default; - int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) override; + int OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, + MessageOption& option) override; private: int HandleTransferBackpressedEvent(MessageParcel& data, MessageParcel& reply); diff --git a/window_scene/session/container/src/zidl/session_stage_stub.cpp b/window_scene/session/container/src/zidl/session_stage_stub.cpp index b089d6354f..f90607cd4f 100644 --- a/window_scene/session/container/src/zidl/session_stage_stub.cpp +++ b/window_scene/session/container/src/zidl/session_stage_stub.cpp @@ -27,7 +27,7 @@ namespace { constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "SessionStageStub"}; } -int SessionStageStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) +int SessionStageStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { WLOGFD("Scene session stage on remote request!, code: %{public}u", code); if (data.ReadInterfaceToken() != GetDescriptor()) { diff --git a/window_scene/session/container/src/zidl/window_event_channel_stub.cpp b/window_scene/session/container/src/zidl/window_event_channel_stub.cpp index 7a830104a0..f8a22f87f6 100644 --- a/window_scene/session/container/src/zidl/window_event_channel_stub.cpp +++ b/window_scene/session/container/src/zidl/window_event_channel_stub.cpp @@ -30,8 +30,8 @@ namespace { constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "WindowEventChannelStub"}; } -int WindowEventChannelStub::OnRemoteRequest(uint32_t code, MessageParcel &data, - MessageParcel &reply, MessageOption &option) +int WindowEventChannelStub::OnRemoteRequest(uint32_t code, MessageParcel& data, + MessageParcel& reply, MessageOption& option) { WLOGFD("Window event channel on remote request!, code: %{public}u", code); if (data.ReadInterfaceToken() != GetDescriptor()) { @@ -178,7 +178,7 @@ int WindowEventChannelStub::HandleTransferAccessibilityHoverEvent(MessageParcel& return ERR_NONE; } -int32_t WindowEventChannelStub::HandleTransferAccessibilityChildTreeRegister(MessageParcel &data, MessageParcel &reply) +int32_t WindowEventChannelStub::HandleTransferAccessibilityChildTreeRegister(MessageParcel& data, MessageParcel& reply) { uint32_t windowId = 0; int32_t treeId = -1; @@ -195,14 +195,14 @@ int32_t WindowEventChannelStub::HandleTransferAccessibilityChildTreeRegister(Mes } int32_t WindowEventChannelStub::HandleTransferAccessibilityChildTreeUnregister( - MessageParcel &data, MessageParcel &reply) + MessageParcel& data, MessageParcel& reply) { WSError errCode = TransferAccessibilityChildTreeUnregister(); reply.WriteInt32(static_cast(errCode)); return ERR_NONE; } -int32_t WindowEventChannelStub::HandleTransferAccessibilityDumpChildInfo(MessageParcel &data, MessageParcel &reply) +int32_t WindowEventChannelStub::HandleTransferAccessibilityDumpChildInfo(MessageParcel& data, MessageParcel& reply) { std::vector params; if (!data.ReadStringVector(¶ms)) { diff --git a/window_scene/session/host/include/scene_session.h b/window_scene/session/host/include/scene_session.h index 5ef5fa9500..0d6889b68e 100644 --- a/window_scene/session/host/include/scene_session.h +++ b/window_scene/session/host/include/scene_session.h @@ -431,7 +431,7 @@ private: bool SaveAspectRatio(float ratio); void NotifyPropertyWhenConnect(); WSError RaiseAppMainWindowToTop() override; - void SetSurfaceBounds(const WSRect &rect); + void SetSurfaceBounds(const WSRect& rect); void UpdateWinRectForSystemBar(WSRect& rect); bool UpdateInputMethodSessionRect(const WSRect& rect, WSRect& newWinRect, WSRect& newRequestRect); bool IsMovableWindowType(); diff --git a/window_scene/session/host/include/session.h b/window_scene/session/host/include/session.h index 3d2dc5ae81..302c652f00 100644 --- a/window_scene/session/host/include/session.h +++ b/window_scene/session/host/include/session.h @@ -62,8 +62,8 @@ using NotifyTerminateSessionFunc = std::function; using NotifyTerminateSessionFuncNew = std::function; using NotifyTerminateSessionFuncTotal = std::function; -using NofitySessionLabelUpdatedFunc = std::function; -using NofitySessionIconUpdatedFunc = std::function; +using NofitySessionLabelUpdatedFunc = std::function; +using NofitySessionIconUpdatedFunc = std::function; using NotifySessionExceptionFunc = std::function; using NotifySessionSnapshotFunc = std::function; using NotifyPendingSessionToForegroundFunc = std::function; @@ -234,7 +234,7 @@ public: WSError TerminateSessionTotal(const sptr info, TerminateType terminateType); void SetTerminateSessionListenerTotal(const NotifyTerminateSessionFuncTotal& func); WSError Clear(bool needStartCaller = false); - WSError SetSessionLabel(const std::string &label); + WSError SetSessionLabel(const std::string& label); void SetUpdateSessionLabelListener(const NofitySessionLabelUpdatedFunc& func); WSError SetSessionIcon(const std::shared_ptr &icon); void SetUpdateSessionIconListener(const NofitySessionIconUpdatedFunc& func); @@ -358,8 +358,8 @@ public: void SetRaiseToAppTopForPointDownFunc(const NotifyRaiseToTopForPointDownFunc& func); void NotifyScreenshot(); - void RemoveLifeCycleTask(const LifeCycleTaskType &taskType); - void PostLifeCycleTask(Task &&task, const std::string &name, const LifeCycleTaskType &taskType); + void RemoveLifeCycleTask(const LifeCycleTaskType& taskType); + void PostLifeCycleTask(Task &&task, const std::string& name, const LifeCycleTaskType& taskType); WSError UpdateMaximizeMode(bool isMaximize); void NotifySessionForeground(uint32_t reason, bool withAnimation); void NotifySessionBackground(uint32_t reason, bool withAnimation, bool isFromInnerkits); @@ -441,7 +441,7 @@ public: protected: class SessionLifeCycleTask : public virtual RefBase { public: - SessionLifeCycleTask(const Task &task, const std::string &name, const LifeCycleTaskType &type) + SessionLifeCycleTask(const Task& task, const std::string& name, const LifeCycleTaskType& type) : task(task), name(name), type(type) {} Task task; const std::string name; diff --git a/window_scene/session/host/include/session_utils.h b/window_scene/session/host/include/session_utils.h index a23cae1104..646f4c07c1 100644 --- a/window_scene/session/host/include/session_utils.h +++ b/window_scene/session/host/include/session_utils.h @@ -56,8 +56,8 @@ inline void CalcFloatWindowRectLimits(const WindowLimits& limits, uint32_t maxFl maxHeight = std::min(maxHeight, static_cast(maxFloatingWindowSize * vpr)); } -inline std::string ConvertSessionName(const std::string &bundleName, const std::string &name, - const std::string &moduleName, const int32_t appIndex = 0) +inline std::string ConvertSessionName(const std::string& bundleName, const std::string& name, + const std::string& moduleName, const int32_t appIndex = 0) { std::string strName; if (appIndex == 0) { diff --git a/window_scene/session/host/include/zidl/session_stub.h b/window_scene/session/host/include/zidl/session_stub.h index 220d95244d..59282fbcc4 100644 --- a/window_scene/session/host/include/zidl/session_stub.h +++ b/window_scene/session/host/include/zidl/session_stub.h @@ -30,7 +30,7 @@ public: SessionStub() = default; virtual ~SessionStub() = default; - int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; + int OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) override; private: int HandleConnect(MessageParcel& data, MessageParcel& reply); @@ -55,9 +55,9 @@ private: int HandleSetWindowAnimationFlag(MessageParcel& data, MessageParcel& reply); int HandleUpdateWindowSceneAfterCustomAnimation(MessageParcel& data, MessageParcel& reply); int HandleRaiseAboveTarget(MessageParcel& data, MessageParcel& reply); - int HandleRaiseAppMainWindowToTop(MessageParcel &data, MessageParcel &reply); - int HandleChangeSessionVisibilityWithStatusBar(MessageParcel &data, MessageParcel &reply); - int HandlePendingSessionActivation(MessageParcel &data, MessageParcel &reply); + int HandleRaiseAppMainWindowToTop(MessageParcel& data, MessageParcel& reply); + int HandleChangeSessionVisibilityWithStatusBar(MessageParcel& data, MessageParcel& reply); + int HandlePendingSessionActivation(MessageParcel& data, MessageParcel& reply); int HandleTerminateSession(MessageParcel& data, MessageParcel& reply); int HandleSessionException(MessageParcel& data, MessageParcel& reply); int HandleProcessPointDownSession(MessageParcel& data, MessageParcel& reply); diff --git a/window_scene/session/host/src/scene_persistence.cpp b/window_scene/session/host/src/scene_persistence.cpp index bbd8e0d3e4..653e6e8072 100644 --- a/window_scene/session/host/src/scene_persistence.cpp +++ b/window_scene/session/host/src/scene_persistence.cpp @@ -151,7 +151,7 @@ bool ScenePersistence::IsSavingSnapshot() return isSavingSnapshot_.load(); } -void ScenePersistence::RenameSnapshotFromOldPersistentId(const int32_t &oldPersistentId) +void ScenePersistence::RenameSnapshotFromOldPersistentId(const int32_t& oldPersistentId) { auto task = [weakThis = wptr(this), oldPersistentId]() { auto scenePersistence = weakThis.promote(); diff --git a/window_scene/session/host/src/scene_session.cpp b/window_scene/session/host/src/scene_session.cpp index c6aa7bf7f7..5a6a818404 100644 --- a/window_scene/session/host/src/scene_session.cpp +++ b/window_scene/session/host/src/scene_session.cpp @@ -467,7 +467,7 @@ WSError SceneSession::SetGlobalMaximizeMode(MaximizeMode mode) return PostSyncTask(task, "SetGlobalMaximizeMode"); } -WSError SceneSession::GetGlobalMaximizeMode(MaximizeMode &mode) +WSError SceneSession::GetGlobalMaximizeMode(MaximizeMode& mode) { auto task = [weakThis = wptr(this), &mode]() { auto session = weakThis.promote(); diff --git a/window_scene/session/host/src/session.cpp b/window_scene/session/host/src/session.cpp index 1bf92fa562..556ee4e25f 100644 --- a/window_scene/session/host/src/session.cpp +++ b/window_scene/session/host/src/session.cpp @@ -1249,7 +1249,7 @@ void Session::SetTerminateSessionListener(const NotifyTerminateSessionFunc& func terminateSessionFunc_ = func; } -void Session::RemoveLifeCycleTask(const LifeCycleTaskType &taskType) +void Session::RemoveLifeCycleTask(const LifeCycleTaskType& taskType) { std::lock_guard lock(lifeCycleTaskQueueMutex_); if (lifeCycleTaskQueue_.empty()) { @@ -1382,7 +1382,7 @@ void Session::SetTerminateSessionListenerTotal(const NotifyTerminateSessionFuncT terminateSessionFuncTotal_ = func; } -WSError Session::SetSessionLabel(const std::string &label) +WSError Session::SetSessionLabel(const std::string& label) { WLOGFI("run Session::SetSessionLabel"); if (updateSessionLabelFunc_) { @@ -1391,7 +1391,7 @@ WSError Session::SetSessionLabel(const std::string &label) return WSError::WS_OK; } -void Session::SetUpdateSessionLabelListener(const NofitySessionLabelUpdatedFunc &func) +void Session::SetUpdateSessionLabelListener(const NofitySessionLabelUpdatedFunc& func) { updateSessionLabelFunc_ = func; } @@ -1411,7 +1411,7 @@ WSError Session::SetSessionIcon(const std::shared_ptr &icon) return WSError::WS_OK; } -void Session::SetUpdateSessionIconListener(const NofitySessionIconUpdatedFunc &func) +void Session::SetUpdateSessionIconListener(const NofitySessionIconUpdatedFunc& func) { updateSessionIconFunc_ = func; } diff --git a/window_scene/session/host/src/zidl/session_stub.cpp b/window_scene/session/host/src/zidl/session_stub.cpp index 2b9949f0ed..8cc51d4967 100644 --- a/window_scene/session/host/src/zidl/session_stub.cpp +++ b/window_scene/session/host/src/zidl/session_stub.cpp @@ -36,7 +36,7 @@ namespace { constexpr HiviewDFX::HiLogLabel LABEL = { LOG_CORE, HILOG_DOMAIN_WINDOW, "SessionStub" }; } // namespace -int SessionStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) +int SessionStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { WLOGFD("Scene session on remote request!, code: %{public}u", code); if (data.ReadInterfaceToken() != GetDescriptor()) { @@ -485,7 +485,7 @@ int SessionStub::HandleMarkProcessed(MessageParcel& data, MessageParcel& reply) return ERR_NONE; } -int SessionStub::HandleSetGlobalMaximizeMode(MessageParcel &data, MessageParcel &reply) +int SessionStub::HandleSetGlobalMaximizeMode(MessageParcel& data, MessageParcel& reply) { WLOGFD("HandleSetGlobalMaximizeMode!"); auto mode = data.ReadUint32(); @@ -494,7 +494,7 @@ int SessionStub::HandleSetGlobalMaximizeMode(MessageParcel &data, MessageParcel return ERR_NONE; } -int SessionStub::HandleGetGlobalMaximizeMode(MessageParcel &data, MessageParcel &reply) +int SessionStub::HandleGetGlobalMaximizeMode(MessageParcel& data, MessageParcel& reply) { WLOGFD("HandleGetGlobalMaximizeMode!"); MaximizeMode mode = MaximizeMode::MODE_FULL_FILL; @@ -692,7 +692,7 @@ int SessionStub::HandleUpdateRectChangeListenerRegistered(MessageParcel& data, M return ERR_NONE; } -int SessionStub::HandleSetKeyboardSessionGravity(MessageParcel &data, MessageParcel &reply) +int SessionStub::HandleSetKeyboardSessionGravity(MessageParcel& data, MessageParcel& reply) { TLOGD(WmsLogTag::WMS_KEYBOARD, "run HandleSetKeyboardSessionGravity!"); SessionGravity gravity = static_cast(data.ReadUint32()); diff --git a/window_scene/session_manager/include/connection/screen_cast_connection.h b/window_scene/session_manager/include/connection/screen_cast_connection.h index 3ee3f2b5f1..8e62dcca1e 100644 --- a/window_scene/session_manager/include/connection/screen_cast_connection.h +++ b/window_scene/session_manager/include/connection/screen_cast_connection.h @@ -24,16 +24,16 @@ namespace OHOS::Rosen { class ScreenCastConnection { public: - static ScreenCastConnection &GetInstance(); + static ScreenCastConnection& GetInstance(); bool CastConnectExtension(); void CastDisconnectExtension(); - void SetBundleName(const std::string &bundleName); - void SetAbilityName(const std::string &abilityName); + void SetBundleName(const std::string& bundleName); + void SetAbilityName(const std::string& abilityName); std::string GetBundleName() const; std::string GetAbilityName() const; bool IsConnectedSync(); - int32_t SendMessageToCastService(const int32_t &transCode, MessageParcel &data, MessageParcel &reply); + int32_t SendMessageToCastService(const int32_t& transCode, MessageParcel& data, MessageParcel& reply); private: explicit ScreenCastConnection() = default; diff --git a/window_scene/session_manager/include/connection/screen_session_ability_connection.h b/window_scene/session_manager/include/connection/screen_session_ability_connection.h index a3a580e3d1..25b8b4c5bb 100644 --- a/window_scene/session_manager/include/connection/screen_session_ability_connection.h +++ b/window_scene/session_manager/include/connection/screen_session_ability_connection.h @@ -40,11 +40,11 @@ public: explicit ScreenSessionAbilityConnectionStub() = default; virtual ~ScreenSessionAbilityConnectionStub() = default; - void OnAbilityConnectDone(const AppExecFwk::ElementName &element, + void OnAbilityConnectDone(const AppExecFwk::ElementName& element, const sptr &remoteObject, int32_t resultCode) override; - void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int32_t resultCode) override; - int32_t SendMessageSync(int32_t transCode, MessageParcel &data, MessageParcel &reply); - int32_t SendMessageSyncBlock(int32_t transCode, MessageParcel &data, MessageParcel &reply); + void OnAbilityDisconnectDone(const AppExecFwk::ElementName& element, int32_t resultCode) override; + int32_t SendMessageSync(int32_t transCode, MessageParcel& data, MessageParcel& reply); + int32_t SendMessageSyncBlock(int32_t transCode, MessageParcel& data, MessageParcel& reply); bool IsAbilityConnected(); bool IsAbilityConnectedSync(); int32_t OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) override; @@ -82,10 +82,10 @@ public: explicit ScreenSessionAbilityConnection() = default; ~ScreenSessionAbilityConnection() = default; - bool ScreenSessionConnectExtension(const std::string &bundleName, const std::string &abilityName); + bool ScreenSessionConnectExtension(const std::string& bundleName, const std::string& abilityName); void ScreenSessionDisconnectExtension(); - int32_t SendMessage(const int32_t &transCode, MessageParcel &data, MessageParcel &reply); - int32_t SendMessageBlock(const int32_t &transCode, MessageParcel &data, MessageParcel &reply); + int32_t SendMessage(const int32_t& transCode, MessageParcel& data, MessageParcel& reply); + int32_t SendMessageBlock(const int32_t& transCode, MessageParcel& data, MessageParcel& reply); bool IsConnected(); bool IsConnectedSync(); sptr GetScreenSessionAbilityConnectionStub(); diff --git a/window_scene/session_manager/include/connection/screen_snapshot_picker_connection.h b/window_scene/session_manager/include/connection/screen_snapshot_picker_connection.h index d7444bb8f2..a8f096a835 100644 --- a/window_scene/session_manager/include/connection/screen_snapshot_picker_connection.h +++ b/window_scene/session_manager/include/connection/screen_snapshot_picker_connection.h @@ -27,13 +27,13 @@ namespace OHOS::Rosen { class ScreenSnapshotPickerConnection { public: - static ScreenSnapshotPickerConnection &GetInstance(); + static ScreenSnapshotPickerConnection& GetInstance(); bool SnapshotPickerConnectExtension(); void SnapshotPickerDisconnectExtension(); - int32_t GetScreenSnapshotInfo(Media::Rect &rect, ScreenId &screenId); - void SetBundleName(const std::string &bundleName); - void SetAbilityName(const std::string &abilityName); + int32_t GetScreenSnapshotInfo(Media::Rect& rect, ScreenId& screenId); + void SetBundleName(const std::string& bundleName); + void SetAbilityName(const std::string& abilityName); private: explicit ScreenSnapshotPickerConnection() = default; diff --git a/window_scene/session_manager/include/distributed_client.h b/window_scene/session_manager/include/distributed_client.h index 460c767047..6cba760721 100644 --- a/window_scene/session_manager/include/distributed_client.h +++ b/window_scene/session_manager/include/distributed_client.h @@ -33,7 +33,7 @@ public: std::vector& missionInfos); int32_t GetRemoteMissionSnapshotInfo(const std::string& deviceId, int32_t missionId, AAFwk::MissionSnapshot& missionSnapshot); - int32_t SetMissionContinueState(int32_t missionId, const AAFwk::ContinueState &state); + int32_t SetMissionContinueState(int32_t missionId, const AAFwk::ContinueState& state); void ClearDmsProxy(); enum { START_REMOTE_ABILITY = 1, diff --git a/window_scene/session_manager/include/fold_screen_controller/sensor_fold_state_manager/dual_display_sensor_fold_state_manager.h b/window_scene/session_manager/include/fold_screen_controller/sensor_fold_state_manager/dual_display_sensor_fold_state_manager.h index 5b0cc32441..4268e84fb5 100644 --- a/window_scene/session_manager/include/fold_screen_controller/sensor_fold_state_manager/dual_display_sensor_fold_state_manager.h +++ b/window_scene/session_manager/include/fold_screen_controller/sensor_fold_state_manager/dual_display_sensor_fold_state_manager.h @@ -33,12 +33,12 @@ class ApplicationStateObserver : public IApplicationStateObserver { public: ApplicationStateObserver(); virtual ~ApplicationStateObserver() = default; - void OnForegroundApplicationChanged(const AppStateData &appStateData) override; - void OnAbilityStateChanged(const AppExecFwk::AbilityStateData &abilityStateData) override {}; - void OnExtensionStateChanged(const AppExecFwk::AbilityStateData &abilityStateData) override {}; - void OnProcessCreated(const AppExecFwk::ProcessData &processData) override {}; - void OnProcessDied(const AppExecFwk::ProcessData &processData) override {}; - void OnApplicationStateChanged(const AppExecFwk::AppStateData &appStateData) override {}; + void OnForegroundApplicationChanged(const AppStateData& appStateData) override; + void OnAbilityStateChanged(const AppExecFwk::AbilityStateData& abilityStateData) override {}; + void OnExtensionStateChanged(const AppExecFwk::AbilityStateData& abilityStateData) override {}; + void OnProcessCreated(const AppExecFwk::ProcessData& processData) override {}; + void OnProcessDied(const AppExecFwk::ProcessData& processData) override {}; + void OnApplicationStateChanged(const AppExecFwk::AppStateData& appStateData) override {}; sptr AsObject() override { return nullptr; }; std::string GetForegroundApp(); diff --git a/window_scene/session_manager/include/publish/scene_event_publish.h b/window_scene/session_manager/include/publish/scene_event_publish.h index 85fcbd1205..a533cf9a37 100644 --- a/window_scene/session_manager/include/publish/scene_event_publish.h +++ b/window_scene/session_manager/include/publish/scene_event_publish.h @@ -30,16 +30,16 @@ namespace OHOS::Rosen { class SceneEventPublish : public EventFwk::CommonEventSubscriber { public: - explicit SceneEventPublish(const EventFwk::CommonEventSubscribeInfo &subscribeInfo) + explicit SceneEventPublish(const EventFwk::CommonEventSubscribeInfo& subscribeInfo) : CommonEventSubscriber(subscribeInfo) {} ~SceneEventPublish() = default; - void OnReceiveEvent(const EventFwk::CommonEventData &data); + void OnReceiveEvent(const EventFwk::CommonEventData& data); WSError Publish(std::string cmd); - std::string GetDebugDumpInfo(std::chrono::milliseconds const &time); + std::string GetDebugDumpInfo(std::chrono::milliseconds const& time); static void Subscribe(std::shared_ptr& scbSubscriber); diff --git a/window_scene/session_manager/include/publish/screen_session_publish.h b/window_scene/session_manager/include/publish/screen_session_publish.h index b6efcc78d2..266f2c85ca 100644 --- a/window_scene/session_manager/include/publish/screen_session_publish.h +++ b/window_scene/session_manager/include/publish/screen_session_publish.h @@ -31,14 +31,14 @@ public: void InitPublishEvents(); void PublishCastPlugInEvent(); void PublishCastPlugOutEvent(); - void PublishDisplayRotationEvent(const ScreenId &screenId, const Rotation &displayRotation); + void PublishDisplayRotationEvent(const ScreenId& screenId, const Rotation& displayRotation); private: explicit ScreenSessionPublish() = default; ~ScreenSessionPublish() = default; - int32_t PublishEvents(const EventFwk::CommonEventData &eventData, std::string bundleName = ""); - void PublishCastPluggedEvent(const bool &isEnable); + int32_t PublishEvents(const EventFwk::CommonEventData& eventData, std::string bundleName = ""); + void PublishCastPluggedEvent(const bool& isEnable); private: sptr publishInfo_; diff --git a/window_scene/session_manager/include/scene_session_manager.h b/window_scene/session_manager/include/scene_session_manager.h index 29be8b241c..d08376d7b5 100644 --- a/window_scene/session_manager/include/scene_session_manager.h +++ b/window_scene/session_manager/include/scene_session_manager.h @@ -201,14 +201,14 @@ public: void SetScreenLocked(const bool isScreenLocked); bool IsScreenLocked() const; - WSError InitUserInfo(int32_t userId, std::string &fileDir); + WSError InitUserInfo(int32_t userId, std::string& fileDir); void NotifySwitchingUser(const bool isUserActive); int32_t GetCurrentUserId() const; void StartWindowInfoReportLoop(); void GetFocusWindowInfo(FocusChangeInfo& focusInfo) override; void NotifyCompleteFirstFrameDrawing(int32_t persistentId); void NotifySessionMovedToFront(int32_t persistentId); - WSError SetSessionLabel(const sptr &token, const std::string &label) override; + WSError SetSessionLabel(const sptr &token, const std::string& label) override; WSError SetSessionIcon(const sptr &token, const std::shared_ptr &icon) override; WSError IsValidSessionIds(const std::vector &sessionIds, std::vector &results) override; void HandleTurnScreenOn(const sptr& sceneSession); @@ -227,7 +227,7 @@ public: SessionInfoBean& sessionInfo) override; WSError DumpSessionAll(std::vector &infos) override; WSError DumpSessionWithId(int32_t persistentId, std::vector &infos) override; - WSError GetAllAbilityInfos(const AAFwk::Want &want, int32_t userId, + WSError GetAllAbilityInfos(const AAFwk::Want& want, int32_t userId, std::vector &scbAbilityInfos); WSError PrepareTerminate(int32_t persistentId, bool& isPrepareTerminate); WSError GetIsLayoutFullScreen(bool& isLayoutFullScreen); @@ -282,7 +282,7 @@ public: void SetAlivePersistentIds(const std::vector& alivePersistentIds); void NotifyRecoveringFinished(); - WMError CheckWindowId(int32_t windowId, int32_t &pid) override; + WMError CheckWindowId(int32_t windowId, int32_t& pid) override; void GetSceneSessionPrivacyModeBundles(DisplayId displayId, std::unordered_set& privacyBundles); BrokerStates CheckIfReuseSession(SessionInfo& sessionInfo); bool CheckCollaboratorType(int32_t type); @@ -437,8 +437,8 @@ private: WSError ShiftFocus(sptr& nextSession, FocusChangeReason reason = FocusChangeReason::DEFAULT); void UpdateFocusStatus(sptr& sceneSession, bool isFocused); void NotifyFocusStatus(sptr& sceneSession, bool isFocused); - int32_t NotifyRssThawApp(const int32_t uid, const std::string &bundleName, - const std::string &reason); + int32_t NotifyRssThawApp(const int32_t uid, const std::string& bundleName, + const std::string& reason); void NotifyFocusStatusByMission(sptr& prevSession, sptr& currSession); void NotifyUnFocusedByMission(sptr& sceneSession); bool MissionChanged(sptr& prevSession, sptr& currSession); diff --git a/window_scene/session_manager/include/scene_session_manager_lite.h b/window_scene/session_manager/include/scene_session_manager_lite.h index 161ad82de6..82420b7042 100644 --- a/window_scene/session_manager/include/scene_session_manager_lite.h +++ b/window_scene/session_manager/include/scene_session_manager_lite.h @@ -58,7 +58,7 @@ public: const sptr& windowManagerAgent) override; WMError UnregisterWindowManagerAgent(WindowManagerAgentType type, const sptr& windowManagerAgent) override; - WMError CheckWindowId(int32_t windowId, int32_t &pid) override; + WMError CheckWindowId(int32_t windowId, int32_t& pid) override; WMError GetVisibilityWindowInfo(std::vector>& infos) override; WSError UpdateWindowMode(int32_t persistentId, int32_t windowMode); WMError GetWindowModeType(WindowModeType& windowModeType) override; diff --git a/window_scene/session_manager/include/screen_session_manager.h b/window_scene/session_manager/include/screen_session_manager.h index 08b6fb9fa9..8ee86ef0fb 100644 --- a/window_scene/session_manager/include/screen_session_manager.h +++ b/window_scene/session_manager/include/screen_session_manager.h @@ -113,7 +113,7 @@ public: virtual sptr GetScreenGroupInfoById(ScreenId screenId) override; virtual void RemoveVirtualScreenFromGroup(std::vector screens) override; virtual std::shared_ptr GetDisplaySnapshot(DisplayId displayId, DmErrorCode* errorCode) override; - virtual std::shared_ptr GetSnapshotByPicker(Media::Rect &rect, DmErrorCode* errorCode) override; + virtual std::shared_ptr GetSnapshotByPicker(Media::Rect& rect, DmErrorCode* errorCode) override; virtual sptr GetDisplayInfoById(DisplayId displayId) override; sptr GetDisplayInfoByScreen(ScreenId screenId) override; std::vector GetAllDisplayIds() override; @@ -254,7 +254,7 @@ public: DMError GetAvailableArea(DisplayId displayId, DMRect& area) override; void NotifyAvailableAreaChanged(DMRect area); void NotifyFoldToExpandCompletion(bool foldToExpand) override; - bool GetSnapshotArea(Media::Rect &rect, DmErrorCode* errorCode, ScreenId &screenId); + bool GetSnapshotArea(Media::Rect& rect, DmErrorCode* errorCode, ScreenId& screenId); VirtualScreenFlag GetVirtualScreenFlag(ScreenId screenId) override; DMError SetVirtualScreenFlag(ScreenId screenId, VirtualScreenFlag screenFlag) override; @@ -299,7 +299,7 @@ private: void MirrorSwitchNotify(ScreenId screenId); ScreenId GetDefaultScreenId(); void AddVirtualScreenDeathRecipient(const sptr& displayManagerAgent, ScreenId smsScreenId); - void SendCastEvent(const bool &isPlugIn); + void SendCastEvent(const bool& isPlugIn); void HandleScreenEvent(sptr screenSession, ScreenId screenId, ScreenEvent screenEvent); void ScbStatusRecoveryWhenSwitchUser(std::vector oldScbPids, int32_t newScbPid); void SwitchScbNodeHandle(int32_t userId, int32_t newScbPid, bool coldBoot); @@ -436,7 +436,7 @@ private: // Fold Screen std::map phyScreenPropMap_; mutable std::recursive_mutex phyScreenPropMapMutex_; - static void BootFinishedCallback(const char *key, const char *value, void *context); + static void BootFinishedCallback(const char* key, const char* value, void* context); std::function foldScreenPowerInit_ = nullptr; void HandleFoldScreenPowerInit(); void SetFoldScreenPowerInit(std::function foldScreenPowerInit); diff --git a/window_scene/session_manager/include/zidl/scene_session_manager_interface.h b/window_scene/session_manager/include/zidl/scene_session_manager_interface.h index 06d63f2dae..b23ef2c008 100644 --- a/window_scene/session_manager/include/zidl/scene_session_manager_interface.h +++ b/window_scene/session_manager/include/zidl/scene_session_manager_interface.h @@ -112,7 +112,7 @@ public: TRANS_ID_GET_WINDOW_STYLE_TYPE, }; - virtual WSError SetSessionLabel(const sptr &token, const std::string &label) = 0; + virtual WSError SetSessionLabel(const sptr &token, const std::string& label) = 0; virtual WSError SetSessionIcon(const sptr &token, const std::shared_ptr &icon) = 0; virtual WSError IsValidSessionIds(const std::vector &sessionIds, std::vector &results) = 0; virtual WSError PendingSessionToForeground(const sptr &token) = 0; diff --git a/window_scene/session_manager/include/zidl/scene_session_manager_lite_proxy.h b/window_scene/session_manager/include/zidl/scene_session_manager_lite_proxy.h index df99aca53d..623a43956d 100644 --- a/window_scene/session_manager/include/zidl/scene_session_manager_lite_proxy.h +++ b/window_scene/session_manager/include/zidl/scene_session_manager_lite_proxy.h @@ -58,7 +58,7 @@ public: const sptr& windowManagerAgent) override; WMError UnregisterWindowManagerAgent(WindowManagerAgentType type, const sptr& windowManagerAgent) override; - WMError CheckWindowId(int32_t windowId, int32_t &pid) override; + WMError CheckWindowId(int32_t windowId, int32_t& pid) override; WMError GetVisibilityWindowInfo(std::vector>& infos) override; WMError GetWindowModeType(WindowModeType& windowModeType) override; WMError GetMainWindowInfos(int32_t topNum, std::vector& topNInfo) override; diff --git a/window_scene/session_manager/include/zidl/scene_session_manager_lite_stub.h b/window_scene/session_manager/include/zidl/scene_session_manager_lite_stub.h index 711c3c73d5..082ca25c7c 100644 --- a/window_scene/session_manager/include/zidl/scene_session_manager_lite_stub.h +++ b/window_scene/session_manager/include/zidl/scene_session_manager_lite_stub.h @@ -55,9 +55,9 @@ private: int HandleMoveSessionsToBackground(MessageParcel& data, MessageParcel& reply); //for window manager service int HandleGetFocusSessionInfo(MessageParcel& data, MessageParcel& reply); - int HandleRegisterWindowManagerAgent(MessageParcel &data, MessageParcel &reply); - int HandleUnregisterWindowManagerAgent(MessageParcel &data, MessageParcel &reply); - int HandleCheckWindowId(MessageParcel &data, MessageParcel &reply); + int HandleRegisterWindowManagerAgent(MessageParcel& data, MessageParcel& reply); + int HandleUnregisterWindowManagerAgent(MessageParcel& data, MessageParcel& reply); + int HandleCheckWindowId(MessageParcel& data, MessageParcel& reply); int HandleGetVisibilityWindowInfo(MessageParcel& data, MessageParcel& reply); int HandleGetWindowModeType(MessageParcel& data, MessageParcel& reply); int HandleGetMainWinodowInfo(MessageParcel& data, MessageParcel& reply); diff --git a/window_scene/session_manager/include/zidl/scene_session_manager_proxy.h b/window_scene/session_manager/include/zidl/scene_session_manager_proxy.h index f38341b163..e888ea0d2c 100644 --- a/window_scene/session_manager/include/zidl/scene_session_manager_proxy.h +++ b/window_scene/session_manager/include/zidl/scene_session_manager_proxy.h @@ -52,7 +52,7 @@ public: const sptr& windowManagerAgent) override; WMError SetGestureNavigaionEnabled(bool enable) override; void GetFocusWindowInfo(FocusChangeInfo& focusInfo) override; - WSError SetSessionLabel(const sptr &token, const std::string &label) override; + WSError SetSessionLabel(const sptr &token, const std::string& label) override; WSError SetSessionIcon(const sptr &token, const std::shared_ptr &icon) override; WSError IsValidSessionIds(const std::vector &sessionIds, std::vector &results) override; WMError GetAccessibilityWindowInfo(std::vector>& infos) override; @@ -63,7 +63,7 @@ public: WMError GetSnapshotByWindowId(int32_t persistentId, std::shared_ptr& pixelMap) override; WSError GetFocusSessionToken(sptr &token) override; WSError GetFocusSessionElement(AppExecFwk::ElementName& element) override; - WMError CheckWindowId(int32_t windowId, int32_t &pid) override; + WMError CheckWindowId(int32_t windowId, int32_t& pid) override; WSError RegisterSessionListener(const sptr& listener) override; WSError UnRegisterSessionListener(const sptr& listener) override; diff --git a/window_scene/session_manager/include/zidl/scene_session_manager_stub.h b/window_scene/session_manager/include/zidl/scene_session_manager_stub.h index 198df72bcd..22966a6736 100644 --- a/window_scene/session_manager/include/zidl/scene_session_manager_stub.h +++ b/window_scene/session_manager/include/zidl/scene_session_manager_stub.h @@ -29,29 +29,29 @@ public: SceneSessionManagerStub() = default; virtual ~SceneSessionManagerStub() = default; - int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; + int OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) override; private: - int HandleGetAccessibilityWindowInfo(MessageParcel &data, MessageParcel &reply); + int HandleGetAccessibilityWindowInfo(MessageParcel& data, MessageParcel& reply); int HandleGetUnreliableWindowInfo(MessageParcel& data, MessageParcel& reply); - int HandleRequestFocusStatus(MessageParcel &data, MessageParcel &reply); - int HandleCreateAndConnectSpecificSession(MessageParcel &data, MessageParcel &reply); - int HandleRecoverAndConnectSpecificSession(MessageParcel &data, MessageParcel &reply); - int HandleRecoverAndReconnectSceneSession(MessageParcel &data, MessageParcel &reply); - int HandleDestroyAndDisconnectSpcificSession(MessageParcel &data, MessageParcel &reply); + int HandleRequestFocusStatus(MessageParcel& data, MessageParcel& reply); + int HandleCreateAndConnectSpecificSession(MessageParcel& data, MessageParcel& reply); + int HandleRecoverAndConnectSpecificSession(MessageParcel& data, MessageParcel& reply); + int HandleRecoverAndReconnectSceneSession(MessageParcel& data, MessageParcel& reply); + int HandleDestroyAndDisconnectSpcificSession(MessageParcel& data, MessageParcel& reply); int HandleDestroyAndDisconnectSpcificSessionWithDetachCallback(MessageParcel& data, MessageParcel& reply); - int HandleRegisterWindowManagerAgent(MessageParcel &data, MessageParcel &reply); - int HandleUnregisterWindowManagerAgent(MessageParcel &data, MessageParcel &reply); - int HandleGetFocusSessionInfo(MessageParcel &data, MessageParcel &reply); - int HandleSetSessionLabel(MessageParcel &data, MessageParcel &reply); - int HandleSetSessionIcon(MessageParcel &data, MessageParcel &reply); - int HandleIsValidSessionIds(MessageParcel &data, MessageParcel &reply); - int HandlePendingSessionToForeground(MessageParcel &data, MessageParcel &reply); - int HandlePendingSessionToBackgroundForDelegator(MessageParcel &data, MessageParcel &reply); - int HandleGetFocusSessionToken(MessageParcel &data, MessageParcel &reply); + int HandleRegisterWindowManagerAgent(MessageParcel& data, MessageParcel& reply); + int HandleUnregisterWindowManagerAgent(MessageParcel& data, MessageParcel& reply); + int HandleGetFocusSessionInfo(MessageParcel& data, MessageParcel& reply); + int HandleSetSessionLabel(MessageParcel& data, MessageParcel& reply); + int HandleSetSessionIcon(MessageParcel& data, MessageParcel& reply); + int HandleIsValidSessionIds(MessageParcel& data, MessageParcel& reply); + int HandlePendingSessionToForeground(MessageParcel& data, MessageParcel& reply); + int HandlePendingSessionToBackgroundForDelegator(MessageParcel& data, MessageParcel& reply); + int HandleGetFocusSessionToken(MessageParcel& data, MessageParcel& reply); int HandleGetFocusSessionElement(MessageParcel& data, MessageParcel& reply); - int HandleSetGestureNavigationEnabled(MessageParcel &data, MessageParcel &reply); - int HandleCheckWindowId(MessageParcel &data, MessageParcel &reply); + int HandleSetGestureNavigationEnabled(MessageParcel& data, MessageParcel& reply); + int HandleCheckWindowId(MessageParcel& data, MessageParcel& reply); int HandleRegisterSessionListener(MessageParcel& data, MessageParcel& reply); int HandleUnRegisterSessionListener(MessageParcel& data, MessageParcel& reply); @@ -61,23 +61,23 @@ private: int HandleDumpSessionAll(MessageParcel& data, MessageParcel& reply); int HandleDumpSessionWithId(MessageParcel& data, MessageParcel& reply); - int HandleSetSessionContinueState(MessageParcel &data, MessageParcel &reply); + int HandleSetSessionContinueState(MessageParcel& data, MessageParcel& reply); int HandleTerminateSessionNew(MessageParcel& data, MessageParcel& reply); - int HandleGetSessionDump(MessageParcel &data, MessageParcel &reply); + int HandleGetSessionDump(MessageParcel& data, MessageParcel& reply); int HandleUpdateSessionAvoidAreaListener(MessageParcel& data, MessageParcel& reply); - int HandleGetSessionSnapshot(MessageParcel &data, MessageParcel &reply); + int HandleGetSessionSnapshot(MessageParcel& data, MessageParcel& reply); int HandleGetSessionSnapshotById(MessageParcel& data, MessageParcel& reply); int HandleGetUIContentRemoteObj(MessageParcel& data, MessageParcel& reply); - int HandleBindDialogTarget(MessageParcel &data, MessageParcel &reply); - int HandleNotifyDumpInfoResult(MessageParcel &data, MessageParcel &reply); - int HandleClearSession(MessageParcel &data, MessageParcel &reply); - int HandleClearAllSessions(MessageParcel &data, MessageParcel &reply); - int HandleLockSession(MessageParcel &data, MessageParcel &reply); - int HandleUnlockSession(MessageParcel &data, MessageParcel &reply); - int HandleMoveSessionsToForeground(MessageParcel &data, MessageParcel &reply); - int HandleMoveSessionsToBackground(MessageParcel &data, MessageParcel &reply); - int HandleRegisterCollaborator(MessageParcel &data, MessageParcel &reply); - int HandleUnregisterCollaborator(MessageParcel &data, MessageParcel &reply); + int HandleBindDialogTarget(MessageParcel& data, MessageParcel& reply); + int HandleNotifyDumpInfoResult(MessageParcel& data, MessageParcel& reply); + int HandleClearSession(MessageParcel& data, MessageParcel& reply); + int HandleClearAllSessions(MessageParcel& data, MessageParcel& reply); + int HandleLockSession(MessageParcel& data, MessageParcel& reply); + int HandleUnlockSession(MessageParcel& data, MessageParcel& reply); + int HandleMoveSessionsToForeground(MessageParcel& data, MessageParcel& reply); + int HandleMoveSessionsToBackground(MessageParcel& data, MessageParcel& reply); + int HandleRegisterCollaborator(MessageParcel& data, MessageParcel& reply); + int HandleUnregisterCollaborator(MessageParcel& data, MessageParcel& reply); int HandleUpdateSessionTouchOutsideListener(MessageParcel& data, MessageParcel& reply); int HandleRaiseWindowToTop(MessageParcel& data, MessageParcel& reply); int HandleNotifyWindowExtensionVisibilityChange(MessageParcel& data, MessageParcel& reply); diff --git a/window_scene/session_manager/include/zidl/screen_session_manager_interface.h b/window_scene/session_manager/include/zidl/screen_session_manager_interface.h index 5afa525e1a..2409771145 100644 --- a/window_scene/session_manager/include/zidl/screen_session_manager_interface.h +++ b/window_scene/session_manager/include/zidl/screen_session_manager_interface.h @@ -54,7 +54,7 @@ public: virtual DMError SetOrientation(ScreenId screenId, Orientation orientation) override { return DMError::DM_OK; } virtual std::shared_ptr GetDisplaySnapshot(DisplayId displayId, DmErrorCode* errorCode = nullptr) override { return nullptr; } - virtual std::shared_ptr GetSnapshotByPicker(Media::Rect &rect, + virtual std::shared_ptr GetSnapshotByPicker(Media::Rect& rect, DmErrorCode* errorCode = nullptr) override { *errorCode = DmErrorCode::DM_ERROR_DEVICE_NOT_SUPPORT; diff --git a/window_scene/session_manager/include/zidl/screen_session_manager_lite_stub.h b/window_scene/session_manager/include/zidl/screen_session_manager_lite_stub.h index ec30c69943..4907b72442 100644 --- a/window_scene/session_manager/include/zidl/screen_session_manager_lite_stub.h +++ b/window_scene/session_manager/include/zidl/screen_session_manager_lite_stub.h @@ -28,8 +28,8 @@ public: ~ScreenSessionManagerLiteStub() = default; - virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) override; + virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, + MessageOption& option) override; private: int HandleRegisterDisplayManagerAgent(MessageParcel& data, MessageParcel& reply); int HandleUnRegisterDisplayManagerAgent(MessageParcel& data, MessageParcel& reply); diff --git a/window_scene/session_manager/include/zidl/screen_session_manager_proxy.h b/window_scene/session_manager/include/zidl/screen_session_manager_proxy.h index 67889f3111..5e4058b7ca 100644 --- a/window_scene/session_manager/include/zidl/screen_session_manager_proxy.h +++ b/window_scene/session_manager/include/zidl/screen_session_manager_proxy.h @@ -94,7 +94,7 @@ public: virtual void RemoveVirtualScreenFromGroup(std::vector screens) override; virtual std::shared_ptr GetDisplaySnapshot(DisplayId displayId, DmErrorCode* errorCode) override; - virtual std::shared_ptr GetSnapshotByPicker(Media::Rect &rect, DmErrorCode* errorCode) override; + virtual std::shared_ptr GetSnapshotByPicker(Media::Rect& rect, DmErrorCode* errorCode) override; virtual sptr GetDisplayInfoById(DisplayId displayId) override; virtual sptr GetDisplayInfoByScreen(ScreenId screenId) override; diff --git a/window_scene/session_manager/include/zidl/screen_session_manager_stub.h b/window_scene/session_manager/include/zidl/screen_session_manager_stub.h index ef96744b4b..4a94674f82 100644 --- a/window_scene/session_manager/include/zidl/screen_session_manager_stub.h +++ b/window_scene/session_manager/include/zidl/screen_session_manager_stub.h @@ -28,8 +28,8 @@ public: ~ScreenSessionManagerStub() = default; - virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) override; + virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, + MessageOption& option) override; private: void ProcGetSnapshotByPicker(MessageParcel& reply); void ProcSetVirtualScreenFlag(MessageParcel& data, MessageParcel& reply); diff --git a/window_scene/session_manager/src/connection/screen_cast_connection.cpp b/window_scene/session_manager/src/connection/screen_cast_connection.cpp index d30adbe6c4..fd4ed6769e 100644 --- a/window_scene/session_manager/src/connection/screen_cast_connection.cpp +++ b/window_scene/session_manager/src/connection/screen_cast_connection.cpp @@ -61,12 +61,12 @@ void ScreenCastConnection::CastDisconnectExtension() TLOGI(WmsLogTag::DMS, "CastDisconnectExtension exit"); } -void ScreenCastConnection::SetBundleName(const std::string &bundleName) +void ScreenCastConnection::SetBundleName(const std::string& bundleName) { bundleName_ = bundleName; } -void ScreenCastConnection::SetAbilityName(const std::string &abilityName) +void ScreenCastConnection::SetAbilityName(const std::string& abilityName) { abilityName_ = abilityName; } @@ -90,8 +90,8 @@ bool ScreenCastConnection::IsConnectedSync() return abilityConnection_->IsConnectedSync(); } -int32_t ScreenCastConnection::SendMessageToCastService(const int32_t &transCode, MessageParcel &data, - MessageParcel &reply) +int32_t ScreenCastConnection::SendMessageToCastService(const int32_t& transCode, MessageParcel& data, + MessageParcel& reply) { if (abilityConnection_ == nullptr) { TLOGE(WmsLogTag::DMS, "ability connection is nullptr"); diff --git a/window_scene/session_manager/src/connection/screen_session_ability_connection.cpp b/window_scene/session_manager/src/connection/screen_session_ability_connection.cpp index 633eac4219..528bef9afc 100644 --- a/window_scene/session_manager/src/connection/screen_session_ability_connection.cpp +++ b/window_scene/session_manager/src/connection/screen_session_ability_connection.cpp @@ -32,7 +32,7 @@ constexpr uint32_t TRANS_RELEASE_BLOCK = 0; constexpr uint32_t TRANS_FAILED_FOR_PRIVACY = 1; void ScreenSessionAbilityConnectionStub::OnAbilityConnectDone( - const AppExecFwk::ElementName &element, + const AppExecFwk::ElementName& element, const sptr &remoteObject, int32_t resultCode) { TLOGI(WmsLogTag::DMS, "OnAbilityConnectDone entry"); @@ -60,7 +60,7 @@ void ScreenSessionAbilityConnectionStub::OnAbilityConnectDone( } void ScreenSessionAbilityConnectionStub::OnAbilityDisconnectDone( - const AppExecFwk::ElementName &element, int32_t resultCode) + const AppExecFwk::ElementName& element, int32_t resultCode) { TLOGI(WmsLogTag::DMS, "OnAbilityDisconnectDone entry"); if (resultCode != ERR_OK) { @@ -124,7 +124,7 @@ bool ScreenSessionAbilityConnectionStub::IsAbilityConnectedSync() } int32_t ScreenSessionAbilityConnectionStub::SendMessageSync(int32_t transCode, - MessageParcel &data, MessageParcel &reply) + MessageParcel& data, MessageParcel& reply) { std::unique_lock lock(connectedMutex_); connectedCv_.wait_for(lock, std::chrono::milliseconds(SEND_MESSAGE_SYNC_OUT_TIME)); @@ -149,7 +149,7 @@ int32_t ScreenSessionAbilityConnectionStub::SendMessageSync(int32_t transCode, } int32_t ScreenSessionAbilityConnectionStub::SendMessageSyncBlock(int32_t transCode, - MessageParcel &data, MessageParcel &reply) + MessageParcel& data, MessageParcel& reply) { std::unique_lock lock(connectedMutex_); connectedCv_.wait_for(lock, std::chrono::milliseconds(SEND_MESSAGE_SYNC_OUT_TIME)); @@ -194,7 +194,7 @@ void ScreenSessionAbilityDeathRecipient::OnRemoteDied(const wptr } bool ScreenSessionAbilityConnection::ScreenSessionConnectExtension( - const std::string &bundleName, const std::string &abilityName) + const std::string& bundleName, const std::string& abilityName) { TLOGI(WmsLogTag::DMS, "bundleName:%{public}s, abilityName:%{public}s", bundleName.c_str(), abilityName.c_str()); if (abilityConnectionStub_ != nullptr) { @@ -241,7 +241,7 @@ void ScreenSessionAbilityConnection::ScreenSessionDisconnectExtension() } int32_t ScreenSessionAbilityConnection::SendMessage( - const int32_t &transCode, MessageParcel &data, MessageParcel &reply) + const int32_t& transCode, MessageParcel& data, MessageParcel& reply) { if (abilityConnectionStub_ == nullptr) { TLOGE(WmsLogTag::DMS, "ability connection is nullptr"); @@ -256,7 +256,7 @@ int32_t ScreenSessionAbilityConnection::SendMessage( } int32_t ScreenSessionAbilityConnection::SendMessageBlock( - const int32_t &transCode, MessageParcel &data, MessageParcel &reply) + const int32_t& transCode, MessageParcel& data, MessageParcel& reply) { if (abilityConnectionStub_ == nullptr) { TLOGE(WmsLogTag::DMS, "ability connection is nullptr"); diff --git a/window_scene/session_manager/src/connection/screen_snapshot_picker_connection.cpp b/window_scene/session_manager/src/connection/screen_snapshot_picker_connection.cpp index 0d4013b763..66d82e2e46 100644 --- a/window_scene/session_manager/src/connection/screen_snapshot_picker_connection.cpp +++ b/window_scene/session_manager/src/connection/screen_snapshot_picker_connection.cpp @@ -56,7 +56,7 @@ bool ScreenSnapshotPickerConnection::SnapshotPickerConnectExtension() return true; } -int32_t ScreenSnapshotPickerConnection::GetScreenSnapshotInfo(Media::Rect &rect, ScreenId &screenId) +int32_t ScreenSnapshotPickerConnection::GetScreenSnapshotInfo(Media::Rect& rect, ScreenId& screenId) { MessageParcel data; MessageParcel reply; @@ -122,12 +122,12 @@ sptr ScreenSnapshotPickerConnection::GetScre return abilityConnection_->GetScreenSessionAbilityConnectionStub(); } -void ScreenSnapshotPickerConnection::SetBundleName(const std::string &bundleName) +void ScreenSnapshotPickerConnection::SetBundleName(const std::string& bundleName) { bundleName_ = bundleName; } -void ScreenSnapshotPickerConnection::SetAbilityName(const std::string &abilityName) +void ScreenSnapshotPickerConnection::SetAbilityName(const std::string& abilityName) { abilityName_ = abilityName; } diff --git a/window_scene/session_manager/src/distributed_client.cpp b/window_scene/session_manager/src/distributed_client.cpp index ce1fd343d7..58158f1c49 100644 --- a/window_scene/session_manager/src/distributed_client.cpp +++ b/window_scene/session_manager/src/distributed_client.cpp @@ -161,7 +161,7 @@ bool DistributedClient::ReadMissionInfosFromParcel(Parcel& parcel, return true; } -int32_t DistributedClient::SetMissionContinueState(int32_t missionId, const AAFwk::ContinueState &state) +int32_t DistributedClient::SetMissionContinueState(int32_t missionId, const AAFwk::ContinueState& state) { TLOGI(WmsLogTag::DEFAULT, "Mission id: %{public}d, state: %{public}d", missionId, state); sptr remote = GetDmsProxy(); diff --git a/window_scene/session_manager/src/fold_screen_controller/fold_screen_sensor_manager.cpp b/window_scene/session_manager/src/fold_screen_controller/fold_screen_sensor_manager.cpp index fa80e5d12d..af390169aa 100644 --- a/window_scene/session_manager/src/fold_screen_controller/fold_screen_sensor_manager.cpp +++ b/window_scene/session_manager/src/fold_screen_controller/fold_screen_sensor_manager.cpp @@ -27,12 +27,12 @@ #include #endif -static void SensorPostureDataCallback(SensorEvent *event) +static void SensorPostureDataCallback(SensorEvent* event) { OHOS::Rosen::FoldScreenSensorManager::GetInstance().HandlePostureData(event); } -static void SensorHallDataCallback(SensorEvent *event) +static void SensorHallDataCallback(SensorEvent* event) { OHOS::Rosen::FoldScreenSensorManager::GetInstance().HandleHallData(event); } diff --git a/window_scene/session_manager/src/fold_screen_controller/sensor_fold_state_manager/dual_display_sensor_fold_state_manager.cpp b/window_scene/session_manager/src/fold_screen_controller/sensor_fold_state_manager/dual_display_sensor_fold_state_manager.cpp index d56cdd4a37..a5ace3b403 100644 --- a/window_scene/session_manager/src/fold_screen_controller/sensor_fold_state_manager/dual_display_sensor_fold_state_manager.cpp +++ b/window_scene/session_manager/src/fold_screen_controller/sensor_fold_state_manager/dual_display_sensor_fold_state_manager.cpp @@ -154,7 +154,7 @@ void DualDisplaySensorFoldStateManager::RegisterApplicationStateObserver() ApplicationStateObserver::ApplicationStateObserver() {} -void ApplicationStateObserver::OnForegroundApplicationChanged(const AppStateData &appStateData) +void ApplicationStateObserver::OnForegroundApplicationChanged(const AppStateData& appStateData) { if (appStateData.state == static_cast(ApplicationState::APP_STATE_FOREGROUND)) { foregroundBundleName_ = appStateData.bundleName; diff --git a/window_scene/session_manager/src/publish/scene_event_publish.cpp b/window_scene/session_manager/src/publish/scene_event_publish.cpp index 621dddede1..f24ca12a24 100644 --- a/window_scene/session_manager/src/publish/scene_event_publish.cpp +++ b/window_scene/session_manager/src/publish/scene_event_publish.cpp @@ -26,7 +26,7 @@ namespace OHOS::Rosen { static const std::string TIME_OUT("timeout"); constexpr HiviewDFX::HiLogLabel LABEL = { LOG_CORE, HILOG_DOMAIN_WINDOW, "SceneSessionManager" }; -void SceneEventPublish::OnReceiveEvent(const EventFwk::CommonEventData &data) +void SceneEventPublish::OnReceiveEvent(const EventFwk::CommonEventData& data) { std::lock_guard lock(mutex_); std::ostringstream oss; @@ -36,7 +36,7 @@ void SceneEventPublish::OnReceiveEvent(const EventFwk::CommonEventData &data) cv_.notify_all(); } -std::string SceneEventPublish::GetDebugDumpInfo(std::chrono::milliseconds const &time) +std::string SceneEventPublish::GetDebugDumpInfo(std::chrono::milliseconds const& time) { std::unique_lock lock(mutex_); if (cv_.wait_for(lock, time, [&] { return valueReady_; })) { diff --git a/window_scene/session_manager/src/publish/screen_session_publish.cpp b/window_scene/session_manager/src/publish/screen_session_publish.cpp index e51f23109d..2785b613e2 100644 --- a/window_scene/session_manager/src/publish/screen_session_publish.cpp +++ b/window_scene/session_manager/src/publish/screen_session_publish.cpp @@ -63,7 +63,7 @@ void ScreenSessionPublish::InitPublishEvents() } int32_t ScreenSessionPublish::PublishEvents( - const EventFwk::CommonEventData &eventData, std::string bundleName) + const EventFwk::CommonEventData& eventData, std::string bundleName) { if (publishInfo_ == nullptr) { TLOGE(WmsLogTag::DMS, "publishInfo is nullptr"); @@ -81,7 +81,7 @@ int32_t ScreenSessionPublish::PublishEvents( return PUBLISH_SUCCESS; } -void ScreenSessionPublish::PublishCastPluggedEvent(const bool &isEnable) +void ScreenSessionPublish::PublishCastPluggedEvent(const bool& isEnable) { TLOGI(WmsLogTag::DMS, "start to publish cast plugged event"); EventFwk::CommonEventData eventData; @@ -118,7 +118,7 @@ void ScreenSessionPublish::PublishCastPlugOutEvent() } void ScreenSessionPublish::PublishDisplayRotationEvent( - const ScreenId &screenId, const Rotation &displayRotation) + const ScreenId& screenId, const Rotation& displayRotation) { TLOGI(WmsLogTag::DMS, "start to publish display rotation event, screenId: %{public}d, displayRotation: %{public}d", diff --git a/window_scene/session_manager/src/scene_session_manager.cpp b/window_scene/session_manager/src/scene_session_manager.cpp index 31a5cf4031..249917e615 100644 --- a/window_scene/session_manager/src/scene_session_manager.cpp +++ b/window_scene/session_manager/src/scene_session_manager.cpp @@ -1289,7 +1289,7 @@ sptr SceneSessionManager::CreateKeyboa return keyboardCb; } -WMError SceneSessionManager::CheckWindowId(int32_t windowId, int32_t &pid) +WMError SceneSessionManager::CheckWindowId(int32_t windowId, int32_t& pid) { if (!SessionPermission::IsSystemCalling()) { TLOGE(WmsLogTag::WMS_EVENT, "CheckWindowId permission denied!"); @@ -2995,7 +2995,7 @@ WSError SceneSessionManager::ProcessBackEvent() return WSError::WS_OK; } -WSError SceneSessionManager::InitUserInfo(int32_t userId, std::string &fileDir) +WSError SceneSessionManager::InitUserInfo(int32_t userId, std::string& fileDir) { if (userId == DEFAULT_USERID || fileDir.empty()) { TLOGE(WmsLogTag::WMS_MAIN, "params invalid"); @@ -4765,8 +4765,8 @@ void SceneSessionManager::NotifyFocusStatus(sptr& sceneSession, bo } } -int32_t SceneSessionManager::NotifyRssThawApp(const int32_t uid, const std::string &bundleName, - const std::string &reason) +int32_t SceneSessionManager::NotifyRssThawApp(const int32_t uid, const std::string& bundleName, + const std::string& reason) { uint32_t resType = ResourceSchedule::ResType::SYNC_RES_TYPE_THAW_ONE_APP; nlohmann::json payload; @@ -5590,7 +5590,7 @@ WSError SceneSessionManager::NotifyWaterMarkFlagChangedResult(bool hasWaterMark) return WSError::WS_OK; } -void SceneSessionManager::ProcessPreload(const AppExecFwk::AbilityInfo &abilityInfo) const +void SceneSessionManager::ProcessPreload(const AppExecFwk::AbilityInfo& abilityInfo) const { if (!bundleMgr_) { WLOGFE("bundle manager is nullptr."); @@ -5671,7 +5671,7 @@ void SceneSessionManager::NotifySessionMovedToFront(int32_t persistentId) } } -WSError SceneSessionManager::SetSessionLabel(const sptr &token, const std::string &label) +WSError SceneSessionManager::SetSessionLabel(const sptr &token, const std::string& label) { WLOGFI("Enter label: %{public}s", label.c_str()); auto task = [this, &token, &label]() { @@ -9295,7 +9295,7 @@ void SceneSessionManager::CacVisibleWindowNum() } if (isFullScreen) { std::for_each(visibleWindowNumInfo.begin(), visibleWindowNumInfo.end(), - [](auto &info) { info.visibleWindowNum = 1; }); + [](auto& info) { info.visibleWindowNum = 1; }); } std::unique_lock lock(lastInfoMutex_); if (visibleWindowNumInfo.size() > 0 && !IsVectorSame(lastInfo_, visibleWindowNumInfo)) { diff --git a/window_scene/session_manager/src/screen_session_manager.cpp b/window_scene/session_manager/src/screen_session_manager.cpp index 8d899408da..411f1324f6 100644 --- a/window_scene/session_manager/src/screen_session_manager.cpp +++ b/window_scene/session_manager/src/screen_session_manager.cpp @@ -531,7 +531,7 @@ void ScreenSessionManager::OnScreenChange(ScreenId screenId, ScreenEvent screenE HandleScreenEvent(screenSession, screenId, screenEvent); } -void ScreenSessionManager::SendCastEvent(const bool &isPlugIn) +void ScreenSessionManager::SendCastEvent(const bool& isPlugIn) { TLOGI(WmsLogTag::DMS, "SendCastEvent entry isPlugIn:%{public}d", isPlugIn); if (!ScreenCastConnection::GetInstance().CastConnectExtension()) { @@ -1690,7 +1690,7 @@ void ScreenSessionManager::HandlerSensor(ScreenPowerStatus status, PowerStateCha } } -void ScreenSessionManager::BootFinishedCallback(const char *key, const char *value, void *context) +void ScreenSessionManager::BootFinishedCallback(const char* key, const char* value, void* context) { if (strcmp(key, BOOTEVENT_BOOT_COMPLETED.c_str()) == 0 && strcmp(value, "true") == 0) { TLOGI(WmsLogTag::DMS, "BootFinishedCallback boot animation finished"); @@ -3539,7 +3539,7 @@ std::shared_ptr ScreenSessionManager::GetDisplaySnapshot(Displa return nullptr; } -std::shared_ptr ScreenSessionManager::GetSnapshotByPicker(Media::Rect &rect, DmErrorCode* errorCode) +std::shared_ptr ScreenSessionManager::GetSnapshotByPicker(Media::Rect& rect, DmErrorCode* errorCode) { TLOGD(WmsLogTag::DMS, "ENTER!"); *errorCode = DmErrorCode::DM_ERROR_SYSTEM_INNORMAL; @@ -3577,7 +3577,7 @@ std::shared_ptr ScreenSessionManager::GetSnapshotByPicker(Media return pixelMap; } -bool ScreenSessionManager::GetSnapshotArea(Media::Rect &rect, DmErrorCode* errorCode, ScreenId &screenId) +bool ScreenSessionManager::GetSnapshotArea(Media::Rect& rect, DmErrorCode* errorCode, ScreenId& screenId) { ConfigureScreenSnapshotParams(); if (ScreenSnapshotPickerConnection::GetInstance().SnapshotPickerConnectExtension()) { diff --git a/window_scene/session_manager/src/session_manager_lite.cpp b/window_scene/session_manager/src/session_manager_lite.cpp index 649464feb2..8c02412b1b 100644 --- a/window_scene/session_manager/src/session_manager_lite.cpp +++ b/window_scene/session_manager/src/session_manager_lite.cpp @@ -33,7 +33,7 @@ public: explicit SessionManagerServiceLiteRecoverListener() = default; virtual int32_t OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override + uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) override { if (data.ReadInterfaceToken() != GetDescriptor()) { TLOGE(WmsLogTag::WMS_RECOVER, "InterfaceToken check failed"); diff --git a/window_scene/session_manager/src/zidl/scene_session_manager_lite_proxy.cpp b/window_scene/session_manager/src/zidl/scene_session_manager_lite_proxy.cpp index 28ad03b0e0..95541f3e75 100644 --- a/window_scene/session_manager/src/zidl/scene_session_manager_lite_proxy.cpp +++ b/window_scene/session_manager/src/zidl/scene_session_manager_lite_proxy.cpp @@ -25,7 +25,7 @@ constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "SceneSe constexpr int32_t MAX_TOPN_INFO_SIZE = 200; } -WSError SceneSessionManagerLiteProxy::SetSessionLabel(const sptr &token, const std::string &label) +WSError SceneSessionManagerLiteProxy::SetSessionLabel(const sptr &token, const std::string& label) { WLOGFD("run SceneSessionManagerLiteProxy::SetSessionLabel"); MessageParcel data; @@ -820,7 +820,7 @@ WMError SceneSessionManagerLiteProxy::UnregisterWindowManagerAgent(WindowManager return static_cast(reply.ReadInt32()); } -WMError SceneSessionManagerLiteProxy::CheckWindowId(int32_t windowId, int32_t &pid) +WMError SceneSessionManagerLiteProxy::CheckWindowId(int32_t windowId, int32_t& pid) { MessageParcel data; MessageParcel reply; diff --git a/window_scene/session_manager/src/zidl/scene_session_manager_lite_stub.cpp b/window_scene/session_manager/src/zidl/scene_session_manager_lite_stub.cpp index 8c247a943c..4839a10c15 100644 --- a/window_scene/session_manager/src/zidl/scene_session_manager_lite_stub.cpp +++ b/window_scene/session_manager/src/zidl/scene_session_manager_lite_stub.cpp @@ -26,7 +26,7 @@ constexpr uint32_t MAX_TOPN_INFO_SIZE = 200; } int SceneSessionManagerLiteStub::OnRemoteRequest(uint32_t code, - MessageParcel &data, MessageParcel &reply, MessageOption &option) + MessageParcel& data, MessageParcel& reply, MessageOption& option) { WLOGFD("Scene session on remote request!, code: %{public}u", code); if (data.ReadInterfaceToken() != GetDescriptor()) { @@ -118,7 +118,7 @@ int SceneSessionManagerLiteStub::ProcessRemoteRequest(uint32_t code, MessageParc } } -int SceneSessionManagerLiteStub::HandleSetSessionLabel(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleSetSessionLabel(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleSetSessionLabel!"); sptr token = data.ReadRemoteObject(); @@ -128,7 +128,7 @@ int SceneSessionManagerLiteStub::HandleSetSessionLabel(MessageParcel &data, Mess return ERR_NONE; } -int SceneSessionManagerLiteStub::HandleSetSessionIcon(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleSetSessionIcon(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleSetSessionIcon!"); sptr token = data.ReadRemoteObject(); @@ -138,7 +138,7 @@ int SceneSessionManagerLiteStub::HandleSetSessionIcon(MessageParcel &data, Messa return ERR_NONE; } -int SceneSessionManagerLiteStub::HandleIsValidSessionIds(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleIsValidSessionIds(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleIsValidSessionIds!"); std::vector sessionIds; @@ -150,7 +150,7 @@ int SceneSessionManagerLiteStub::HandleIsValidSessionIds(MessageParcel &data, Me return ERR_NONE; } -int SceneSessionManagerLiteStub::HandlePendingSessionToForeground(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandlePendingSessionToForeground(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandlePendingSessionToForeground!"); sptr token = data.ReadRemoteObject(); @@ -159,7 +159,7 @@ int SceneSessionManagerLiteStub::HandlePendingSessionToForeground(MessageParcel return ERR_NONE; } -int SceneSessionManagerLiteStub::HandlePendingSessionToBackgroundForDelegator(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandlePendingSessionToBackgroundForDelegator(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandlePendingSessionToBackground!"); sptr token = data.ReadRemoteObject(); @@ -263,7 +263,7 @@ int SceneSessionManagerLiteStub::HandleTerminateSessionNew(MessageParcel& data, return ERR_NONE; } -int SceneSessionManagerLiteStub::HandleGetFocusSessionToken(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleGetFocusSessionToken(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleGetFocusSessionToken!"); sptr token = nullptr; @@ -283,7 +283,7 @@ int SceneSessionManagerLiteStub::HandleGetFocusSessionElement(MessageParcel& dat return ERR_NONE; } -int SceneSessionManagerLiteStub::HandleSetSessionContinueState(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleSetSessionContinueState(MessageParcel& data, MessageParcel& reply) { WLOGFD("HandleSetSessionContinueState"); sptr token = data.ReadRemoteObject(); @@ -293,7 +293,7 @@ int SceneSessionManagerLiteStub::HandleSetSessionContinueState(MessageParcel &da return ERR_NONE; } -int SceneSessionManagerLiteStub::HandleGetSessionSnapshot(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleGetSessionSnapshot(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleGetSessionSnapshot!"); std::string deviceId = Str16ToStr8(data.ReadString16()); @@ -306,7 +306,7 @@ int SceneSessionManagerLiteStub::HandleGetSessionSnapshot(MessageParcel &data, M return ERR_NONE; } -int SceneSessionManagerLiteStub::HandleClearSession(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleClearSession(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleClearSession!"); int32_t persistentId = data.ReadInt32(); @@ -315,7 +315,7 @@ int SceneSessionManagerLiteStub::HandleClearSession(MessageParcel &data, Message return ERR_NONE; } -int SceneSessionManagerLiteStub::HandleClearAllSessions(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleClearAllSessions(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleClearAllSessions!"); WSError ret = ClearAllSessions(); @@ -323,7 +323,7 @@ int SceneSessionManagerLiteStub::HandleClearAllSessions(MessageParcel &data, Mes return ERR_NONE; } -int SceneSessionManagerLiteStub::HandleLockSession(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleLockSession(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleLockSession!"); int32_t sessionId = data.ReadInt32(); @@ -332,7 +332,7 @@ int SceneSessionManagerLiteStub::HandleLockSession(MessageParcel &data, MessageP return ERR_NONE; } -int SceneSessionManagerLiteStub::HandleUnlockSession(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleUnlockSession(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleUnlockSession!"); int32_t sessionId = data.ReadInt32(); @@ -341,7 +341,7 @@ int SceneSessionManagerLiteStub::HandleUnlockSession(MessageParcel &data, Messag return ERR_NONE; } -int SceneSessionManagerLiteStub::HandleMoveSessionsToForeground(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleMoveSessionsToForeground(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleMoveSessionsToForeground!"); std::vector sessionIds; @@ -352,7 +352,7 @@ int SceneSessionManagerLiteStub::HandleMoveSessionsToForeground(MessageParcel &d return ERR_NONE; } -int SceneSessionManagerLiteStub::HandleMoveSessionsToBackground(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleMoveSessionsToBackground(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleMoveSessionsToBackground!"); std::vector sessionIds; @@ -374,7 +374,7 @@ int SceneSessionManagerLiteStub::HandleGetFocusSessionInfo(MessageParcel& data, return ERR_NONE; } -int SceneSessionManagerLiteStub::HandleCheckWindowId(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleCheckWindowId(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleCheckWindowId!"); int32_t windowId = INVALID_WINDOW_ID; @@ -396,7 +396,7 @@ int SceneSessionManagerLiteStub::HandleCheckWindowId(MessageParcel &data, Messag } -int SceneSessionManagerLiteStub::HandleRegisterWindowManagerAgent(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleRegisterWindowManagerAgent(MessageParcel& data, MessageParcel& reply) { auto type = static_cast(data.ReadUint32()); WLOGFI("run HandleRegisterWindowManagerAgent!, type=%{public}u", static_cast(type)); @@ -408,7 +408,7 @@ int SceneSessionManagerLiteStub::HandleRegisterWindowManagerAgent(MessageParcel return ERR_NONE; } -int SceneSessionManagerLiteStub::HandleUnregisterWindowManagerAgent(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleUnregisterWindowManagerAgent(MessageParcel& data, MessageParcel& reply) { auto type = static_cast(data.ReadUint32()); WLOGFI("run HandleUnregisterWindowManagerAgent!, type=%{public}u", static_cast(type)); @@ -445,7 +445,7 @@ int SceneSessionManagerLiteStub::HandleGetWindowModeType(MessageParcel& data, Me return ERR_NONE; } -int SceneSessionManagerLiteStub::HandleGetMainWinodowInfo(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerLiteStub::HandleGetMainWinodowInfo(MessageParcel& data, MessageParcel& reply) { TLOGI(WmsLogTag::WMS_MAIN, "run HandleGetMainWinodowInfo lite"); int32_t topN = 0; diff --git a/window_scene/session_manager/src/zidl/scene_session_manager_proxy.cpp b/window_scene/session_manager/src/zidl/scene_session_manager_proxy.cpp index 7d7ba9cc46..d0713d7684 100644 --- a/window_scene/session_manager/src/zidl/scene_session_manager_proxy.cpp +++ b/window_scene/session_manager/src/zidl/scene_session_manager_proxy.cpp @@ -641,7 +641,7 @@ void SceneSessionManagerProxy::GetFocusWindowInfo(FocusChangeInfo& focusInfo) } } -WSError SceneSessionManagerProxy::SetSessionLabel(const sptr &token, const std::string &label) +WSError SceneSessionManagerProxy::SetSessionLabel(const sptr &token, const std::string& label) { WLOGFI("run SceneSessionManagerProxy::SetSessionLabel"); MessageParcel data; @@ -1207,7 +1207,7 @@ WSError SceneSessionManagerProxy::GetFocusSessionElement(AppExecFwk::ElementName return static_cast(reply.ReadInt32()); } -WMError SceneSessionManagerProxy::CheckWindowId(int32_t windowId, int32_t &pid) +WMError SceneSessionManagerProxy::CheckWindowId(int32_t windowId, int32_t& pid) { MessageParcel data; MessageParcel reply; diff --git a/window_scene/session_manager/src/zidl/scene_session_manager_stub.cpp b/window_scene/session_manager/src/zidl/scene_session_manager_stub.cpp index 547cf5ea77..bd6d07ecb1 100644 --- a/window_scene/session_manager/src/zidl/scene_session_manager_stub.cpp +++ b/window_scene/session_manager/src/zidl/scene_session_manager_stub.cpp @@ -25,7 +25,7 @@ constexpr uint32_t MAX_VECTOR_SIZE = 100; } int SceneSessionManagerStub::OnRemoteRequest(uint32_t code, - MessageParcel &data, MessageParcel &reply, MessageOption &option) + MessageParcel& data, MessageParcel& reply, MessageOption& option) { WLOGFD("Scene session on remote request!, code: %{public}u", code); if (data.ReadInterfaceToken() != GetDescriptor()) { @@ -172,7 +172,7 @@ int SceneSessionManagerStub::ProcessRemoteRequest(uint32_t code, MessageParcel& } } -int SceneSessionManagerStub::HandleCreateAndConnectSpecificSession(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleCreateAndConnectSpecificSession(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleCreateAndConnectSpecificSession!"); sptr sessionStageObject = data.ReadRemoteObject(); @@ -214,7 +214,7 @@ int SceneSessionManagerStub::HandleCreateAndConnectSpecificSession(MessageParcel return ERR_NONE; } -int SceneSessionManagerStub::HandleRecoverAndConnectSpecificSession(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleRecoverAndConnectSpecificSession(MessageParcel& data, MessageParcel& reply) { TLOGI(WmsLogTag::WMS_RECOVER, "run!"); sptr sessionStageObject = data.ReadRemoteObject(); @@ -308,7 +308,7 @@ int SceneSessionManagerStub::HandleDestroyAndDisconnectSpcificSessionWithDetachC return ERR_NONE; } -int SceneSessionManagerStub::HandleRequestFocusStatus(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleRequestFocusStatus(MessageParcel& data, MessageParcel& reply) { WLOGFI("run"); int32_t persistentId = data.ReadInt32(); @@ -318,7 +318,7 @@ int SceneSessionManagerStub::HandleRequestFocusStatus(MessageParcel &data, Messa return ERR_NONE; } -int SceneSessionManagerStub::HandleRegisterWindowManagerAgent(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleRegisterWindowManagerAgent(MessageParcel& data, MessageParcel& reply) { auto type = static_cast(data.ReadUint32()); WLOGFI("run HandleRegisterWindowManagerAgent!, type=%{public}u", static_cast(type)); @@ -330,7 +330,7 @@ int SceneSessionManagerStub::HandleRegisterWindowManagerAgent(MessageParcel &dat return ERR_NONE; } -int SceneSessionManagerStub::HandleUnregisterWindowManagerAgent(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleUnregisterWindowManagerAgent(MessageParcel& data, MessageParcel& reply) { auto type = static_cast(data.ReadUint32()); WLOGFI("run HandleUnregisterWindowManagerAgent!, type=%{public}u", static_cast(type)); @@ -342,7 +342,7 @@ int SceneSessionManagerStub::HandleUnregisterWindowManagerAgent(MessageParcel &d return ERR_NONE; } -int SceneSessionManagerStub::HandleGetFocusSessionInfo(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleGetFocusSessionInfo(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleGetFocusSessionInfo!"); FocusChangeInfo focusInfo; @@ -351,7 +351,7 @@ int SceneSessionManagerStub::HandleGetFocusSessionInfo(MessageParcel &data, Mess return ERR_NONE; } -int SceneSessionManagerStub::HandleSetSessionLabel(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleSetSessionLabel(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleSetSessionLabel!"); sptr token = data.ReadRemoteObject(); @@ -361,7 +361,7 @@ int SceneSessionManagerStub::HandleSetSessionLabel(MessageParcel &data, MessageP return ERR_NONE; } -int SceneSessionManagerStub::HandleSetSessionIcon(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleSetSessionIcon(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleSetSessionIcon!"); sptr token = data.ReadRemoteObject(); @@ -371,7 +371,7 @@ int SceneSessionManagerStub::HandleSetSessionIcon(MessageParcel &data, MessagePa return ERR_NONE; } -int SceneSessionManagerStub::HandleIsValidSessionIds(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleIsValidSessionIds(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleIsValidSessionIds!"); std::vector sessionIds; @@ -381,7 +381,7 @@ int SceneSessionManagerStub::HandleIsValidSessionIds(MessageParcel &data, Messag return ERR_NONE; } -int SceneSessionManagerStub::HandlePendingSessionToForeground(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandlePendingSessionToForeground(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandlePendingSessionToForeground!"); sptr token = data.ReadRemoteObject(); @@ -390,7 +390,7 @@ int SceneSessionManagerStub::HandlePendingSessionToForeground(MessageParcel &dat return ERR_NONE; } -int SceneSessionManagerStub::HandlePendingSessionToBackgroundForDelegator(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandlePendingSessionToBackgroundForDelegator(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandlePendingSessionToBackground!"); sptr token = data.ReadRemoteObject(); @@ -529,7 +529,7 @@ int SceneSessionManagerStub::HandleTerminateSessionNew(MessageParcel& data, Mess return ERR_NONE; } -int SceneSessionManagerStub::HandleGetFocusSessionToken(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleGetFocusSessionToken(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleGetFocusSessionToken!"); sptr token = nullptr; @@ -549,7 +549,7 @@ int SceneSessionManagerStub::HandleGetFocusSessionElement(MessageParcel& data, M return ERR_NONE; } -int SceneSessionManagerStub::HandleCheckWindowId(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleCheckWindowId(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleCheckWindowId!"); int32_t windowId = INVALID_WINDOW_ID; @@ -570,7 +570,7 @@ int SceneSessionManagerStub::HandleCheckWindowId(MessageParcel &data, MessagePar return ERR_NONE; } -int SceneSessionManagerStub::HandleSetGestureNavigationEnabled(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleSetGestureNavigationEnabled(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleSetGestureNavigationEnabled!"); bool enable = data.ReadBool(); @@ -579,7 +579,7 @@ int SceneSessionManagerStub::HandleSetGestureNavigationEnabled(MessageParcel &da return ERR_NONE; } -int SceneSessionManagerStub::HandleGetAccessibilityWindowInfo(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleGetAccessibilityWindowInfo(MessageParcel& data, MessageParcel& reply) { std::vector> infos; WMError errCode = GetAccessibilityWindowInfo(infos); @@ -609,7 +609,7 @@ int SceneSessionManagerStub::HandleGetUnreliableWindowInfo(MessageParcel& data, return ERR_NONE; } -int SceneSessionManagerStub::HandleSetSessionContinueState(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleSetSessionContinueState(MessageParcel& data, MessageParcel& reply) { WLOGFI("HandleSetSessionContinueState"); sptr token = data.ReadRemoteObject(); @@ -619,7 +619,7 @@ int SceneSessionManagerStub::HandleSetSessionContinueState(MessageParcel &data, return ERR_NONE; } -int SceneSessionManagerStub::HandleGetSessionDump(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleGetSessionDump(MessageParcel& data, MessageParcel& reply) { std::vector params; if (!data.ReadStringVector(¶ms)) { @@ -651,7 +651,7 @@ int SceneSessionManagerStub::HandleUpdateSessionAvoidAreaListener(MessageParcel& return ERR_NONE; } -int SceneSessionManagerStub::HandleGetSessionSnapshot(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleGetSessionSnapshot(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleGetSessionSnapshot!"); std::string deviceId = Str16ToStr8(data.ReadString16()); @@ -686,7 +686,7 @@ int SceneSessionManagerStub::HandleGetUIContentRemoteObj(MessageParcel& data, Me return ERR_NONE; } -int SceneSessionManagerStub::HandleBindDialogTarget(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleBindDialogTarget(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleBindDialogTarget!"); uint64_t persistentId = data.ReadUint64(); @@ -696,7 +696,7 @@ int SceneSessionManagerStub::HandleBindDialogTarget(MessageParcel &data, Message return ERR_NONE; } -int SceneSessionManagerStub::HandleNotifyDumpInfoResult(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleNotifyDumpInfoResult(MessageParcel& data, MessageParcel& reply) { WLOGFI("HandleNotifyDumpInfoResult"); std::vector info; @@ -720,7 +720,7 @@ int SceneSessionManagerStub::HandleNotifyDumpInfoResult(MessageParcel &data, Mes return ERR_NONE; } -int SceneSessionManagerStub::HandleClearSession(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleClearSession(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleClearSession!"); int32_t persistentId = data.ReadInt32(); @@ -729,7 +729,7 @@ int SceneSessionManagerStub::HandleClearSession(MessageParcel &data, MessageParc return ERR_NONE; } -int SceneSessionManagerStub::HandleClearAllSessions(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleClearAllSessions(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleClearAllSessions!"); WSError ret = ClearAllSessions(); @@ -737,7 +737,7 @@ int SceneSessionManagerStub::HandleClearAllSessions(MessageParcel &data, Message return ERR_NONE; } -int SceneSessionManagerStub::HandleLockSession(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleLockSession(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleLockSession!"); int32_t sessionId = data.ReadInt32(); @@ -745,7 +745,7 @@ int SceneSessionManagerStub::HandleLockSession(MessageParcel &data, MessageParce reply.WriteUint32(static_cast(ret)); return ERR_NONE; } -int SceneSessionManagerStub::HandleUnlockSession(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleUnlockSession(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleUnlockSession!"); int32_t sessionId = data.ReadInt32(); @@ -753,7 +753,7 @@ int SceneSessionManagerStub::HandleUnlockSession(MessageParcel &data, MessagePar reply.WriteUint32(static_cast(ret)); return ERR_NONE; } -int SceneSessionManagerStub::HandleMoveSessionsToForeground(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleMoveSessionsToForeground(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleMoveSessionsToForeground!"); std::vector sessionIds; @@ -763,7 +763,7 @@ int SceneSessionManagerStub::HandleMoveSessionsToForeground(MessageParcel &data, reply.WriteUint32(static_cast(ret)); return ERR_NONE; } -int SceneSessionManagerStub::HandleMoveSessionsToBackground(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleMoveSessionsToBackground(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleMoveSessionsToBackground!"); std::vector sessionIds; @@ -776,7 +776,7 @@ int SceneSessionManagerStub::HandleMoveSessionsToBackground(MessageParcel &data, return ERR_NONE; } -int SceneSessionManagerStub::HandleRegisterCollaborator(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleRegisterCollaborator(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleRegisterCollaborator!"); int32_t type = data.ReadInt32(); @@ -787,7 +787,7 @@ int SceneSessionManagerStub::HandleRegisterCollaborator(MessageParcel &data, Mes return ERR_NONE; } -int SceneSessionManagerStub::HandleUnregisterCollaborator(MessageParcel &data, MessageParcel &reply) +int SceneSessionManagerStub::HandleUnregisterCollaborator(MessageParcel& data, MessageParcel& reply) { WLOGFI("run HandleUnregisterCollaborator!"); int32_t type = data.ReadInt32(); diff --git a/window_scene/session_manager/src/zidl/screen_session_manager_lite_stub.cpp b/window_scene/session_manager/src/zidl/screen_session_manager_lite_stub.cpp index 730c1c05db..2cff5c5e69 100644 --- a/window_scene/session_manager/src/zidl/screen_session_manager_lite_stub.cpp +++ b/window_scene/session_manager/src/zidl/screen_session_manager_lite_stub.cpp @@ -74,7 +74,7 @@ int32_t ScreenSessionManagerLiteStub::OnRemoteRequest(uint32_t code, MessageParc return 0; } -int ScreenSessionManagerLiteStub::HandleRegisterDisplayManagerAgent(MessageParcel &data, MessageParcel &reply) +int ScreenSessionManagerLiteStub::HandleRegisterDisplayManagerAgent(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleRegisterDisplayManagerAgent!"); auto agent = iface_cast(data.ReadRemoteObject()); @@ -87,7 +87,7 @@ int ScreenSessionManagerLiteStub::HandleRegisterDisplayManagerAgent(MessageParce return ERR_NONE; } -int ScreenSessionManagerLiteStub::HandleUnRegisterDisplayManagerAgent(MessageParcel &data, MessageParcel &reply) +int ScreenSessionManagerLiteStub::HandleUnRegisterDisplayManagerAgent(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleUnRegisterDisplayManagerAgent!"); auto agent = iface_cast(data.ReadRemoteObject()); @@ -100,7 +100,7 @@ int ScreenSessionManagerLiteStub::HandleUnRegisterDisplayManagerAgent(MessagePar return ERR_NONE; } -int ScreenSessionManagerLiteStub::HandleGetFoldDisplayMode(MessageParcel &data, MessageParcel &reply) +int ScreenSessionManagerLiteStub::HandleGetFoldDisplayMode(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleGetFoldDisplayMode!"); FoldDisplayMode displayMode = GetFoldDisplayMode(); @@ -108,21 +108,21 @@ int ScreenSessionManagerLiteStub::HandleGetFoldDisplayMode(MessageParcel &data, return ERR_NONE; } -int ScreenSessionManagerLiteStub::HandleIsFoldable(MessageParcel &data, MessageParcel &reply) +int ScreenSessionManagerLiteStub::HandleIsFoldable(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleIsFoldable!"); reply.WriteBool(IsFoldable()); return ERR_NONE; } -int ScreenSessionManagerLiteStub::HandleGetFoldStatus(MessageParcel &data, MessageParcel &reply) +int ScreenSessionManagerLiteStub::HandleGetFoldStatus(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleGetFoldStatus!"); reply.WriteUint32(static_cast(GetFoldStatus())); return ERR_NONE; } -int ScreenSessionManagerLiteStub::HandleGetDefaultDisplayInfo(MessageParcel &data, MessageParcel &reply) +int ScreenSessionManagerLiteStub::HandleGetDefaultDisplayInfo(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleGetDefaultDisplayInfo!"); auto info = GetDefaultDisplayInfo(); @@ -130,7 +130,7 @@ int ScreenSessionManagerLiteStub::HandleGetDefaultDisplayInfo(MessageParcel &dat return ERR_NONE; } -int ScreenSessionManagerLiteStub::HandleGetDisplayById(MessageParcel &data, MessageParcel &reply) +int ScreenSessionManagerLiteStub::HandleGetDisplayById(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleGetDisplayById!"); DisplayId displayId = data.ReadUint64(); @@ -139,7 +139,7 @@ int ScreenSessionManagerLiteStub::HandleGetDisplayById(MessageParcel &data, Mess return ERR_NONE; } -int ScreenSessionManagerLiteStub::HandleGetCutoutInfo(MessageParcel &data, MessageParcel &reply) +int ScreenSessionManagerLiteStub::HandleGetCutoutInfo(MessageParcel& data, MessageParcel& reply) { WLOGFD("run HandleGetCutoutInfo!"); DisplayId displayId = static_cast(data.ReadUint64()); diff --git a/window_scene/session_manager/src/zidl/screen_session_manager_proxy.cpp b/window_scene/session_manager/src/zidl/screen_session_manager_proxy.cpp index 477a273cf1..1a12d51e44 100644 --- a/window_scene/session_manager/src/zidl/screen_session_manager_proxy.cpp +++ b/window_scene/session_manager/src/zidl/screen_session_manager_proxy.cpp @@ -1407,7 +1407,7 @@ std::shared_ptr ScreenSessionManagerProxy::GetDisplaySnapshot(D return pixelMap; } -std::shared_ptr ScreenSessionManagerProxy::GetSnapshotByPicker(Media::Rect &rect, +std::shared_ptr ScreenSessionManagerProxy::GetSnapshotByPicker(Media::Rect& rect, DmErrorCode* errorCode) { WLOGFD("enter"); diff --git a/window_scene/session_manager_service/include/session_manager_service_stub.h b/window_scene/session_manager_service/include/session_manager_service_stub.h index 35155e2caa..50922f11fe 100644 --- a/window_scene/session_manager_service/include/session_manager_service_stub.h +++ b/window_scene/session_manager_service/include/session_manager_service_stub.h @@ -26,7 +26,7 @@ public: SessionManagerServiceStub() = default; virtual ~SessionManagerServiceStub() = default; - int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; + int OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) override; }; } // namespace OHOS::Rosen diff --git a/window_scene/session_manager_service/src/session_manager_service_stub.cpp b/window_scene/session_manager_service/src/session_manager_service_stub.cpp index 4feb27683a..5ae760e219 100644 --- a/window_scene/session_manager_service/src/session_manager_service_stub.cpp +++ b/window_scene/session_manager_service/src/session_manager_service_stub.cpp @@ -22,8 +22,8 @@ namespace { constexpr HiviewDFX::HiLogLabel LABEL = { LOG_CORE, HILOG_DOMAIN_WINDOW, "SessionManagerServiceStub" }; } -int SessionManagerServiceStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) +int SessionManagerServiceStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, + MessageOption& option) { WLOGFD("OnRemoteRequest code is %{public}u", code); if (data.ReadInterfaceToken() != GetDescriptor()) { diff --git a/window_scene/test/mock/mock_message_parcel.cpp b/window_scene/test/mock/mock_message_parcel.cpp index 2fd9864d64..bc8023c55a 100644 --- a/window_scene/test/mock/mock_message_parcel.cpp +++ b/window_scene/test/mock/mock_message_parcel.cpp @@ -168,7 +168,7 @@ bool Parcel::WriteFloat(float value) } #ifdef ENABLE_MOCK_READ_INT32 -bool Parcel::ReadInt32(int32_t &value) +bool Parcel::ReadInt32(int32_t& value) { if (g_setReadInt32ErrorFlag) { return false; @@ -178,7 +178,7 @@ bool Parcel::ReadInt32(int32_t &value) #endif #ifdef ENABLE_MOCK_READ_INT64 -bool Parcel::ReadInt64(int64_t &value) +bool Parcel::ReadInt64(int64_t& value) { if (g_setReadInt64ErrorFlag) { return false; diff --git a/window_scene/test/unittest/keyboard_session_test.cpp b/window_scene/test/unittest/keyboard_session_test.cpp index 976b58e4bc..b51964632f 100644 --- a/window_scene/test/unittest/keyboard_session_test.cpp +++ b/window_scene/test/unittest/keyboard_session_test.cpp @@ -41,7 +41,7 @@ public: void SetUp() override; void TearDown() override; private: - sptr GetKeyboardSession(std::string &abilityName, std::string &bundleName); + sptr GetKeyboardSession(std::string& abilityName, std::string& bundleName); }; void KeyboardSessionTest::SetUpTestCase() @@ -60,7 +60,7 @@ void KeyboardSessionTest::TearDown() { } -sptr KeyboardSessionTest::GetKeyboardSession(std::string &abilityName, std::string &bundleName) +sptr KeyboardSessionTest::GetKeyboardSession(std::string& abilityName, std::string& bundleName) { SessionInfo info; info.abilityName_ = abilityName; diff --git a/window_scene/test/unittest/scene_session_lifecycle_test.cpp b/window_scene/test/unittest/scene_session_lifecycle_test.cpp index 5513923efe..080fda0fa6 100644 --- a/window_scene/test/unittest/scene_session_lifecycle_test.cpp +++ b/window_scene/test/unittest/scene_session_lifecycle_test.cpp @@ -87,7 +87,7 @@ HWTEST_F(SceneSessionLifecycleTest, Foreground01, Function | SmallTest | Level2) auto result = sceneSession->Foreground(property); ASSERT_EQ(result, WSError::WS_OK); - specificCallback->onCreate_ = [&resultValue, specificCallback](const SessionInfo &info, + specificCallback->onCreate_ = [&resultValue, specificCallback](const SessionInfo& info, sptr property) -> sptr { sptr scensessionreturn = new (std::nothrow) SceneSession(info, specificCallback); @@ -228,7 +228,7 @@ HWTEST_F(SceneSessionLifecycleTest, Background01, Function | SmallTest | Level2) sceneSession->isActive_ = true; auto result = sceneSession->Background(); ASSERT_EQ(result, WSError::WS_OK); - specificCallback->onCreate_ = [&resultValue, specificCallback](const SessionInfo &info, + specificCallback->onCreate_ = [&resultValue, specificCallback](const SessionInfo& info, sptr property) -> sptr { sptr scensessionreturn = new (std::nothrow) SceneSession(info, specificCallback); diff --git a/window_scene/test/unittest/scene_session_manager_lite_stub_test.cpp b/window_scene/test/unittest/scene_session_manager_lite_stub_test.cpp index 810b3ed415..8a806a7563 100644 --- a/window_scene/test/unittest/scene_session_manager_lite_stub_test.cpp +++ b/window_scene/test/unittest/scene_session_manager_lite_stub_test.cpp @@ -126,7 +126,7 @@ class MockSceneSessionManagerLiteStub : public SceneSessionManagerLiteStub { void GetFocusWindowInfo(FocusChangeInfo& focusInfo) override { } - WMError CheckWindowId(int32_t windowId, int32_t &pid) override + WMError CheckWindowId(int32_t windowId, int32_t& pid) override { return WMError::WM_OK; } diff --git a/window_scene/test/unittest/session_test.cpp b/window_scene/test/unittest/session_test.cpp index cdfb606e56..76c4579b79 100644 --- a/window_scene/test/unittest/session_test.cpp +++ b/window_scene/test/unittest/session_test.cpp @@ -376,7 +376,7 @@ HWTEST_F(WindowSessionTest, UpdateSessionRect01, Function | SmallTest | Level2) ASSERT_EQ(result, WSError::WS_OK); int resultValue = 0; - NotifySessionRectChangeFunc onRectChange_ = [&resultValue](const WSRect &rect, const SizeChangeReason& reason) + NotifySessionRectChangeFunc onRectChange_ = [&resultValue](const WSRect& rect, const SizeChangeReason& reason) { resultValue = 1; }; scensessionchangeCallBack->onRectChange_ = onRectChange_; result = scensession->UpdateSessionRect(rect, SizeChangeReason::RESIZE); diff --git a/wm/include/window_adapter.h b/wm/include/window_adapter.h index 92a9b27840..2a76ab5143 100644 --- a/wm/include/window_adapter.h +++ b/wm/include/window_adapter.h @@ -64,7 +64,7 @@ public: const sptr& windowManagerAgent); virtual WMError UnregisterWindowManagerAgent(WindowManagerAgentType type, const sptr& windowManagerAgent); - virtual WMError CheckWindowId(int32_t windowId, int32_t &pid); + virtual WMError CheckWindowId(int32_t windowId, int32_t& pid); virtual WMError SetWindowAnimationController(const sptr& controller); virtual WMError NotifyWindowTransition(sptr from, sptr to); diff --git a/wm/include/window_adapter_lite.h b/wm/include/window_adapter_lite.h index f8e27dd9e8..99db211077 100644 --- a/wm/include/window_adapter_lite.h +++ b/wm/include/window_adapter_lite.h @@ -41,7 +41,7 @@ public: const sptr& windowManagerAgent); virtual WMError UnregisterWindowManagerAgent(WindowManagerAgentType type, const sptr& windowManagerAgent); - virtual WMError CheckWindowId(int32_t windowId, int32_t &pid); + virtual WMError CheckWindowId(int32_t windowId, int32_t& pid); virtual WMError GetVisibilityWindowInfo(std::vector>& infos); virtual void ClearWindowAdapter(); virtual WMError GetWindowModeType(WindowModeType& windowModeType); diff --git a/wm/include/window_session_impl.h b/wm/include/window_session_impl.h index 02a35e74d5..09aee7b955 100644 --- a/wm/include/window_session_impl.h +++ b/wm/include/window_session_impl.h @@ -376,7 +376,7 @@ private: void NotifyRotationAnimationEnd(); void SubmitNoInteractionMonitorTask(int32_t eventId, const IWindowNoInteractionListenerSptr& listener); bool IsUserOrientation(Orientation orientation) const; - void GetTitleButtonVisible(bool isPC, bool &hideMaximizeButton, bool &hideMinimizeButton, bool &hideSplitButton); + void GetTitleButtonVisible(bool isPC, bool& hideMaximizeButton, bool& hideMinimizeButton, bool& hideSplitButton); WMError GetAppForceLandscapeConfig(AppForceLandscapeConfig& config); void SetForceSplitEnable(bool isForceSplit, const std::string& homePage = ""); bool IsNotifyInteractiveDuplicative(bool interactive); diff --git a/wm/include/zidl/window_stub.h b/wm/include/zidl/window_stub.h index 45964f530f..e148b337d7 100644 --- a/wm/include/zidl/window_stub.h +++ b/wm/include/zidl/window_stub.h @@ -26,8 +26,8 @@ public: WindowStub() = default; ~WindowStub() = default; - virtual int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) override; + virtual int OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, + MessageOption& option) override; private: static inline const class StaticDestroyMonitor { public: diff --git a/wm/src/window_adapter.cpp b/wm/src/window_adapter.cpp index 5cbe527b16..32253d620b 100644 --- a/wm/src/window_adapter.cpp +++ b/wm/src/window_adapter.cpp @@ -157,7 +157,7 @@ WMError WindowAdapter::UnregisterWindowManagerAgent(WindowManagerAgentType type, return ret; } -WMError WindowAdapter::CheckWindowId(int32_t windowId, int32_t &pid) +WMError WindowAdapter::CheckWindowId(int32_t windowId, int32_t& pid) { INIT_PROXY_CHECK_RETURN(WMError::WM_ERROR_SAMGR); diff --git a/wm/src/window_adapter_lite.cpp b/wm/src/window_adapter_lite.cpp index 3cd4cd0e1c..09c51d9b9b 100644 --- a/wm/src/window_adapter_lite.cpp +++ b/wm/src/window_adapter_lite.cpp @@ -112,7 +112,7 @@ void WindowAdapterLite::ReregisterWindowManagerLiteAgent() } } -WMError WindowAdapterLite::CheckWindowId(int32_t windowId, int32_t &pid) +WMError WindowAdapterLite::CheckWindowId(int32_t windowId, int32_t& pid) { INIT_PROXY_CHECK_RETURN(WMError::WM_ERROR_SAMGR); diff --git a/wm/src/window_session_impl.cpp b/wm/src/window_session_impl.cpp index e307f76fcc..f190c590fd 100644 --- a/wm/src/window_session_impl.cpp +++ b/wm/src/window_session_impl.cpp @@ -664,8 +664,8 @@ void WindowSessionImpl::NotifyRotationAnimationEnd() uiContent->NotifyRotationAnimationEnd(); } -void WindowSessionImpl::GetTitleButtonVisible(bool isPC, bool &hideMaximizeButton, bool &hideMinimizeButton, - bool &hideSplitButton) +void WindowSessionImpl::GetTitleButtonVisible(bool isPC, bool& hideMaximizeButton, bool& hideMinimizeButton, + bool& hideSplitButton) { if (!isPC) { return; diff --git a/wm/src/zidl/window_stub.cpp b/wm/src/zidl/window_stub.cpp index 5a615c39b1..cea0f87e51 100644 --- a/wm/src/zidl/window_stub.cpp +++ b/wm/src/zidl/window_stub.cpp @@ -27,7 +27,7 @@ namespace { constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "WindowStub"}; } -int WindowStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) +int WindowStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { if (staticDestroyMonitor_.IsDestroyed()) { WLOGFE("Main thread finished, static data has been destroyed"); diff --git a/wm/test/unittest/window_extension_session_impl_test.cpp b/wm/test/unittest/window_extension_session_impl_test.cpp index 8ea2b1e10d..cc64df7509 100644 --- a/wm/test/unittest/window_extension_session_impl_test.cpp +++ b/wm/test/unittest/window_extension_session_impl_test.cpp @@ -368,7 +368,7 @@ HWTEST_F(WindowExtensionSessionImplTest, NotifyTransferComponentData02, Function ASSERT_NE(nullptr, window_->hostSession_); ASSERT_NE(nullptr, window_->property_); window_->property_->SetPersistentId(1); - NotifyTransferComponentDataFunc func = [](const AAFwk::WantParams &wantParams) -> AAFwk::WantParams { + NotifyTransferComponentDataFunc func = [](const AAFwk::WantParams& wantParams) -> AAFwk::WantParams { AAFwk::WantParams retWantParams; return retWantParams; }; @@ -402,7 +402,7 @@ HWTEST_F(WindowExtensionSessionImplTest, NotifyTransferComponentDataSync02, Func ASSERT_NE(nullptr, window_->hostSession_); ASSERT_NE(nullptr, window_->property_); window_->property_->SetPersistentId(1); - NotifyTransferComponentDataForResultFunc func = [](const AAFwk::WantParams &wantParams) -> AAFwk::WantParams { + NotifyTransferComponentDataForResultFunc func = [](const AAFwk::WantParams& wantParams) -> AAFwk::WantParams { AAFwk::WantParams retWantParams; return retWantParams; }; diff --git a/wm/test/unittest/window_session_impl_test2.cpp b/wm/test/unittest/window_session_impl_test2.cpp index 9a62c7bb3c..e0c1db031f 100644 --- a/wm/test/unittest/window_session_impl_test2.cpp +++ b/wm/test/unittest/window_session_impl_test2.cpp @@ -1443,7 +1443,7 @@ HWTEST_F(WindowSessionImplTest2, RegisterSubWindowCloseListeners01, Function | S class MockISubWindowCloseListener : public ISubWindowCloseListener { public: - void OnSubWindowClose(bool &terminateCloseProcess) {} + void OnSubWindowClose(bool& terminateCloseProcess) {} }; window_ = GetTestWindowImpl("RegisterSubWindowCloseListeners01"); ASSERT_NE(window_, nullptr); diff --git a/wmserver/include/window_common_event.h b/wmserver/include/window_common_event.h index 6a16a97e6f..89e7fee8a2 100644 --- a/wmserver/include/window_common_event.h +++ b/wmserver/include/window_common_event.h @@ -35,7 +35,7 @@ public: private: class EventSubscriber : public EventFwk::CommonEventSubscriber { public: - EventSubscriber(const EventFwk::CommonEventSubscribeInfo &subscriberInfo, + EventSubscriber(const EventFwk::CommonEventSubscribeInfo& subscriberInfo, const std::shared_ptr& eventHandler) : EventFwk::CommonEventSubscriber(subscriberInfo), eventHandler_(eventHandler) {}; ~EventSubscriber() = default; diff --git a/wmserver/include/window_manager_service.h b/wmserver/include/window_manager_service.h index 3a7035cce2..6a6bf09ebe 100644 --- a/wmserver/include/window_manager_service.h +++ b/wmserver/include/window_manager_service.h @@ -85,7 +85,7 @@ public: using Task = std::function; void OnStart() override; void OnStop() override; - void OnAddSystemAbility(int32_t systemAbilityId, const std::string &deviceId) override; + void OnAddSystemAbility(int32_t systemAbilityId, const std::string& deviceId) override; int Dump(int fd, const std::vector& args) override; WMError CreateWindow(sptr& window, sptr& property, diff --git a/wmserver/include/window_snapshot/snapshot_stub.h b/wmserver/include/window_snapshot/snapshot_stub.h index 76dc374a21..a22e8fe453 100644 --- a/wmserver/include/window_snapshot/snapshot_stub.h +++ b/wmserver/include/window_snapshot/snapshot_stub.h @@ -27,8 +27,8 @@ class SnapshotStub : public IRemoteStub { public: SnapshotStub() = default; ~SnapshotStub() = default; - virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) override; + virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, + MessageOption& option) override; }; } } diff --git a/wmserver/include/zidl/mock_session_manager_service_stub.h b/wmserver/include/zidl/mock_session_manager_service_stub.h index 35c5c21fa1..a147693de6 100644 --- a/wmserver/include/zidl/mock_session_manager_service_stub.h +++ b/wmserver/include/zidl/mock_session_manager_service_stub.h @@ -25,8 +25,8 @@ class MockSessionManagerServiceStub : public IRemoteStub& windowManagerAgent) = 0; virtual WMError GetVisibilityWindowInfo(std::vector>& infos) { return WMError::WM_OK; }; virtual void GetFocusWindowInfo(FocusChangeInfo& focusInfo) = 0; - virtual WMError CheckWindowId(int32_t windowId, int32_t &pid) = 0; + virtual WMError CheckWindowId(int32_t windowId, int32_t& pid) = 0; virtual WMError GetWindowModeType(WindowModeType& windowModeType) { return WMError::WM_OK; } virtual WMError GetMainWindowInfos(int32_t topNum, std::vector& topNInfo) = 0; virtual WMError GetAllMainWindowInfos(std::vector& infos) = 0; diff --git a/wmserver/include/zidl/window_manager_stub.h b/wmserver/include/zidl/window_manager_stub.h index ca2e6294e4..8480dcd234 100644 --- a/wmserver/include/zidl/window_manager_stub.h +++ b/wmserver/include/zidl/window_manager_stub.h @@ -26,8 +26,8 @@ class WindowManagerStub : public IRemoteStub { public: WindowManagerStub() = default; ~WindowManagerStub() = default; - virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) override; + virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, + MessageOption& option) override; }; } } diff --git a/wmserver/src/window_manager_service.cpp b/wmserver/src/window_manager_service.cpp index 3a498eb424..225b597d8d 100644 --- a/wmserver/src/window_manager_service.cpp +++ b/wmserver/src/window_manager_service.cpp @@ -142,7 +142,7 @@ void WindowManagerService::PostVoidSyncTask(Task task, const std::string& taskNa } } -void WindowManagerService::OnAddSystemAbility(int32_t systemAbilityId, const std::string &deviceId) +void WindowManagerService::OnAddSystemAbility(int32_t systemAbilityId, const std::string& deviceId) { WLOGI("systemAbilityId: %{public}d, start", systemAbilityId); switch (systemAbilityId) { diff --git a/wmserver/src/window_snapshot/snapshot_stub.cpp b/wmserver/src/window_snapshot/snapshot_stub.cpp index 31071598bc..1271af05bb 100644 --- a/wmserver/src/window_snapshot/snapshot_stub.cpp +++ b/wmserver/src/window_snapshot/snapshot_stub.cpp @@ -24,8 +24,8 @@ namespace { constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_DISPLAY, "SnapshotStub"}; } -int32_t SnapshotStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) +int32_t SnapshotStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, + MessageOption& option) { WLOGI("SnapshotStub::OnRemoteRequest code is %{public}u", code); if (data.ReadInterfaceToken() != GetDescriptor()) { diff --git a/wmserver/src/zidl/mock_session_manager_service_stub.cpp b/wmserver/src/zidl/mock_session_manager_service_stub.cpp index 08e6bd515a..2bfc308d5e 100644 --- a/wmserver/src/zidl/mock_session_manager_service_stub.cpp +++ b/wmserver/src/zidl/mock_session_manager_service_stub.cpp @@ -24,8 +24,8 @@ namespace { constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "MockSessionManagerServiceStub"}; } -int32_t MockSessionManagerServiceStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) +int32_t MockSessionManagerServiceStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, + MessageOption& option) { if (data.ReadInterfaceToken() != GetDescriptor()) { WLOGFE("InterfaceToken check failed"); diff --git a/wmserver/src/zidl/window_manager_stub.cpp b/wmserver/src/zidl/window_manager_stub.cpp index 72f4615aea..0a996f6920 100644 --- a/wmserver/src/zidl/window_manager_stub.cpp +++ b/wmserver/src/zidl/window_manager_stub.cpp @@ -29,8 +29,8 @@ namespace { constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "WindowManagerStub"}; } -int32_t WindowManagerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, - MessageOption &option) +int32_t WindowManagerStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, + MessageOption& option) { MemoryGuard cacheGuard; if (data.ReadInterfaceToken() != GetDescriptor()) {