From 08b4e7324f724d762c1bb316b15b305da1fc4636 Mon Sep 17 00:00:00 2001 From: linjun9528 Date: Tue, 17 May 2022 10:53:21 +0800 Subject: [PATCH] add file extension hap gid Signed-off-by: linjun9528 --- common/appspawn_server.h | 2 ++ standard/appspawn_service.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/common/appspawn_server.h b/common/appspawn_server.h index b94c42bf..ca664696 100644 --- a/common/appspawn_server.h +++ b/common/appspawn_server.h @@ -36,6 +36,8 @@ extern "C" { #define WAIT_DELAY_US (100 * 1000) // 100ms #define GID_USER_DATA_RW 1008 +#define GID_FILE_EXTENSION_HAP 1006 + typedef struct AppSpawnClient_ { uint32_t id; int32_t flags; diff --git a/standard/appspawn_service.c b/standard/appspawn_service.c index 6da9f563..aba3e4bd 100644 --- a/standard/appspawn_service.c +++ b/standard/appspawn_service.c @@ -166,6 +166,14 @@ static void ProcessTimer(const TimerHandle taskHandle, void *context) static void HandleSpecial(AppSpawnClientExt *appProperty) { + const char *fileExtensionHapBundleName = "com.ohos.FileExtension.FileExtensionData"; + 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.gidCount++; + } + } + // special handle bundle name medialibrary and scanner const char *specialBundleNames[] = { "com.ohos.medialibrary.MediaLibraryDataA", -- Gitee