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++;