diff --git a/interfaces/innerkits/storage_manager/native/istorage_manager.h b/interfaces/innerkits/storage_manager/native/istorage_manager.h index 85f155aee9ebc456fd0184cc622889d2f94e7cfb..0d35ab61b247085a7b0d70c16ade77e3e52b2321 100644 --- a/interfaces/innerkits/storage_manager/native/istorage_manager.h +++ b/interfaces/innerkits/storage_manager/native/istorage_manager.h @@ -71,6 +71,7 @@ public: virtual int32_t NotifyMtpMounted(const std::string &id, const std::string &path, const std::string &desc, const std::string &uuid) = 0; virtual int32_t NotifyMtpUnmounted(const std::string &id, const std::string &path) = 0; + // fscrypt api virtual int32_t GenerateUserKeys(uint32_t userId, uint32_t flags) = 0; diff --git a/interfaces/innerkits/storage_manager/native/storage_manager_ipc_interface_code.h b/interfaces/innerkits/storage_manager/native/storage_manager_ipc_interface_code.h index 1a25e0396e87d18b635f8d3f5ecb913c8603fda0..3d4abcb918abadc8a70487b2939b92643ebb4602 100644 --- a/interfaces/innerkits/storage_manager/native/storage_manager_ipc_interface_code.h +++ b/interfaces/innerkits/storage_manager/native/storage_manager_ipc_interface_code.h @@ -58,6 +58,7 @@ namespace StorageManager { UMOUNT_DFS_DOCS, GET_ALL_VOLUMES, NOTIFY_DISK_CREATED, + NOTIFY_DISK_DESTROYED, PARTITION, GET_ALL_DISKS, diff --git a/interfaces/innerkits/storage_manager/native/storage_manager_proxy.h b/interfaces/innerkits/storage_manager/native/storage_manager_proxy.h index 70892b8be46e3484d228a3469dea595702331215..e67e7f294dc5b766864100a27e53de71219d4604 100644 --- a/interfaces/innerkits/storage_manager/native/storage_manager_proxy.h +++ b/interfaces/innerkits/storage_manager/native/storage_manager_proxy.h @@ -63,6 +63,7 @@ public: int32_t NotifyMtpMounted(const std::string &id, const std::string &path, const std::string &desc, const std::string &uuid) override; int32_t NotifyMtpUnmounted(const std::string &id, const std::string &path) override; + // fscrypt api int32_t GenerateUserKeys(uint32_t userId, uint32_t flags) override; diff --git a/interfaces/innerkits/storage_manager/native/volume_core.h b/interfaces/innerkits/storage_manager/native/volume_core.h index 71efbcd66fdb318c5a12822a68665f7d90067b11..858fa782c5871408cd3d2577b9511d9c46766228 100644 --- a/interfaces/innerkits/storage_manager/native/volume_core.h +++ b/interfaces/innerkits/storage_manager/native/volume_core.h @@ -31,6 +31,7 @@ enum VolumeState { EJECTING, REMOVED, BAD_REMOVAL + }; class VolumeCore : public Parcelable { public: diff --git a/services/storage_daemon/include/ipc/storage_manager_client.h b/services/storage_daemon/include/ipc/storage_manager_client.h index bf92491d98f2b6603d844d383b925784016ad500..05022d38f941a71a5d4be6d2d1edbf81e3bc7aff 100644 --- a/services/storage_daemon/include/ipc/storage_manager_client.h +++ b/services/storage_daemon/include/ipc/storage_manager_client.h @@ -37,6 +37,7 @@ public: int32_t NotifyMtpMounted(const std::string &id, const std::string &path, const std::string &desc, const std::string &uuid); int32_t NotifyMtpUnmounted(const std::string &id, const std::string &path); + private: DISALLOW_COPY_AND_MOVE(StorageManagerClient); diff --git a/services/storage_daemon/ipc/src/storage_manager_client.cpp b/services/storage_daemon/ipc/src/storage_manager_client.cpp index 4549793ac5a76c42b5684588b4887c6ddc1b2e92..eccce0310909942840333ec2ed43f3d809fd10fb 100644 --- a/services/storage_daemon/ipc/src/storage_manager_client.cpp +++ b/services/storage_daemon/ipc/src/storage_manager_client.cpp @@ -153,5 +153,6 @@ int32_t StorageManagerClient::NotifyMtpUnmounted(const std::string &id, const st } return E_OK; } + } // StorageDaemon } // OHOS diff --git a/services/storage_daemon/mtp/src/mtp_device_monitor.cpp b/services/storage_daemon/mtp/src/mtp_device_monitor.cpp index 337f926db1f3d1e5f33a8afdb13253534d228bb6..1931feb61d6725e9b822a0aa9610ba426f8666ca 100644 --- a/services/storage_daemon/mtp/src/mtp_device_monitor.cpp +++ b/services/storage_daemon/mtp/src/mtp_device_monitor.cpp @@ -24,6 +24,7 @@ #include #include #include + #include "storage_service_errno.h" #include "storage_service_log.h" #include "utils/file_utils.h" diff --git a/services/storage_manager/include/ipc/storage_manager.h b/services/storage_manager/include/ipc/storage_manager.h index 4eccdec870a26b972486bc39c69d18d85fa3efc6..c0e8b7354f309747ab57ed536d2b1c5138e9db98 100644 --- a/services/storage_manager/include/ipc/storage_manager.h +++ b/services/storage_manager/include/ipc/storage_manager.h @@ -73,6 +73,7 @@ public: const std::string &uuid) override; int32_t NotifyMtpUnmounted(const std::string &id, const std::string &path) override; + // fscrypt api int32_t GenerateUserKeys(uint32_t userId, uint32_t flags) override; int32_t DeleteUserKeys(uint32_t userId) override; diff --git a/services/storage_manager/include/ipc/storage_manager_stub.h b/services/storage_manager/include/ipc/storage_manager_stub.h index 083d56260b861aac712992091fb809f4bbb41353..30dd319c800909d7958a5c098611a9b86a17c411 100644 --- a/services/storage_manager/include/ipc/storage_manager_stub.h +++ b/services/storage_manager/include/ipc/storage_manager_stub.h @@ -66,6 +66,7 @@ private: int32_t HandleNotifyMtpMount(MessageParcel &data, MessageParcel &reply); int32_t HandleNotifyMtpUnmount(MessageParcel &data, MessageParcel &reply); + // fscrypt api int32_t HandleGenerateUserKeys(MessageParcel &data, MessageParcel &reply); int32_t HandleDeleteUserKeys(MessageParcel &data, MessageParcel &reply); diff --git a/services/storage_manager/include/mock/storage_manager_proxy_mock.h b/services/storage_manager/include/mock/storage_manager_proxy_mock.h index 1f87aa365deaea04d79b46b3eaeb8c3b1c94646a..f61afeaa463d3b42c6a51aaeccf743ccab465f9e 100644 --- a/services/storage_manager/include/mock/storage_manager_proxy_mock.h +++ b/services/storage_manager/include/mock/storage_manager_proxy_mock.h @@ -93,6 +93,7 @@ public: int32_t NotifyMtpMounted(const std::string &id, const std::string &path, const std::string &desc, const std::string &uuid) override; int32_t NotifyMtpUnmounted(const std::string &id, const std::string &path) override; + // app file share api std::vector CreateShareFile(const std::vector &uriList, diff --git a/services/storage_manager/include/volume/notification.h b/services/storage_manager/include/volume/notification.h index cc56b12634550902cadfd4c95dfede84b50980fb..59badcf7dd4289c91e7bdc22f86caaa3873366e6 100644 --- a/services/storage_manager/include/volume/notification.h +++ b/services/storage_manager/include/volume/notification.h @@ -20,12 +20,14 @@ #include #include "volume_external.h" + namespace OHOS { namespace StorageManager { class Notification final : public NoCopyable { DECLARE_DELAYED_SINGLETON(Notification); public: void NotifyVolumeChange(VolumeState notifyCode, std::shared_ptr volume); + }; } // StorageManager } // OHOS diff --git a/services/storage_manager/include/volume/volume_manager_service.h b/services/storage_manager/include/volume/volume_manager_service.h index 4740fc3a49cd7ccb85301027c21e0f1d20081f1f..5a2f5617bbdc92901701e196cb742476a6f5934c 100644 --- a/services/storage_manager/include/volume/volume_manager_service.h +++ b/services/storage_manager/include/volume/volume_manager_service.h @@ -43,6 +43,7 @@ public: const std::string &uuid); void NotifyMtpUnmounted(const std::string &id, const std::string &path); + private: StorageService::StorageRlMap> volumeMap_; void VolumeStateNotify(VolumeState state, std::shared_ptr volume); diff --git a/services/storage_manager/innerkits_impl/src/storage_manager_proxy.cpp b/services/storage_manager/innerkits_impl/src/storage_manager_proxy.cpp index f71a04e1ff5550aeaa41243d3039587953815c72..08b44ebc4b43e80f7b599ae4069e4aacd530a7fa 100644 --- a/services/storage_manager/innerkits_impl/src/storage_manager_proxy.cpp +++ b/services/storage_manager/innerkits_impl/src/storage_manager_proxy.cpp @@ -1457,6 +1457,7 @@ int32_t StorageManagerProxy::NotifyMtpUnmounted(const std::string &id, const std return reply.ReadInt32(); } + int32_t StorageManagerProxy::SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { diff --git a/services/storage_manager/ipc/src/storage_manager.cpp b/services/storage_manager/ipc/src/storage_manager.cpp index 4acafb499e3d11b75f04b2310e78ac5e18d85739..a9c390a702d61637da607ebab0afcc9cba9bb6ca 100644 --- a/services/storage_manager/ipc/src/storage_manager.cpp +++ b/services/storage_manager/ipc/src/storage_manager.cpp @@ -669,5 +669,6 @@ int32_t StorageManager::NotifyMtpUnmounted(const std::string &id, const std::str #endif return E_OK; } + } } diff --git a/services/storage_manager/ipc/src/storage_manager_stub.cpp b/services/storage_manager/ipc/src/storage_manager_stub.cpp index 50aa2144280478bb3657d6f5f434af59b0f753ae..31c06883410aa5e893bf1e6a7cc760f9e477e4e7 100644 --- a/services/storage_manager/ipc/src/storage_manager_stub.cpp +++ b/services/storage_manager/ipc/src/storage_manager_stub.cpp @@ -192,6 +192,7 @@ StorageManagerStub::StorageManagerStub() &StorageManagerStub::HandleNotifyMtpUnmount; } + int32_t StorageManagerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { diff --git a/services/storage_manager/ipc/test/storage_manager_proxy_test.cpp b/services/storage_manager/ipc/test/storage_manager_proxy_test.cpp index 4f653b4ef9ef45beba448f7372903dcce749e95a..83fc276925bbe666c4979659db8f61f2b6491f4c 100644 --- a/services/storage_manager/ipc/test/storage_manager_proxy_test.cpp +++ b/services/storage_manager/ipc/test/storage_manager_proxy_test.cpp @@ -1707,4 +1707,5 @@ HWTEST_F(StorageManagerProxyTest, Storage_manager_proxy_NotifyMtpUnmounted_0000, EXPECT_EQ(result, E_WRITE_PARCEL_ERR); GTEST_LOG_(INFO) << "StorageManagerProxyTest-end Storage_manager_proxy_NotifyMtpUnmounted_0000"; } + } // namespace \ No newline at end of file diff --git a/services/storage_manager/ipc/test/storage_manager_service_mock.h b/services/storage_manager/ipc/test/storage_manager_service_mock.h index 7f81800a25e1328880467771b3d699488d07435c..834698983eeef53428eaa3aa323ee3be6152e278 100644 --- a/services/storage_manager/ipc/test/storage_manager_service_mock.h +++ b/services/storage_manager/ipc/test/storage_manager_service_mock.h @@ -318,6 +318,7 @@ public: { return E_OK; } + }; } // namespace StorageManager } // namespace OHOS diff --git a/services/storage_manager/ipc/test/storage_manager_stub_mock.h b/services/storage_manager/ipc/test/storage_manager_stub_mock.h index 5e4117fe5fc6a7413d5e21c1d4210c94fd8403fd..952830507d78b77157b11d8ccdf5902f63a05c76 100644 --- a/services/storage_manager/ipc/test/storage_manager_stub_mock.h +++ b/services/storage_manager/ipc/test/storage_manager_stub_mock.h @@ -85,6 +85,7 @@ public: MOCK_METHOD4(NotifyMtpMounted, int32_t(const std::string &, const std::string &, const std::string &, const std::string &)); MOCK_METHOD2(NotifyMtpUnmounted, int32_t(const std::string &, const std::string &)); + }; } // namespace StorageManager } // namespace OHOS diff --git a/services/storage_manager/ipc/test/storage_manager_stub_test.cpp b/services/storage_manager/ipc/test/storage_manager_stub_test.cpp index 30742cb28e105a6eef6d1104c92f07747748f534..a9026d48c4d9ddc67362f4194ec0a4d8ed125b49 100644 --- a/services/storage_manager/ipc/test/storage_manager_stub_test.cpp +++ b/services/storage_manager/ipc/test/storage_manager_stub_test.cpp @@ -217,6 +217,7 @@ HWTEST_F(StorageManagerStubTest, Storage_Manager_StorageManagerStubTest_OnRemote EXPECT_CALL(mock, SetRecoverKey(testing::_)).WillOnce(testing::Return(E_OK)); EXPECT_CALL(mock, NotifyMtpMounted(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(E_OK)); EXPECT_CALL(mock, NotifyMtpUnmounted(testing::_, testing::_)).WillOnce(testing::Return(E_OK)); + for (auto c : g_code) { MessageParcel data; diff --git a/services/storage_manager/mock/storage_manager_proxy_mock.cpp b/services/storage_manager/mock/storage_manager_proxy_mock.cpp index 2b8b31847a70b826426203c5f1bf1bd9125fba8b..21c78f6aa3a5250ee740eabefe2a0cdd22d1ff19 100644 --- a/services/storage_manager/mock/storage_manager_proxy_mock.cpp +++ b/services/storage_manager/mock/storage_manager_proxy_mock.cpp @@ -316,5 +316,6 @@ int32_t StorageManagerProxy::NotifyMtpUnmounted(const std::string &id, const std { return E_OK; } + } // StorageManager } // OHOS diff --git a/services/storage_manager/volume/src/notification.cpp b/services/storage_manager/volume/src/notification.cpp index d11afd7197f7f045822577f839e0a0d6adeb9af6..efc4d6e8670eb7fb1c165ebe58bc320ad4968e28 100644 --- a/services/storage_manager/volume/src/notification.cpp +++ b/services/storage_manager/volume/src/notification.cpp @@ -60,6 +60,7 @@ void Notification::NotifyVolumeChange(VolumeState notifyCode, std::shared_ptr