mirror of
https://gitee.com/openharmony/filemanagement_storage_service
synced 2024-11-23 06:59:59 +00:00
storage_daemon异常crash后进入锁屏
Signed-off-by: renguang1116 <renguang@huawei.com>
This commit is contained in:
parent
74c0ee2a0d
commit
b5582ba38d
@ -58,6 +58,7 @@
|
|||||||
"relational_store",
|
"relational_store",
|
||||||
"safwk",
|
"safwk",
|
||||||
"samgr",
|
"samgr",
|
||||||
|
"screenlock_mgr",
|
||||||
"selinux_adapter",
|
"selinux_adapter",
|
||||||
"os_account",
|
"os_account",
|
||||||
"openssl",
|
"openssl",
|
||||||
|
@ -113,6 +113,11 @@ ohos_shared_library("storage_manager") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (enable_screenlock_manager) {
|
||||||
|
defines += [ "ENABLE_SCREENLOCK_MANAGER" ]
|
||||||
|
external_deps += [ "screenlock_mgr:screenlock_client" ]
|
||||||
|
}
|
||||||
|
|
||||||
subsystem_name = "filemanagement"
|
subsystem_name = "filemanagement"
|
||||||
part_name = "storage_service"
|
part_name = "storage_service"
|
||||||
install_enable = true
|
install_enable = true
|
||||||
|
@ -53,6 +53,11 @@ ohos_unittest("crypto_manager_service_test") {
|
|||||||
"samgr:samgr_proxy",
|
"samgr:samgr_proxy",
|
||||||
"storage_service:storage_manager_sa_proxy",
|
"storage_service:storage_manager_sa_proxy",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (enable_screenlock_manager) {
|
||||||
|
defines += [ "ENABLE_SCREENLOCK_MANAGER" ]
|
||||||
|
external_deps += [ "screenlock_mgr:screenlock_client" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
group("storage_manager_crypto_test") {
|
group("storage_manager_crypto_test") {
|
||||||
|
@ -54,10 +54,16 @@ ohos_unittest("disk_manager_service_test") {
|
|||||||
"common_event_service:cesfwk_innerkits",
|
"common_event_service:cesfwk_innerkits",
|
||||||
"hilog:libhilog",
|
"hilog:libhilog",
|
||||||
"ipc:ipc_single",
|
"ipc:ipc_single",
|
||||||
|
"os_account:os_account_innerkits",
|
||||||
"safwk:system_ability_fwk",
|
"safwk:system_ability_fwk",
|
||||||
"samgr:samgr_proxy",
|
"samgr:samgr_proxy",
|
||||||
"storage_service:storage_manager_sa_proxy",
|
"storage_service:storage_manager_sa_proxy",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (enable_screenlock_manager) {
|
||||||
|
defines += [ "ENABLE_SCREENLOCK_MANAGER" ]
|
||||||
|
external_deps += [ "screenlock_mgr:screenlock_client" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
group("storage_manager_disk_test") {
|
group("storage_manager_disk_test") {
|
||||||
|
@ -69,6 +69,7 @@ public:
|
|||||||
int32_t SetRecoverKey(const std::vector<uint8_t> &key);
|
int32_t SetRecoverKey(const std::vector<uint8_t> &key);
|
||||||
|
|
||||||
int32_t ResetSdProxy();
|
int32_t ResetSdProxy();
|
||||||
|
void ForceLockUserScreen();
|
||||||
|
|
||||||
// app file share api
|
// app file share api
|
||||||
std::vector<int32_t> CreateShareFile(const std::vector<std::string> &uriList, uint32_t tokenId, uint32_t flag);
|
std::vector<int32_t> CreateShareFile(const std::vector<std::string> &uriList, uint32_t tokenId, uint32_t flag);
|
||||||
|
@ -65,10 +65,16 @@ ohos_unittest("storage_manager_proxy_test") {
|
|||||||
"hilog:libhilog",
|
"hilog:libhilog",
|
||||||
"hitrace:hitrace_meter",
|
"hitrace:hitrace_meter",
|
||||||
"ipc:ipc_single",
|
"ipc:ipc_single",
|
||||||
|
"os_account:os_account_innerkits",
|
||||||
"safwk:system_ability_fwk",
|
"safwk:system_ability_fwk",
|
||||||
"samgr:samgr_proxy",
|
"samgr:samgr_proxy",
|
||||||
"storage_service:storage_manager_sa_proxy",
|
"storage_service:storage_manager_sa_proxy",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (enable_screenlock_manager) {
|
||||||
|
defines += [ "ENABLE_SCREENLOCK_MANAGER" ]
|
||||||
|
external_deps += [ "screenlock_mgr:screenlock_client" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ohos_unittest("storage_manager_stub_test") {
|
ohos_unittest("storage_manager_stub_test") {
|
||||||
|
@ -67,12 +67,18 @@ ohos_unittest("storage_total_status_service_test") {
|
|||||||
"hilog:libhilog",
|
"hilog:libhilog",
|
||||||
"hitrace:hitrace_meter",
|
"hitrace:hitrace_meter",
|
||||||
"ipc:ipc_single",
|
"ipc:ipc_single",
|
||||||
|
"os_account:os_account_innerkits",
|
||||||
"relational_store:native_dataability",
|
"relational_store:native_dataability",
|
||||||
"relational_store:native_rdb",
|
"relational_store:native_rdb",
|
||||||
"safwk:system_ability_fwk",
|
"safwk:system_ability_fwk",
|
||||||
"samgr:samgr_proxy",
|
"samgr:samgr_proxy",
|
||||||
"storage_service:storage_manager_sa_proxy",
|
"storage_service:storage_manager_sa_proxy",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (enable_screenlock_manager) {
|
||||||
|
defines += [ "ENABLE_SCREENLOCK_MANAGER" ]
|
||||||
|
external_deps += [ "screenlock_mgr:screenlock_client" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ohos_unittest("volume_storage_status_service_test") {
|
ohos_unittest("volume_storage_status_service_test") {
|
||||||
|
@ -21,6 +21,10 @@
|
|||||||
#include "ipc/istorage_daemon.h"
|
#include "ipc/istorage_daemon.h"
|
||||||
#include "ipc/storage_daemon.h"
|
#include "ipc/storage_daemon.h"
|
||||||
#include "ipc/storage_daemon_proxy.h"
|
#include "ipc/storage_daemon_proxy.h"
|
||||||
|
#include "os_account_manager.h"
|
||||||
|
#ifdef ENABLE_SCREENLOCK_MANAGER
|
||||||
|
#include "screenlock_manager.h"
|
||||||
|
#endif
|
||||||
#include "storage_service_errno.h"
|
#include "storage_service_errno.h"
|
||||||
#include "storage_service_log.h"
|
#include "storage_service_log.h"
|
||||||
|
|
||||||
@ -388,9 +392,35 @@ int32_t StorageDaemonCommunication::ResetSdProxy()
|
|||||||
return E_OK;
|
return E_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StorageDaemonCommunication::ForceLockUserScreen()
|
||||||
|
{
|
||||||
|
LOGI("StorageDaemonCommunication::ForceLockUserScreen, storage_daemon process maybe has died.");
|
||||||
|
#ifdef ENABLE_SCREENLOCK_MANAGER
|
||||||
|
std::vector<int32_t> ids;
|
||||||
|
int32_t ret = AccountSA::OsAccountManager::QueryActiveOsAccountIds(ids);
|
||||||
|
if (ret != ERR_OK || ids.empty()) {
|
||||||
|
LOGE("Query active userid failed, ret = %{public}u", ret);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int reasonFlag = static_cast<int>(ScreenLock::StrongAuthReasonFlags::ACTIVE_REQUEST);
|
||||||
|
ret = ScreenLock::ScreenLockManager::GetInstance()->RequestStrongAuth(reasonFlag, ids[0]);
|
||||||
|
if (ret != ScreenLock::E_SCREENLOCK_OK) {
|
||||||
|
LOGE("Request strong auth by screen lock manager failed.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ret = ScreenLock::ScreenLockManager::GetInstance()->Lock(ids[0]);
|
||||||
|
if (ret != ScreenLock::E_SCREENLOCK_OK) {
|
||||||
|
LOGE("Lock user screen by screen lock manager failed.");
|
||||||
|
}
|
||||||
|
LOGI("Force lock user screen and request strong auth success for userId = %{public}d.", ids[0]);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void SdDeathRecipient::OnRemoteDied(const wptr<IRemoteObject> &remote)
|
void SdDeathRecipient::OnRemoteDied(const wptr<IRemoteObject> &remote)
|
||||||
{
|
{
|
||||||
|
LOGE("StorageDaemonCommunication::OnRemoteDied, storage_daemon process has died.");
|
||||||
DelayedSingleton<StorageDaemonCommunication>::GetInstance()->ResetSdProxy();
|
DelayedSingleton<StorageDaemonCommunication>::GetInstance()->ResetSdProxy();
|
||||||
|
DelayedSingleton<StorageDaemonCommunication>::GetInstance()->ForceLockUserScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<int32_t> StorageDaemonCommunication::CreateShareFile(const std::vector<std::string> &uriList,
|
std::vector<int32_t> StorageDaemonCommunication::CreateShareFile(const std::vector<std::string> &uriList,
|
||||||
|
@ -58,9 +58,15 @@ ohos_unittest("storage_daemon_communication_test") {
|
|||||||
"hilog:libhilog",
|
"hilog:libhilog",
|
||||||
"init:libbegetutil",
|
"init:libbegetutil",
|
||||||
"ipc:ipc_single",
|
"ipc:ipc_single",
|
||||||
|
"os_account:os_account_innerkits",
|
||||||
"safwk:system_ability_fwk",
|
"safwk:system_ability_fwk",
|
||||||
"samgr:samgr_proxy",
|
"samgr:samgr_proxy",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (enable_screenlock_manager) {
|
||||||
|
defines += [ "ENABLE_SCREENLOCK_MANAGER" ]
|
||||||
|
external_deps += [ "screenlock_mgr:screenlock_client" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
group("storage_manager_communication_test") {
|
group("storage_manager_communication_test") {
|
||||||
|
@ -50,9 +50,15 @@ ohos_unittest("multi_user_manager_service_test") {
|
|||||||
"hilog:libhilog",
|
"hilog:libhilog",
|
||||||
"init:libbegetutil",
|
"init:libbegetutil",
|
||||||
"ipc:ipc_single",
|
"ipc:ipc_single",
|
||||||
|
"os_account:os_account_innerkits",
|
||||||
"safwk:system_ability_fwk",
|
"safwk:system_ability_fwk",
|
||||||
"samgr:samgr_proxy",
|
"samgr:samgr_proxy",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (enable_screenlock_manager) {
|
||||||
|
defines += [ "ENABLE_SCREENLOCK_MANAGER" ]
|
||||||
|
external_deps += [ "screenlock_mgr:screenlock_client" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
group("storage_manager_user_test") {
|
group("storage_manager_user_test") {
|
||||||
|
@ -100,10 +100,16 @@ ohos_unittest("volume_manager_service_test") {
|
|||||||
"common_event_service:cesfwk_innerkits",
|
"common_event_service:cesfwk_innerkits",
|
||||||
"hilog:libhilog",
|
"hilog:libhilog",
|
||||||
"ipc:ipc_single",
|
"ipc:ipc_single",
|
||||||
|
"os_account:os_account_innerkits",
|
||||||
"safwk:system_ability_fwk",
|
"safwk:system_ability_fwk",
|
||||||
"samgr:samgr_proxy",
|
"samgr:samgr_proxy",
|
||||||
"storage_service:storage_manager_sa_proxy",
|
"storage_service:storage_manager_sa_proxy",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (enable_screenlock_manager) {
|
||||||
|
defines += [ "ENABLE_SCREENLOCK_MANAGER" ]
|
||||||
|
external_deps += [ "screenlock_mgr:screenlock_client" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
group("storage_manager_volume_test") {
|
group("storage_manager_volume_test") {
|
||||||
|
@ -37,6 +37,12 @@ declare_args() {
|
|||||||
} else {
|
} else {
|
||||||
enable_user_auth_framework = false
|
enable_user_auth_framework = false
|
||||||
}
|
}
|
||||||
|
if (defined(global_parts_info) &&
|
||||||
|
defined(global_parts_info.theme_screenlock_mgr)) {
|
||||||
|
enable_screenlock_manager = true
|
||||||
|
} else {
|
||||||
|
enable_screenlock_manager = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
storage_manager_path =
|
storage_manager_path =
|
||||||
"//foundation/filemanagement/storage_service/services/storage_manager"
|
"//foundation/filemanagement/storage_service/services/storage_manager"
|
||||||
|
@ -48,6 +48,11 @@ ohos_fuzztest("FileSystemCryptoFuzzTest") {
|
|||||||
"samgr:samgr_proxy",
|
"samgr:samgr_proxy",
|
||||||
"storage_service:storage_manager_sa_proxy",
|
"storage_service:storage_manager_sa_proxy",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (enable_screenlock_manager) {
|
||||||
|
defines += [ "ENABLE_SCREENLOCK_MANAGER" ]
|
||||||
|
external_deps += [ "screenlock_mgr:screenlock_client" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
group("fuzztest") {
|
group("fuzztest") {
|
||||||
|
Loading…
Reference in New Issue
Block a user