From 40a5989d9b8349afa44ee870f2e28673bdecd1eb Mon Sep 17 00:00:00 2001 From: zhangkaixiang Date: Thu, 2 Mar 2023 10:44:51 +0800 Subject: [PATCH] add distributedfiles dir Signed-off-by: zhangkaixiang --- .../innerkits/native/file_share/include/file_share.h | 8 ++++++-- interfaces/innerkits/native/file_share/src/file_share.cpp | 2 +- interfaces/kits/js/@ohos.remotefileshare.d.ts | 4 ++-- test/unittest/file_share_native/file_share_test.cpp | 3 +-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/interfaces/innerkits/native/file_share/include/file_share.h b/interfaces/innerkits/native/file_share/include/file_share.h index 58b386869..b2c8c8d99 100644 --- a/interfaces/innerkits/native/file_share/include/file_share.h +++ b/interfaces/innerkits/native/file_share/include/file_share.h @@ -48,7 +48,9 @@ const vector SANDBOX_PATH = { "/data/storage/el2/database", "/data/storage/el1/base", "/data/storage/ark-cache", - "/data/storage/ark-profile" + "/data/storage/ark-profile", + "/data/storage/el2/distributedfiles", + "/data/storage/el2/auth_groups" }; const vector LOWER_PATH = { @@ -58,7 +60,9 @@ const vector LOWER_PATH = { "/data/app/el2//database/", "/data/app/el1//base/", "/data/local/ark-cache/", - "/data/local/ark-profile//" + "/data/local/ark-profile//", + "/mnt/hmdfs//account/merge_view/data/", + "/mnt/hmdfs//non_account/merge_view/data" }; } diff --git a/interfaces/innerkits/native/file_share/src/file_share.cpp b/interfaces/innerkits/native/file_share/src/file_share.cpp index 15f74aa32..df600bde5 100644 --- a/interfaces/innerkits/native/file_share/src/file_share.cpp +++ b/interfaces/innerkits/native/file_share/src/file_share.cpp @@ -47,7 +47,7 @@ static int32_t GetTargetInfo(int32_t tokenId, string &bundleName, string ¤ int32_t result = Security::AccessToken::AccessTokenKit::GetHapTokenInfo(tokenId, hapInfo); if (result != 0) { LOGE("Failed to get hap token info %{public}d", result); - return result; + return -EINVAL; } bundleName = hapInfo.bundleName; currentUid = to_string(hapInfo.userID); diff --git a/interfaces/kits/js/@ohos.remotefileshare.d.ts b/interfaces/kits/js/@ohos.remotefileshare.d.ts index 40d946ae0..cd1876a9e 100644 --- a/interfaces/kits/js/@ohos.remotefileshare.d.ts +++ b/interfaces/kits/js/@ohos.remotefileshare.d.ts @@ -18,7 +18,7 @@ import {AsyncCallback, Callback} from "./basic"; /** * Provides remote file share APIs * - * @since 8 + * @since 10 * @sysCap N/A * @devices phone, tablet */ @@ -26,7 +26,7 @@ declare namespace Remotefileshare { /** * Create the remote share path of src share file. * - * @since 8 + * @since 10 */ function createSharePath(fd: number, cid: string, callback: AsyncCallback): void; function createSharePath(fd: number, cid: string): Promise; diff --git a/test/unittest/file_share_native/file_share_test.cpp b/test/unittest/file_share_native/file_share_test.cpp index 59fac0e79..da0ed72ed 100644 --- a/test/unittest/file_share_native/file_share_test.cpp +++ b/test/unittest/file_share_native/file_share_test.cpp @@ -31,7 +31,6 @@ namespace { using namespace OHOS::Security::AccessToken; const int E_OK = 0; - const int E_INVALID_ARGUMENT = 12100002; class FileShareTest : public testing::Test { public: @@ -124,7 +123,7 @@ namespace { int32_t flag = 3; int32_t ret = FileShare::CreateShareFile(uri, tokenId, flag); - EXPECT_EQ(ret, E_INVALID_ARGUMENT); + EXPECT_EQ(ret, -EINVAL); GTEST_LOG_(INFO) << "FileShareTest-end File_share_CreateShareFile_0002"; } -- Gitee