diff --git a/appdata-sandbox.json b/appdata-sandbox.json index 058bad9f29dae8ee418c9de21f1b2332307150e8..99bdca7f738c9aeef17119fa3fbd834877e5b835 100644 --- a/appdata-sandbox.json +++ b/appdata-sandbox.json @@ -208,6 +208,24 @@ } ], "symbol-links" : [] + }], + "com.ohos.UserFile.ExternalFileManager" : [{ + "sandbox-switch": "ON", + "sandbox-root" : "/mnt/sandbox/", + "mount-bind-paths" : [{ + "src-path" : "/data/service/el1/public/storage_daemon/share/public", + "sandbox-path" : "/data/storage/el1/bundle/storage_daemon", + "sandbox-flags" : [ "bind", "rec" ], + "check-action-status": "true" + }, + { + "src-path" : "/mnt/external", + "sandbox-path" : "/mnt/external", + "sandbox-flags" : [ "bind", "rec" ], + "check-action-status": "true" + } + ], + "symbol-links" : [] }] }] } \ No newline at end of file diff --git a/common/appspawn_server.h b/common/appspawn_server.h index ca6646964690f486f3be73f2e0cfc490b7ccadba..97cec808590b5c8b65fb0ccb5e60c84ba4cfc6d6 100644 --- a/common/appspawn_server.h +++ b/common/appspawn_server.h @@ -34,9 +34,10 @@ extern "C" { #define ERR_PIPE_FAIL (-100) #define MAX_LEN_SHORT_NAME 16 #define WAIT_DELAY_US (100 * 1000) // 100ms -#define GID_USER_DATA_RW 1008 -#define GID_FILE_EXTENSION_HAP 1006 +#define GID_FILE_ACCESS 1006 // only used for ExternalFileManager.hap + +#define GID_USER_DATA_RW 1008 typedef struct AppSpawnClient_ { uint32_t id; diff --git a/standard/appspawn_service.c b/standard/appspawn_service.c index aba3e4bdf6ca2658639dfcf5e4f62e8054c81d2f..af1a0a17ce2d218e896fff240baf65c56bc397fc 100644 --- a/standard/appspawn_service.c +++ b/standard/appspawn_service.c @@ -166,10 +166,10 @@ static void ProcessTimer(const TimerHandle taskHandle, void *context) static void HandleSpecial(AppSpawnClientExt *appProperty) { - const char *fileExtensionHapBundleName = "com.ohos.FileExtension.FileExtensionData"; + const char *fileExtensionHapBundleName = "com.ohos.UserFile.ExternalFileManager"; if (strcmp(appProperty->property.bundleName, fileExtensionHapBundleName) == 0) { if (appProperty->property.gidCount < APP_MAX_GIDS) { - appProperty->property.gidTable[appProperty->property.gidCount] = GID_FILE_EXTENSION_HAP; + appProperty->property.gidTable[appProperty->property.gidCount] = GID_FILE_ACCESS; appProperty->property.gidCount++; } }