From d59c0a5cda377c5f6f9f966dc618c4ae49d1e466 Mon Sep 17 00:00:00 2001 From: lvyuanyuan Date: Tue, 25 Apr 2023 12:41:48 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lvyuanyuan Change-Id: I2390f375371bc2e44ad36edc8fd256acd0fdb17f --- .../include/dk_container.h | 5 +-- .../include/dk_database.h | 4 +-- .../include/dk_record_field.h | 7 +++-- .../cloud_adapter_example/include/drive_kit.h | 9 +++--- .../src/dk_container.cpp | 4 +-- .../cloud_adapter_example/src/dk_database.cpp | 2 +- .../cloud_adapter_example/src/drive_kit.cpp | 4 +-- .../include/cloud_sync_manager_impl.h | 2 +- .../include/cloud_sync_service_proxy.h | 3 +- .../i_cloud_sync_callback.h | 3 +- .../include/ipc/cloud_daemon.h | 5 +-- .../src/fuse_manager/fuse_manager.cpp | 27 ++++++++-------- .../cloudfiledaemon/src/ipc/cloud_daemon.cpp | 5 +-- .../include/data_sync/data_syncer.h | 12 +++---- .../gallery_data_sync/album_data_handler.h | 2 +- .../gallery_data_sync/file_data_handler.h | 2 +- .../gallery_data_sync/gallery_data_syncer.h | 3 +- .../include/data_sync/rdb_data_handler.h | 6 ++-- .../include/data_sync/sdk_helper.h | 4 +-- .../cloudsyncservice/include/data_sync/task.h | 9 +++--- .../include/ipc/cloud_sync_callback_manager.h | 3 +- .../include/ipc/cloud_sync_callback_proxy.h | 4 +-- .../include/ipc/cloud_sync_service.h | 6 ++-- .../include/ipc/cloud_sync_service_stub.h | 3 +- .../src/data_sync/data_syncer.cpp | 4 +-- .../src/data_sync/sdk_helper.cpp | 3 +- .../src/data_sync/sync_state_manager.cpp | 4 ++- .../cloudsyncservice/src/data_sync/task.cpp | 4 +-- .../src/ipc/cloud_sync_service.cpp | 3 +- .../src/sync_rule/battery_status.cpp | 1 - .../src/sync_rule/network_status.cpp | 5 ++- .../include/device/device_manager_agent.h | 5 +-- .../include/ipc/daemon.h | 7 +++-- .../include/ipc/daemon_stub.h | 3 +- .../include/mountpoint/mount_point.h | 3 +- .../include/network/devsl_dispatcher.h | 1 + .../include/network/softbus/softbus_agent.h | 1 + .../src/device/device_manager_agent.cpp | 5 +-- .../distributedfiledaemon/src/ipc/daemon.cpp | 2 +- .../src/multiuser/os_account_observer.cpp | 1 + .../src/network/devsl_dispatcher.cpp | 3 +- .../src/network/kernel_talker.cpp | 4 ++- .../src/network/softbus/softbus_agent.cpp | 5 +-- .../src/network/softbus/softbus_session.cpp | 1 + .../softbus/softbus_session_dispatcher.cpp | 3 +- .../device/device_manager_agent_test.cpp | 1 + .../multiuser/os_account_observer_test.cpp | 3 +- .../network/devsl_dispatcher_test.cpp | 1 + .../unittest/network/kernel_talker_test.cpp | 1 + .../unittest/network/session_pool_test.cpp | 3 +- .../unittest/network/softbus_agent_test.cpp | 1 + .../softbus_session_dispatcher_test.cpp | 1 + .../unittest/network/softbus_session_test.cpp | 1 + .../ipc/cloud_sync_service_proxy_mock.cpp | 5 +-- .../distributedfiledaemon_service_test.cpp | 10 +++--- .../cloud_sync_callback_client_test.cpp | 6 ++-- .../cloud_sync_callback_stub_test.cpp | 8 ++--- .../cloud_sync_manager_impl_test.cpp | 17 +++++----- .../cloud_sync_service_proxy_test.cpp | 3 +- .../include/i_cloud_sync_service_mock.h | 11 +++---- .../include/service_callback_mock.h | 31 +++++++++---------- .../ipc/cloudsync_callback_manager_test.cpp | 6 ++-- .../ipc/cloudsync_callback_proxy_test.cpp | 3 +- utils/dentry/src/meta_file.cpp | 7 +++-- utils/preference/src/cloud_pref_impl.cpp | 2 ++ utils/system/include/dfsu_singleton.h | 1 + utils/system/include/dfsu_thread.h | 1 + utils/system/include/utils_directory.h | 2 +- utils/system/src/dfsu_access_token_helper.cpp | 6 ++-- utils/system/src/utils_directory.cpp | 2 +- 70 files changed, 189 insertions(+), 146 deletions(-) diff --git a/adapter/cloud_adapter_example/include/dk_container.h b/adapter/cloud_adapter_example/include/dk_container.h index db03af05f..2f4d0d86b 100644 --- a/adapter/cloud_adapter_example/include/dk_container.h +++ b/adapter/cloud_adapter_example/include/dk_container.h @@ -16,13 +16,14 @@ #ifndef DRIVE_KIT_CONTAINER_H #define DRIVE_KIT_CONTAINER_H +#include +#include + #include "dk_cloud_callback.h" #include "dk_context.h" #include "dk_database.h" #include "dk_error.h" #include "dk_result.h" -#include -#include namespace DriveKit { using DKSubscriptionId = std::string; diff --git a/adapter/cloud_adapter_example/include/dk_database.h b/adapter/cloud_adapter_example/include/dk_database.h index 79ab1b418..91e9e4a08 100644 --- a/adapter/cloud_adapter_example/include/dk_database.h +++ b/adapter/cloud_adapter_example/include/dk_database.h @@ -221,9 +221,9 @@ public: NewAssetReadSession(DKRecordType recordType, DKRecordId recordId, DKFieldKey assetKey, DKAssetPath assetPath); protected: - void Init(); + void Init(); private: DKContainerName containerName_; }; } // namespace DriveKit -#endif +#endif \ No newline at end of file diff --git a/adapter/cloud_adapter_example/include/dk_record_field.h b/adapter/cloud_adapter_example/include/dk_record_field.h index 13aa883a3..bb245f81d 100644 --- a/adapter/cloud_adapter_example/include/dk_record_field.h +++ b/adapter/cloud_adapter_example/include/dk_record_field.h @@ -15,14 +15,15 @@ #ifndef DRIVE_KIT_RECORD_FIELD_H #define DRIVE_KIT_RECORD_FIELD_H -#include "dk_asset.h" -#include "dk_error.h" -#include "dk_reference.h" #include #include #include #include +#include "dk_asset.h" +#include "dk_error.h" +#include "dk_reference.h" + namespace DriveKit { enum class DKRecordFieldType { FIELD_TYPE_NULL = 0, diff --git a/adapter/cloud_adapter_example/include/drive_kit.h b/adapter/cloud_adapter_example/include/drive_kit.h index ba3538623..65b87522a 100644 --- a/adapter/cloud_adapter_example/include/drive_kit.h +++ b/adapter/cloud_adapter_example/include/drive_kit.h @@ -15,16 +15,17 @@ #ifndef DRIVE_KIT_H #define DRIVE_KIT_H -#include "dk_cloud_callback.h" -#include "dk_container.h" -#include "dk_error.h" -#include "dk_record.h" #include #include #include #include #include +#include "dk_cloud_callback.h" +#include "dk_container.h" +#include "dk_error.h" +#include "dk_record.h" + namespace DriveKit { using DKAppId = std::string; using DKDatabaseName = std::string; diff --git a/adapter/cloud_adapter_example/src/dk_container.cpp b/adapter/cloud_adapter_example/src/dk_container.cpp index 7327c277c..b6f2e32e8 100644 --- a/adapter/cloud_adapter_example/src/dk_container.cpp +++ b/adapter/cloud_adapter_example/src/dk_container.cpp @@ -13,11 +13,11 @@ * limitations under the License. */ +#include "dk_container.h" + #include #include -#include "dk_container.h" - namespace DriveKit { std::shared_ptr DKContainer::GetPrivateDatabase() diff --git a/adapter/cloud_adapter_example/src/dk_database.cpp b/adapter/cloud_adapter_example/src/dk_database.cpp index 4c3c96be4..c1e77dca1 100644 --- a/adapter/cloud_adapter_example/src/dk_database.cpp +++ b/adapter/cloud_adapter_example/src/dk_database.cpp @@ -12,13 +12,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "dk_database.h" #include #include #include #include "dk_context.h" -#include "dk_database.h" namespace DriveKit { DKLocalErrorCode DKDatabase::SaveRecords(std::shared_ptr context, diff --git a/adapter/cloud_adapter_example/src/drive_kit.cpp b/adapter/cloud_adapter_example/src/drive_kit.cpp index c4a4bd37d..ad0bd65e9 100644 --- a/adapter/cloud_adapter_example/src/drive_kit.cpp +++ b/adapter/cloud_adapter_example/src/drive_kit.cpp @@ -77,7 +77,7 @@ DKError DriveKitNative::GetCloudUserInfo(DKUserInfo &userInfo) } DKError DriveKitNative::GetCloudAppInfo(const std::vector &bundleNames, - std::map &appInfos) + std::map &appInfos) { DKAppInfo appInfo; appInfo.defaultContainer.containerName = "defaultContainer"; @@ -88,7 +88,7 @@ DKError DriveKitNative::GetCloudAppInfo(const std::vector &bund } DKError DriveKitNative::GetCloudAppSwitches(const std::vector &bundleNames, - std::map &appSwitchs) + std::map &appSwitchs) { return DKError(); } diff --git a/frameworks/native/cloudsync_kit_inner/include/cloud_sync_manager_impl.h b/frameworks/native/cloudsync_kit_inner/include/cloud_sync_manager_impl.h index 71e701751..efc267275 100644 --- a/frameworks/native/cloudsync_kit_inner/include/cloud_sync_manager_impl.h +++ b/frameworks/native/cloudsync_kit_inner/include/cloud_sync_manager_impl.h @@ -18,9 +18,9 @@ #include +#include "cloud_sync_callback_client.h" #include "cloud_sync_manager.h" #include "svc_death_recipient.h" -#include "cloud_sync_callback_client.h" namespace OHOS::FileManagement::CloudSync { class CloudSyncManagerImpl final : public CloudSyncManager { diff --git a/frameworks/native/cloudsync_kit_inner/include/cloud_sync_service_proxy.h b/frameworks/native/cloudsync_kit_inner/include/cloud_sync_service_proxy.h index 4efc46478..90a19c95d 100644 --- a/frameworks/native/cloudsync_kit_inner/include/cloud_sync_service_proxy.h +++ b/frameworks/native/cloudsync_kit_inner/include/cloud_sync_service_proxy.h @@ -16,10 +16,11 @@ #ifndef OHOS_FILEMGMT_CLOUD_SYNC_SERVICE_PROXY_H #define OHOS_FILEMGMT_CLOUD_SYNC_SERVICE_PROXY_H -#include "i_cloud_sync_service.h" #include "iremote_proxy.h" #include "system_ability_load_callback_stub.h" +#include "i_cloud_sync_service.h" + namespace OHOS::FileManagement::CloudSync { class CloudSyncServiceProxy : public IRemoteProxy { public: diff --git a/interfaces/inner_api/native/cloudsync_kit_inner/i_cloud_sync_callback.h b/interfaces/inner_api/native/cloudsync_kit_inner/i_cloud_sync_callback.h index b6d987366..27078e30c 100644 --- a/interfaces/inner_api/native/cloudsync_kit_inner/i_cloud_sync_callback.h +++ b/interfaces/inner_api/native/cloudsync_kit_inner/i_cloud_sync_callback.h @@ -16,9 +16,10 @@ #ifndef OHOS_FILEMGMT_I_CLOUD_SYNC_CALLBACK_H #define OHOS_FILEMGMT_I_CLOUD_SYNC_CALLBACK_H -#include "cloud_sync_callback.h" #include "iremote_broker.h" +#include "cloud_sync_callback.h" + namespace OHOS::FileManagement::CloudSync { class ICloudSyncCallback : public CloudSyncCallback, public IRemoteBroker { public: diff --git a/services/cloudfiledaemon/include/ipc/cloud_daemon.h b/services/cloudfiledaemon/include/ipc/cloud_daemon.h index c470cbc09..e07dabd86 100644 --- a/services/cloudfiledaemon/include/ipc/cloud_daemon.h +++ b/services/cloudfiledaemon/include/ipc/cloud_daemon.h @@ -20,13 +20,14 @@ #include #include -#include "cloud_daemon_stub.h" -#include "i_cloud_daemon.h" #include "iremote_stub.h" #include "nocopyable.h" #include "refbase.h" #include "system_ability.h" +#include "cloud_daemon_stub.h" +#include "i_cloud_daemon.h" + namespace OHOS { namespace FileManagement { namespace CloudFile { diff --git a/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp b/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp index 3ade1be17..e968dea9b 100644 --- a/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp +++ b/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp @@ -17,27 +17,26 @@ #include "fuse_manager/fuse_manager.h" -#include -#include -#include /* for fuse_cmdline_opts */ - -#include -#include +#include #include +#include #include -#include -#include -#include - -#include -#include #include #include #include -#include +#include +#include +#include #include #include -#include +#include +#include +#include +#include + +#include +#include +#include /* for fuse_cmdline_opts */ #include "utils_log.h" namespace OHOS { diff --git a/services/cloudfiledaemon/src/ipc/cloud_daemon.cpp b/services/cloudfiledaemon/src/ipc/cloud_daemon.cpp index a8edaa1e0..f48f07224 100644 --- a/services/cloudfiledaemon/src/ipc/cloud_daemon.cpp +++ b/services/cloudfiledaemon/src/ipc/cloud_daemon.cpp @@ -21,8 +21,9 @@ #include "iremote_object.h" #include "system_ability_definition.h" -#include "fuse_manager/fuse_manager.h" + #include "dfs_error.h" +#include "fuse_manager/fuse_manager.h" #include "utils_log.h" namespace OHOS { @@ -80,7 +81,7 @@ int32_t CloudDaemon::StartFuse(int32_t devFd, const string &path) std::thread([fusePtr{fuseMgr}, dev{devFd}, mnt{path}]() { int32_t ret = fusePtr->StartFuse(dev, mnt); LOGI("start fuse result %d", ret); - }).detach(); + }).detach(); return E_OK; } } // namespace CloudFile diff --git a/services/cloudsyncservice/include/data_sync/data_syncer.h b/services/cloudsyncservice/include/data_sync/data_syncer.h index 2190e4067..10f95c7cc 100644 --- a/services/cloudsyncservice/include/data_sync/data_syncer.h +++ b/services/cloudsyncservice/include/data_sync/data_syncer.h @@ -16,17 +16,17 @@ #ifndef OHOS_CLOUD_SYNC_SERVICE_DATA_SYNCER_H #define OHOS_CLOUD_SYNC_SERVICE_DATA_SYNCER_H -#include -#include #include #include +#include +#include -#include "sdk_helper.h" -#include "data_handler.h" -#include "task.h" +#include "cloud_pref_impl.h" #include "cloud_sync_constants.h" +#include "data_handler.h" #include "data_sync/sync_state_manager.h" -#include "cloud_pref_impl.h" +#include "sdk_helper.h" +#include "task.h" namespace OHOS { namespace FileManagement { diff --git a/services/cloudsyncservice/include/data_sync/gallery_data_sync/album_data_handler.h b/services/cloudsyncservice/include/data_sync/gallery_data_sync/album_data_handler.h index 15a08f48b..4a2ae37fa 100644 --- a/services/cloudsyncservice/include/data_sync/gallery_data_sync/album_data_handler.h +++ b/services/cloudsyncservice/include/data_sync/gallery_data_sync/album_data_handler.h @@ -16,8 +16,8 @@ #ifndef OHOS_CLOUD_SYNC_SERVICE_ALBUM_DATA_HANDLER_H #define OHOS_CLOUD_SYNC_SERVICE_ALBUM_DATA_HANDLER_H -#include "rdb_data_handler.h" #include "data_convertor.h" +#include "rdb_data_handler.h" namespace OHOS { namespace FileManagement { diff --git a/services/cloudsyncservice/include/data_sync/gallery_data_sync/file_data_handler.h b/services/cloudsyncservice/include/data_sync/gallery_data_sync/file_data_handler.h index fc75327fe..a2c16439e 100644 --- a/services/cloudsyncservice/include/data_sync/gallery_data_sync/file_data_handler.h +++ b/services/cloudsyncservice/include/data_sync/gallery_data_sync/file_data_handler.h @@ -16,8 +16,8 @@ #ifndef OHOS_CLOUD_SYNC_SERVICE_FILE_DATA_HANDLER_H #define OHOS_CLOUD_SYNC_SERVICE_FILE_DATA_HANDLER_H -#include "rdb_data_handler.h" #include "data_convertor.h" +#include "rdb_data_handler.h" namespace OHOS { namespace FileManagement { diff --git a/services/cloudsyncservice/include/data_sync/gallery_data_sync/gallery_data_syncer.h b/services/cloudsyncservice/include/data_sync/gallery_data_sync/gallery_data_syncer.h index 9d0ed715c..d87fed752 100644 --- a/services/cloudsyncservice/include/data_sync/gallery_data_sync/gallery_data_syncer.h +++ b/services/cloudsyncservice/include/data_sync/gallery_data_sync/gallery_data_syncer.h @@ -16,10 +16,9 @@ #ifndef GALLERY_DATA_SYNCER_H #define GALLERY_DATA_SYNCER_H -#include "data_syncer.h" - #include "functional" +#include "data_syncer.h" #include "file_data_handler.h" namespace OHOS { diff --git a/services/cloudsyncservice/include/data_sync/rdb_data_handler.h b/services/cloudsyncservice/include/data_sync/rdb_data_handler.h index 721e9b39a..28bfed348 100644 --- a/services/cloudsyncservice/include/data_sync/rdb_data_handler.h +++ b/services/cloudsyncservice/include/data_sync/rdb_data_handler.h @@ -18,8 +18,8 @@ #include "abs_rdb_predicates.h" #include "rdb_helper.h" -#include "values_bucket.h" #include "result_set.h" +#include "values_bucket.h" #include "data_handler.h" @@ -41,8 +41,8 @@ protected: const std::vector &whereArgs = std::vector()); virtual int32_t Delete(int &deletedRows, const std::string &whereClause = "", const std::vector &whereArgs = std::vector()); - virtual std::unique_ptr Query( - const NativeRdb::AbsRdbPredicates &predicates, const std::vector &columns); + virtual std::unique_ptr Query(const NativeRdb::AbsRdbPredicates &predicates, + const std::vector &columns); private: std::shared_ptr rdb_; diff --git a/services/cloudsyncservice/include/data_sync/sdk_helper.h b/services/cloudsyncservice/include/data_sync/sdk_helper.h index 70ed15c1f..8513add6d 100644 --- a/services/cloudsyncservice/include/data_sync/sdk_helper.h +++ b/services/cloudsyncservice/include/data_sync/sdk_helper.h @@ -16,11 +16,11 @@ #ifndef OHOS_CLOUD_SYNC_SERVICE_SDK_HELPER_H #define OHOS_CLOUD_SYNC_SERVICE_SDK_HELPER_H -#include #include +#include -#include "drive_kit.h" #include "dk_database.h" +#include "drive_kit.h" namespace OHOS { namespace FileManagement { diff --git a/services/cloudsyncservice/include/data_sync/task.h b/services/cloudsyncservice/include/data_sync/task.h index 1c3eedf72..7ca66c5cf 100644 --- a/services/cloudsyncservice/include/data_sync/task.h +++ b/services/cloudsyncservice/include/data_sync/task.h @@ -16,24 +16,23 @@ #ifndef OHOS_CLOUD_SYNC_SERVICE_TASK_H #define OHOS_CLOUD_SYNC_SERVICE_TASK_H -#include +#include #include #include #include -#include +#include #include "thread_pool.h" -#include "sdk_helper.h" #include "data_handler.h" +#include "sdk_helper.h" namespace OHOS { namespace FileManagement { namespace CloudSync { class TaskContext : public DriveKit::DKContext { public: - TaskContext(std::shared_ptr handler) : handler_(handler) - {} + TaskContext(std::shared_ptr handler) : handler_(handler) {} std::shared_ptr GetHandler() { diff --git a/services/cloudsyncservice/include/ipc/cloud_sync_callback_manager.h b/services/cloudsyncservice/include/ipc/cloud_sync_callback_manager.h index d9f9e5909..db103085e 100644 --- a/services/cloudsyncservice/include/ipc/cloud_sync_callback_manager.h +++ b/services/cloudsyncservice/include/ipc/cloud_sync_callback_manager.h @@ -16,8 +16,9 @@ #ifndef OHOS_FILEMGMT_CLOUD_SYNC_CALLBACK_MANAGER_H #define OHOS_FILEMGMT_CLOUD_SYNC_CALLBACK_MANAGER_H -#include "i_cloud_sync_callback.h" #include "safe_map.h" + +#include "i_cloud_sync_callback.h" #include "svc_death_recipient.h" namespace OHOS::FileManagement::CloudSync { diff --git a/services/cloudsyncservice/include/ipc/cloud_sync_callback_proxy.h b/services/cloudsyncservice/include/ipc/cloud_sync_callback_proxy.h index a60e251c5..716f0a3e1 100644 --- a/services/cloudsyncservice/include/ipc/cloud_sync_callback_proxy.h +++ b/services/cloudsyncservice/include/ipc/cloud_sync_callback_proxy.h @@ -16,10 +16,10 @@ #ifndef OHOS_FILEMGMT_CLOUD_SYNC_CALLBACK_PROXY_H #define OHOS_FILEMGMT_CLOUD_SYNC_CALLBACK_PROXY_H -#include "i_cloud_sync_callback.h" - #include "iremote_proxy.h" +#include "i_cloud_sync_callback.h" + namespace OHOS::FileManagement::CloudSync { class CloudSyncCallbackProxy : public IRemoteProxy { public: diff --git a/services/cloudsyncservice/include/ipc/cloud_sync_service.h b/services/cloudsyncservice/include/ipc/cloud_sync_service.h index 4b5140a29..2bfdd3c67 100644 --- a/services/cloudsyncservice/include/ipc/cloud_sync_service.h +++ b/services/cloudsyncservice/include/ipc/cloud_sync_service.h @@ -17,10 +17,12 @@ #define OHOS_FILEMGMT_CLOUD_SYNC_SERVICE_H #include -#include "cloud_sync_service_stub.h" -#include "i_cloud_sync_callback.h" + #include "nocopyable.h" #include "system_ability.h" + +#include "cloud_sync_service_stub.h" +#include "i_cloud_sync_callback.h" #include "sync_rule/battery_status_listener.h" namespace OHOS::FileManagement::CloudSync { diff --git a/services/cloudsyncservice/include/ipc/cloud_sync_service_stub.h b/services/cloudsyncservice/include/ipc/cloud_sync_service_stub.h index 426552421..7090bdcde 100644 --- a/services/cloudsyncservice/include/ipc/cloud_sync_service_stub.h +++ b/services/cloudsyncservice/include/ipc/cloud_sync_service_stub.h @@ -17,9 +17,8 @@ #define OHOS_FILEMGMT_CLOUD_SYNC_SERVICE_STUB_H #include - -#include "i_cloud_sync_service.h" #include "iremote_stub.h" +#include "i_cloud_sync_service.h" namespace OHOS::FileManagement::CloudSync { class CloudSyncServiceStub : public IRemoteStub { diff --git a/services/cloudsyncservice/src/data_sync/data_syncer.cpp b/services/cloudsyncservice/src/data_sync/data_syncer.cpp index 832ec70b8..48fd51244 100644 --- a/services/cloudsyncservice/src/data_sync/data_syncer.cpp +++ b/services/cloudsyncservice/src/data_sync/data_syncer.cpp @@ -18,10 +18,10 @@ #include #include "dfs_error.h" -#include "utils_log.h" -#include "sdk_helper.h" #include "ipc/cloud_sync_callback_manager.h" +#include "sdk_helper.h" #include "sync_rule/battery_status.h" +#include "utils_log.h" namespace OHOS { namespace FileManagement { diff --git a/services/cloudsyncservice/src/data_sync/sdk_helper.cpp b/services/cloudsyncservice/src/data_sync/sdk_helper.cpp index 397e87dde..32922b941 100644 --- a/services/cloudsyncservice/src/data_sync/sdk_helper.cpp +++ b/services/cloudsyncservice/src/data_sync/sdk_helper.cpp @@ -98,7 +98,8 @@ int32_t SdkHelper::CreateRecords(shared_ptr context, std::shared_ptr>, const DriveKit::DKError &)> callback) { - auto err = database_->SaveRecords(context, std::move(records), DriveKit::DKSavePolicy::DK_SAVE_IF_UNCHANGED, callback); + auto err = database_->SaveRecords(context, std::move(records), + DriveKit::DKSavePolicy::DK_SAVE_IF_UNCHANGED, callback); if (err != DriveKit::DKLocalErrorCode::NO_ERROR) { LOGE("drivekit save records err %{public}d", err); return E_CLOUD_SDK; diff --git a/services/cloudsyncservice/src/data_sync/sync_state_manager.cpp b/services/cloudsyncservice/src/data_sync/sync_state_manager.cpp index 335434869..af1548b17 100644 --- a/services/cloudsyncservice/src/data_sync/sync_state_manager.cpp +++ b/services/cloudsyncservice/src/data_sync/sync_state_manager.cpp @@ -14,9 +14,11 @@ */ #include "data_sync/sync_state_manager.h" -#include "utils_log.h" + #include +#include "utils_log.h" + namespace OHOS::FileManagement::CloudSync { using namespace std; diff --git a/services/cloudsyncservice/src/data_sync/task.cpp b/services/cloudsyncservice/src/data_sync/task.cpp index f544239e8..5ed996321 100644 --- a/services/cloudsyncservice/src/data_sync/task.cpp +++ b/services/cloudsyncservice/src/data_sync/task.cpp @@ -15,12 +15,12 @@ #include "task.h" -#include #include +#include #include "dfs_error.h" -#include "utils_log.h" #include "sdk_helper.h" +#include "utils_log.h" namespace OHOS { namespace FileManagement { diff --git a/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp b/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp index 83a79026a..ec3e5dbb8 100644 --- a/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp +++ b/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp @@ -16,13 +16,14 @@ #include +#include "system_ability_definition.h" + #include "dfs_error.h" #include "dfsu_access_token_helper.h" #include "ipc/cloud_sync_callback_manager.h" #include "sync_rule/battery_status.h" #include "sync_rule/net_conn_callback_observer.h" #include "sync_rule/network_status.h" -#include "system_ability_definition.h" #include "utils_log.h" namespace OHOS::FileManagement::CloudSync { diff --git a/services/cloudsyncservice/src/sync_rule/battery_status.cpp b/services/cloudsyncservice/src/sync_rule/battery_status.cpp index 667f3275d..116ecb3b6 100644 --- a/services/cloudsyncservice/src/sync_rule/battery_status.cpp +++ b/services/cloudsyncservice/src/sync_rule/battery_status.cpp @@ -20,7 +20,6 @@ constexpr int32_t PAUSE_CAPACITY_LIMIT = 15; constexpr int32_t STOP_CAPACITY_LIMIT = 10; constexpr int32_t DEFAULT_BATTERY_CAPCITY = 100; - void BatteryStatus::SetChargingStatus(bool status) { isCharging_ = status; diff --git a/services/cloudsyncservice/src/sync_rule/network_status.cpp b/services/cloudsyncservice/src/sync_rule/network_status.cpp index 803241afa..d93f5bada 100644 --- a/services/cloudsyncservice/src/sync_rule/network_status.cpp +++ b/services/cloudsyncservice/src/sync_rule/network_status.cpp @@ -14,11 +14,14 @@ */ #include "sync_rule/network_status.h" + #include #include -#include "dfs_error.h" + #include "net_conn_client.h" #include "parameter.h" + +#include "dfs_error.h" #include "sync_rule/net_conn_callback_observer.h" #include "utils_log.h" diff --git a/services/distributedfiledaemon/include/device/device_manager_agent.h b/services/distributedfiledaemon/include/device/device_manager_agent.h index 50a82e8d7..358951b15 100644 --- a/services/distributedfiledaemon/include/device/device_manager_agent.h +++ b/services/distributedfiledaemon/include/device/device_manager_agent.h @@ -22,14 +22,15 @@ #include #include "device_auth.h" -#include "device_info.h" #include "device_manager.h" +#include "nlohmann/json.hpp" + +#include "device_info.h" #include "dfsu_actor.h" #include "dfsu_singleton.h" #include "dfsu_startable.h" #include "mountpoint/mount_point.h" #include "network/network_agent_template.h" -#include "nlohmann/json.hpp" namespace OHOS { namespace Storage { diff --git a/services/distributedfiledaemon/include/ipc/daemon.h b/services/distributedfiledaemon/include/ipc/daemon.h index c2983f7b4..12334b0f3 100644 --- a/services/distributedfiledaemon/include/ipc/daemon.h +++ b/services/distributedfiledaemon/include/ipc/daemon.h @@ -20,14 +20,15 @@ #include #include -#include "daemon_stub.h" -#include "i_daemon.h" #include "iremote_stub.h" -#include "multiuser/os_account_observer.h" #include "nocopyable.h" #include "refbase.h" #include "system_ability.h" +#include "daemon_stub.h" +#include "i_daemon.h" +#include "multiuser/os_account_observer.h" + namespace OHOS { namespace Storage { namespace DistributedFile { diff --git a/services/distributedfiledaemon/include/ipc/daemon_stub.h b/services/distributedfiledaemon/include/ipc/daemon_stub.h index dbade18c1..e376f4078 100644 --- a/services/distributedfiledaemon/include/ipc/daemon_stub.h +++ b/services/distributedfiledaemon/include/ipc/daemon_stub.h @@ -17,12 +17,13 @@ #include -#include "i_daemon.h" #include "iremote_stub.h" #include "message_option.h" #include "message_parcel.h" #include "refbase.h" +#include "i_daemon.h" + namespace OHOS { namespace Storage { namespace DistributedFile { diff --git a/services/distributedfiledaemon/include/mountpoint/mount_point.h b/services/distributedfiledaemon/include/mountpoint/mount_point.h index c2a274b88..bfd8e3ced 100644 --- a/services/distributedfiledaemon/include/mountpoint/mount_point.h +++ b/services/distributedfiledaemon/include/mountpoint/mount_point.h @@ -19,9 +19,10 @@ #include #include -#include "dfsu_mount_argument_descriptors.h" #include "nocopyable.h" +#include "dfsu_mount_argument_descriptors.h" + namespace OHOS { namespace Storage { namespace DistributedFile { diff --git a/services/distributedfiledaemon/include/network/devsl_dispatcher.h b/services/distributedfiledaemon/include/network/devsl_dispatcher.h index a78951738..f2856dfb7 100644 --- a/services/distributedfiledaemon/include/network/devsl_dispatcher.h +++ b/services/distributedfiledaemon/include/network/devsl_dispatcher.h @@ -21,6 +21,7 @@ #include #include #include + #include "dev_slinfo_mgr.h" #include "device/device_manager_agent.h" diff --git a/services/distributedfiledaemon/include/network/softbus/softbus_agent.h b/services/distributedfiledaemon/include/network/softbus/softbus_agent.h index 03c7f14ff..fc4a600b9 100644 --- a/services/distributedfiledaemon/include/network/softbus/softbus_agent.h +++ b/services/distributedfiledaemon/include/network/softbus/softbus_agent.h @@ -17,6 +17,7 @@ #define SOFTBUS_AGENT_H #include + #include "network/network_agent_template.h" namespace OHOS { diff --git a/services/distributedfiledaemon/src/device/device_manager_agent.cpp b/services/distributedfiledaemon/src/device/device_manager_agent.cpp index 2947a60ae..d74dfe3f2 100644 --- a/services/distributedfiledaemon/src/device/device_manager_agent.cpp +++ b/services/distributedfiledaemon/src/device/device_manager_agent.cpp @@ -20,13 +20,14 @@ #include #include "device_auth.h" +#include "parameters.h" +#include "softbus_bus_center.h" + #include "dfsu_exception.h" #include "ipc/i_daemon.h" #include "mountpoint/mount_manager.h" #include "network/devsl_dispatcher.h" #include "network/softbus/softbus_agent.h" -#include "parameters.h" -#include "softbus_bus_center.h" #include "utils_log.h" namespace OHOS { diff --git a/services/distributedfiledaemon/src/ipc/daemon.cpp b/services/distributedfiledaemon/src/ipc/daemon.cpp index 29b7db6d4..7b0653a6e 100644 --- a/services/distributedfiledaemon/src/ipc/daemon.cpp +++ b/services/distributedfiledaemon/src/ipc/daemon.cpp @@ -21,8 +21,8 @@ #include "common_event_manager.h" #include "common_event_support.h" #include "iremote_object.h" -#include "mountpoint/mount_manager.h" #include "system_ability_definition.h" +#include "mountpoint/mount_manager.h" #include "utils_log.h" namespace OHOS { diff --git a/services/distributedfiledaemon/src/multiuser/os_account_observer.cpp b/services/distributedfiledaemon/src/multiuser/os_account_observer.cpp index 198d1cd83..71063b17b 100644 --- a/services/distributedfiledaemon/src/multiuser/os_account_observer.cpp +++ b/services/distributedfiledaemon/src/multiuser/os_account_observer.cpp @@ -17,6 +17,7 @@ #include "common_event_manager.h" #include "common_event_support.h" + #include "device/device_manager_agent.h" #include "dfsu_mount_argument_descriptors.h" #include "utils_log.h" diff --git a/services/distributedfiledaemon/src/network/devsl_dispatcher.cpp b/services/distributedfiledaemon/src/network/devsl_dispatcher.cpp index 4e9f1cd26..0d38c12fd 100644 --- a/services/distributedfiledaemon/src/network/devsl_dispatcher.cpp +++ b/services/distributedfiledaemon/src/network/devsl_dispatcher.cpp @@ -16,8 +16,9 @@ #include "network/devsl_dispatcher.h" #include "device_manager.h" -#include "ipc/i_daemon.h" #include "securec.h" + +#include "ipc/i_daemon.h" #include "utils_log.h" namespace OHOS { diff --git a/services/distributedfiledaemon/src/network/kernel_talker.cpp b/services/distributedfiledaemon/src/network/kernel_talker.cpp index 6228e23c8..251dee09a 100644 --- a/services/distributedfiledaemon/src/network/kernel_talker.cpp +++ b/services/distributedfiledaemon/src/network/kernel_talker.cpp @@ -14,9 +14,11 @@ */ #include "network/kernel_talker.h" + +#include "securec.h" + #include "device/device_manager_agent.h" #include "network/devsl_dispatcher.h" -#include "securec.h" #include "utils_log.h" namespace OHOS { diff --git a/services/distributedfiledaemon/src/network/softbus/softbus_agent.cpp b/services/distributedfiledaemon/src/network/softbus/softbus_agent.cpp index efd334bfb..b82a6093d 100644 --- a/services/distributedfiledaemon/src/network/softbus/softbus_agent.cpp +++ b/services/distributedfiledaemon/src/network/softbus/softbus_agent.cpp @@ -17,13 +17,14 @@ #include +#include "ipc_skeleton.h" +#include "session.h" + #include "dfsu_exception.h" #include "ipc/i_daemon.h" -#include "ipc_skeleton.h" #include "network/softbus/softbus_session.h" #include "network/softbus/softbus_session_dispatcher.h" #include "network/softbus/softbus_session_name.h" -#include "session.h" #include "utils_log.h" namespace OHOS { diff --git a/services/distributedfiledaemon/src/network/softbus/softbus_session.cpp b/services/distributedfiledaemon/src/network/softbus/softbus_session.cpp index 3b786bf28..c2cd3adf2 100644 --- a/services/distributedfiledaemon/src/network/softbus/softbus_session.cpp +++ b/services/distributedfiledaemon/src/network/softbus/softbus_session.cpp @@ -17,6 +17,7 @@ #include "dfs_session.h" #include "session.h" + #include "utils_log.h" namespace OHOS { diff --git a/services/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp b/services/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp index c83ce588b..f463eeda7 100644 --- a/services/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp +++ b/services/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp @@ -17,8 +17,9 @@ #include -#include "network/softbus/softbus_agent.h" #include "session.h" + +#include "network/softbus/softbus_agent.h" #include "utils_log.h" namespace OHOS { diff --git a/services/distributedfiledaemon/test/unittest/device/device_manager_agent_test.cpp b/services/distributedfiledaemon/test/unittest/device/device_manager_agent_test.cpp index ec17c0e9f..61851b6bd 100644 --- a/services/distributedfiledaemon/test/unittest/device/device_manager_agent_test.cpp +++ b/services/distributedfiledaemon/test/unittest/device/device_manager_agent_test.cpp @@ -18,6 +18,7 @@ #include #include "gtest/gtest.h" + #include "device/device_manager_agent.h" #include "mountpoint/mount_point.h" diff --git a/services/distributedfiledaemon/test/unittest/multiuser/os_account_observer_test.cpp b/services/distributedfiledaemon/test/unittest/multiuser/os_account_observer_test.cpp index 16612ea68..f22141ad2 100644 --- a/services/distributedfiledaemon/test/unittest/multiuser/os_account_observer_test.cpp +++ b/services/distributedfiledaemon/test/unittest/multiuser/os_account_observer_test.cpp @@ -16,9 +16,10 @@ #include #include -#include "gtest/gtest.h" #include "common_event_manager.h" #include "common_event_support.h" +#include "gtest/gtest.h" + #include "multiuser/os_account_observer.h" #include "utils_log.h" diff --git a/services/distributedfiledaemon/test/unittest/network/devsl_dispatcher_test.cpp b/services/distributedfiledaemon/test/unittest/network/devsl_dispatcher_test.cpp index 7327508eb..4209dffb6 100644 --- a/services/distributedfiledaemon/test/unittest/network/devsl_dispatcher_test.cpp +++ b/services/distributedfiledaemon/test/unittest/network/devsl_dispatcher_test.cpp @@ -17,6 +17,7 @@ #include #include "gtest/gtest.h" + #include "network/devsl_dispatcher.h" #include "network/kernel_talker.h" #include "utils_log.h" diff --git a/services/distributedfiledaemon/test/unittest/network/kernel_talker_test.cpp b/services/distributedfiledaemon/test/unittest/network/kernel_talker_test.cpp index a8672b16a..d7622eb9d 100644 --- a/services/distributedfiledaemon/test/unittest/network/kernel_talker_test.cpp +++ b/services/distributedfiledaemon/test/unittest/network/kernel_talker_test.cpp @@ -17,6 +17,7 @@ #include #include "gtest/gtest.h" + #include "network/kernel_talker.h" #include "network/softbus/softbus_session.h" #include "utils_log.h" diff --git a/services/distributedfiledaemon/test/unittest/network/session_pool_test.cpp b/services/distributedfiledaemon/test/unittest/network/session_pool_test.cpp index 5fea3436e..ef016e265 100644 --- a/services/distributedfiledaemon/test/unittest/network/session_pool_test.cpp +++ b/services/distributedfiledaemon/test/unittest/network/session_pool_test.cpp @@ -17,9 +17,10 @@ #include #include "gtest/gtest.h" + +#include "network/kernel_talker.h" #include "network/session_pool.h" #include "network/softbus/softbus_session.h" -#include "network/kernel_talker.h" #include "utils_log.h" namespace OHOS { diff --git a/services/distributedfiledaemon/test/unittest/network/softbus_agent_test.cpp b/services/distributedfiledaemon/test/unittest/network/softbus_agent_test.cpp index bc5996b26..15bd9379b 100644 --- a/services/distributedfiledaemon/test/unittest/network/softbus_agent_test.cpp +++ b/services/distributedfiledaemon/test/unittest/network/softbus_agent_test.cpp @@ -17,6 +17,7 @@ #include #include "gtest/gtest.h" + #include "network/softbus/softbus_agent.h" #include "network/softbus/softbus_session.h" #include "utils_log.h" diff --git a/services/distributedfiledaemon/test/unittest/network/softbus_session_dispatcher_test.cpp b/services/distributedfiledaemon/test/unittest/network/softbus_session_dispatcher_test.cpp index f5af2a628..29f0e2406 100644 --- a/services/distributedfiledaemon/test/unittest/network/softbus_session_dispatcher_test.cpp +++ b/services/distributedfiledaemon/test/unittest/network/softbus_session_dispatcher_test.cpp @@ -17,6 +17,7 @@ #include #include "gtest/gtest.h" + #include "network/softbus/softbus_agent.h" #include "network/softbus/softbus_session_dispatcher.h" #include "utils_log.h" diff --git a/services/distributedfiledaemon/test/unittest/network/softbus_session_test.cpp b/services/distributedfiledaemon/test/unittest/network/softbus_session_test.cpp index 7cd2509bf..706886f5f 100644 --- a/services/distributedfiledaemon/test/unittest/network/softbus_session_test.cpp +++ b/services/distributedfiledaemon/test/unittest/network/softbus_session_test.cpp @@ -17,6 +17,7 @@ #include #include "gtest/gtest.h" + #include "network/softbus/softbus_session.h" #include "utils_log.h" diff --git a/test/mock/ipc/cloud_sync_service_proxy_mock.cpp b/test/mock/ipc/cloud_sync_service_proxy_mock.cpp index b2279975a..681ba2311 100644 --- a/test/mock/ipc/cloud_sync_service_proxy_mock.cpp +++ b/test/mock/ipc/cloud_sync_service_proxy_mock.cpp @@ -16,10 +16,11 @@ #include -#include "dfs_error.h" #include "iservice_registry.h" -#include "i_cloud_sync_service_mock.h" #include "system_ability_definition.h" + +#include "dfs_error.h" +#include "i_cloud_sync_service_mock.h" #include "utils_log.h" namespace OHOS::FileManagement::CloudSync { diff --git a/test/moduletest/src/distributedfiledaemon_service_test.cpp b/test/moduletest/src/distributedfiledaemon_service_test.cpp index 820ecc3d2..4e0521743 100644 --- a/test/moduletest/src/distributedfiledaemon_service_test.cpp +++ b/test/moduletest/src/distributedfiledaemon_service_test.cpp @@ -12,9 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#include -#include #include #include #include @@ -22,13 +19,17 @@ #include #include +#include "securec.h" +#include +#include + #include "device/device_info.h" #include "device/device_manager_agent.h" #include "mountpoint/mount_point.h" #include "network/kernel_talker.h" #include "network/session_pool.h" #include "network/softbus/softbus_session.h" -#include "securec.h" + #include "utils_directory.h" #include "utils_log.h" @@ -88,7 +89,6 @@ void DistributedFileDaemonServiceTest::TearDown(void) // input testcase teardown step,teardown invoked after each testcases } - /** * @tc.name: mount_test_001 * @tc.desc: Verify the mount/umount function. diff --git a/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_callback_client_test.cpp b/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_callback_client_test.cpp index 5d70bef98..325fa81c8 100644 --- a/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_callback_client_test.cpp +++ b/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_callback_client_test.cpp @@ -13,11 +13,11 @@ * limitations under the License. */ -#include #include +#include -#include "dfs_error.h" #include "cloud_sync_callback_client.h" +#include "dfs_error.h" #include "service_callback_mock.h" namespace OHOS { @@ -90,5 +90,5 @@ HWTEST_F(CloudSyncCallbackTest, OnSyncStateChangedTest, TestSize.Level1) } } // namespace Test -} // namespace FileManagement::CloudSync { +} // namespace FileManagement::CloudSync } // namespace OHOS diff --git a/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_callback_stub_test.cpp b/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_callback_stub_test.cpp index 053f41320..3115d2cca 100644 --- a/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_callback_stub_test.cpp +++ b/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_callback_stub_test.cpp @@ -13,13 +13,13 @@ * limitations under the License. */ -#include #include +#include #include "cloud_sync_callback_stub.h" -#include "service_callback_mock.h" -#include "i_cloud_sync_callback.h" #include "dfs_error.h" +#include "i_cloud_sync_callback.h" +#include "service_callback_mock.h" namespace OHOS { namespace FileManagement::CloudSync { @@ -93,5 +93,5 @@ HWTEST_F(CloudSyncCallbackStubTest, HandleOnSyncStateChangedTest, TestSize.Level } } // namespace Test -} // namespace FileManagement::CloudSync { +} // namespace FileManagement::CloudSync } // namespace OHOS diff --git a/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_manager_impl_test.cpp b/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_manager_impl_test.cpp index 281f937f0..7427052ca 100644 --- a/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_manager_impl_test.cpp +++ b/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_manager_impl_test.cpp @@ -13,14 +13,15 @@ * limitations under the License. */ -#include #include #include "iservice_registry.h" +#include + #include "cloud_sync_manager_impl.h" +#include "dfs_error.h" #include "i_cloud_sync_service_mock.h" #include "service_callback_mock.h" -#include "dfs_error.h" namespace OHOS { namespace FileManagement::CloudSync { @@ -39,7 +40,7 @@ public: void TearDown(); }; -class CloudSyncCallbackDerived : public CloudSyncCallback { +class CloudSyncCallbackDerived : public CloudSyncCallback { public: void OnSyncStateChanged(SyncType type, SyncPromptState state) { @@ -95,14 +96,14 @@ HWTEST_F(CloudSyncManagerTest, StartSyncTest, TestSize.Level1) forceFlag = false; res = g_managePtr_->StartSync(forceFlag, nullptr); EXPECT_NE(res, E_OK); - } catch(...) { + } catch (...) { EXPECT_TRUE(false); GTEST_LOG_(INFO) << " AddCallbackTest FAILED"; } GTEST_LOG_(INFO) << "AddCallbackTest End"; } - - /* + +/* * @tc.name: StopSyncTest * @tc.desc: Verify the StopSync function. * @tc.type: FUNC @@ -114,7 +115,7 @@ HWTEST_F(CloudSyncManagerTest, StopSyncTest, TestSize.Level1) try { int res = g_managePtr_->StopSync(); EXPECT_EQ(res, E_OK); - } catch(...) { + } catch (...) { EXPECT_TRUE(false); GTEST_LOG_(INFO) << " GetCallbackProxy FAILED"; } @@ -122,5 +123,5 @@ HWTEST_F(CloudSyncManagerTest, StopSyncTest, TestSize.Level1) } } // namespace Test -} // namespace FileManagement::CloudSync { +} // namespace FileManagement::CloudSync } // namespace OHOS diff --git a/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_service_proxy_test.cpp b/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_service_proxy_test.cpp index be549e257..6a35b0844 100644 --- a/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_service_proxy_test.cpp +++ b/test/unittests/cloudsync_api/cloudsync_impl/cloud_sync_service_proxy_test.cpp @@ -13,9 +13,10 @@ * limitations under the License. */ -#include #include +#include + #include "cloud_sync_service_proxy.h" #include "service_callback_mock.h" #include "i_cloud_sync_service_mock.h" diff --git a/test/unittests/cloudsync_api/cloudsync_impl/include/i_cloud_sync_service_mock.h b/test/unittests/cloudsync_api/cloudsync_impl/include/i_cloud_sync_service_mock.h index b08259b02..c1c31068d 100644 --- a/test/unittests/cloudsync_api/cloudsync_impl/include/i_cloud_sync_service_mock.h +++ b/test/unittests/cloudsync_api/cloudsync_impl/include/i_cloud_sync_service_mock.h @@ -16,14 +16,13 @@ #ifndef MOCK_I_CLOUD_SYNC_SERVICE_H #define MOCK_I_CLOUD_SYNC_SERVICE_H -#include "i_cloud_sync_service.h" - +#include "iremote_broker.h" #include #include -#include "iremote_broker.h" #include "cloud_sync_constants.h" #include "dfs_error.h" +#include "i_cloud_sync_service.h" namespace OHOS::FileManagement::CloudSync { class CloudSyncServiceMock : public IRemoteStub { @@ -31,9 +30,9 @@ public: int code_; CloudSyncServiceMock() : code_(0) {} virtual ~CloudSyncServiceMock() {} - + MOCK_METHOD4(SendRequest, int(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)); - + int32_t InvokeSendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { code_ = code; @@ -50,7 +49,7 @@ public: { return E_OK; } - + int32_t StopSyncInner() override { return E_OK; diff --git a/test/unittests/cloudsync_api/cloudsync_impl/include/service_callback_mock.h b/test/unittests/cloudsync_api/cloudsync_impl/include/service_callback_mock.h index 33653dca6..4e208380e 100644 --- a/test/unittests/cloudsync_api/cloudsync_impl/include/service_callback_mock.h +++ b/test/unittests/cloudsync_api/cloudsync_impl/include/service_callback_mock.h @@ -1,27 +1,26 @@ /* -* Copyright (c) 2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef MOCK_I_CLOUD_SYNC_CALLBACK_H #define MOCK_I_CLOUD_SYNC_CALLBACK_H - +#include "iremote_stub.h" #include -#include "i_cloud_sync_callback.h" -#include "iremote_stub.h" #include "dfs_error.h" +#include "i_cloud_sync_callback.h" namespace OHOS::FileManagement::CloudSync { diff --git a/test/unittests/cloudsync_sa/ipc/cloudsync_callback_manager_test.cpp b/test/unittests/cloudsync_sa/ipc/cloudsync_callback_manager_test.cpp index 8d1606b25..68daf96fc 100644 --- a/test/unittests/cloudsync_sa/ipc/cloudsync_callback_manager_test.cpp +++ b/test/unittests/cloudsync_sa/ipc/cloudsync_callback_manager_test.cpp @@ -13,14 +13,14 @@ * limitations under the License. */ -#include #include +#include "iservice_registry.h" +#include + #include "cloud_sync_callback_manager.h" #include "cloud_sync_callback_proxy.h" - #include "dfs_error.h" -#include "iservice_registry.h" #include "service_callback_mock.h" namespace OHOS { diff --git a/test/unittests/cloudsync_sa/ipc/cloudsync_callback_proxy_test.cpp b/test/unittests/cloudsync_sa/ipc/cloudsync_callback_proxy_test.cpp index 2f2ecad87..416c8b361 100644 --- a/test/unittests/cloudsync_sa/ipc/cloudsync_callback_proxy_test.cpp +++ b/test/unittests/cloudsync_sa/ipc/cloudsync_callback_proxy_test.cpp @@ -13,9 +13,10 @@ * limitations under the License. */ -#include #include +#include + #include "cloud_sync_callback_proxy.h" #include "dfs_error.h" #include "service_callback_mock.h" diff --git a/utils/dentry/src/meta_file.cpp b/utils/dentry/src/meta_file.cpp index 49e38bfe4..88509a97b 100644 --- a/utils/dentry/src/meta_file.cpp +++ b/utils/dentry/src/meta_file.cpp @@ -18,13 +18,14 @@ #include #include #include +#include -#include "dfs_error.h" #include "directory_ex.h" -#include "file_utils.h" #include "securec.h" #include "string_ex.h" -#include "sys/xattr.h" + +#include "dfs_error.h" +#include "file_utils.h" #include "utils_log.h" namespace OHOS { diff --git a/utils/preference/src/cloud_pref_impl.cpp b/utils/preference/src/cloud_pref_impl.cpp index eaf1ee22c..6e415dc17 100644 --- a/utils/preference/src/cloud_pref_impl.cpp +++ b/utils/preference/src/cloud_pref_impl.cpp @@ -14,8 +14,10 @@ */ #include "cloud_pref_impl.h" + #include #include + #include "utils_log.h" namespace OHOS::FileManagement::CloudSync { diff --git a/utils/system/include/dfsu_singleton.h b/utils/system/include/dfsu_singleton.h index eea5a43c2..f2fa49456 100644 --- a/utils/system/include/dfsu_singleton.h +++ b/utils/system/include/dfsu_singleton.h @@ -19,6 +19,7 @@ #include #include #include + #include "nocopyable.h" namespace OHOS { diff --git a/utils/system/include/dfsu_thread.h b/utils/system/include/dfsu_thread.h index a59e49245..31f55bda1 100644 --- a/utils/system/include/dfsu_thread.h +++ b/utils/system/include/dfsu_thread.h @@ -20,6 +20,7 @@ #include #include #include + #include "utils_log.h" namespace OHOS { diff --git a/utils/system/include/utils_directory.h b/utils/system/include/utils_directory.h index cdd354af4..f4b06b56f 100644 --- a/utils/system/include/utils_directory.h +++ b/utils/system/include/utils_directory.h @@ -16,8 +16,8 @@ #ifndef UTILS_DIRECTORY_H #define UTILS_DIRECTORY_H -#include #include +#include namespace OHOS { namespace Storage { diff --git a/utils/system/src/dfsu_access_token_helper.cpp b/utils/system/src/dfsu_access_token_helper.cpp index 0c1fb9a96..861cbe59a 100644 --- a/utils/system/src/dfsu_access_token_helper.cpp +++ b/utils/system/src/dfsu_access_token_helper.cpp @@ -14,11 +14,13 @@ */ #include "dfsu_access_token_helper.h" -#include "accesstoken_kit.h" + #include "ipc_skeleton.h" #include "tokenid_kit.h" -#include "utils_log.h" + +#include "accesstoken_kit.h" #include "dfs_error.h" +#include "utils_log.h" namespace OHOS::FileManagement { using namespace std; diff --git a/utils/system/src/utils_directory.cpp b/utils/system/src/utils_directory.cpp index 463f13397..aad4b95a4 100644 --- a/utils/system/src/utils_directory.cpp +++ b/utils/system/src/utils_directory.cpp @@ -16,8 +16,8 @@ #include "utils_directory.h" #include -#include #include +#include #include "directory_ex.h" -- Gitee