!1482 NotifyMtpMounted,NotifyMtpUnmounted接口新增权限校验

Merge pull request !1482 from 李尚/master
This commit is contained in:
openharmony_ci 2024-11-06 07:43:59 +00:00 committed by Gitee
commit 57a7317cbb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1232,6 +1232,10 @@ int32_t StorageManagerStub::HandleUMountDfsDocs(MessageParcel &data, MessageParc
int32_t StorageManagerStub::HandleNotifyMtpMount(MessageParcel &data, MessageParcel &reply)
{
if (!CheckClientPermission(PERMISSION_STORAGE_MANAGER)) {
return E_PERMISSION_DENIED;
}
std::string id = data.ReadString();
std::string path = data.ReadString();
std::string desc = data.ReadString();
@ -1248,6 +1252,10 @@ int32_t StorageManagerStub::HandleNotifyMtpMount(MessageParcel &data, MessagePar
int32_t StorageManagerStub::HandleNotifyMtpUnmount(MessageParcel &data, MessageParcel &reply)
{
if (!CheckClientPermission(PERMISSION_STORAGE_MANAGER)) {
return E_PERMISSION_DENIED;
}
std::string id = data.ReadString();
std::string path = data.ReadString();
int32_t err = NotifyMtpUnmounted(id, path);