From 3358d6e124c22075cd84403d9537e602a5ba052d Mon Sep 17 00:00:00 2001 From: Qilong Zhang Date: Wed, 4 May 2022 18:25:33 +0800 Subject: [PATCH] appspwan:add new medialibrary hap Signed-off-by: Qilong Zhang Change-Id: I92e7ee4ced0d7e38468c7c4d279dd49906ad3f6f --- appdata-sandbox.json | 12 ++++++++++++ appdata-sandbox64.json | 14 +++++++++++++- standard/appspawn_service.c | 5 +++-- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/appdata-sandbox.json b/appdata-sandbox.json index dc395aca1..2a00511f5 100644 --- a/appdata-sandbox.json +++ b/appdata-sandbox.json @@ -191,6 +191,18 @@ ], "symbol-links" : [] }], + "com.ohos.medialibrary.medialibrarydata" : [{ + "sandbox-switch": "ON", + "sandbox-root" : "/mnt/sandbox/", + "mount-paths" : [{ + "src-path" : "/storage/media/", + "sandbox-path" : "/storage/media", + "sandbox-flags" : [ "bind", "rec" ], + "check-action-status": "false" + } + ], + "symbol-links" : [] + }], "com.ohos.launcher" : [{ "sandbox-switch": "ON", "sandbox-root" : "/mnt/sandbox/", diff --git a/appdata-sandbox64.json b/appdata-sandbox64.json index f212270d2..f2e76ab8e 100644 --- a/appdata-sandbox64.json +++ b/appdata-sandbox64.json @@ -196,6 +196,18 @@ ], "symbol-links" : [] }], + "com.ohos.medialibrary.medialibrarydata" : [{ + "sandbox-switch": "ON", + "sandbox-root" : "/mnt/sandbox/", + "mount-paths" : [{ + "src-path" : "/storage/media/", + "sandbox-path" : "/storage/media", + "sandbox-flags" : [ "bind", "rec" ], + "check-action-status": "false" + } + ], + "symbol-links" : [] + }], "com.ohos.launcher" : [{ "sandbox-switch": "ON", "sandbox-root" : "/mnt/sandbox/", @@ -246,4 +258,4 @@ "symbol-links" : [] }] }] -} \ No newline at end of file +} diff --git a/standard/appspawn_service.c b/standard/appspawn_service.c index b142802d2..570d3d9a8 100644 --- a/standard/appspawn_service.c +++ b/standard/appspawn_service.c @@ -206,10 +206,11 @@ static void HandleSpecial(AppSpawnClientExt *appProperty) // special handle bundle name medialibrary and scanner const char *specialBundleNames[] = { "com.ohos.medialibrary.MediaLibraryDataA", - "com.ohos.medialibrary.MediaScannerAbilityA" + "com.ohos.medialibrary.MediaScannerAbilityA", + "com.ohos.medialibrary.medialibrarydata" }; for (size_t i = 0; i < sizeof(specialBundleNames) / sizeof(specialBundleNames[0]); i++) { - if (strcmp(appProperty->property.processName, specialBundleNames[i]) == 0) { + if (strcmp(appProperty->property.bundleName, specialBundleNames[i]) == 0) { if (appProperty->property.gidCount < APP_MAX_GIDS) { appProperty->property.gidTable[appProperty->property.gidCount] = GID_USER_DATA_RW; appProperty->property.gidCount++;