Create sdk directory for an app only if app consumes sdk

Currently, we create sdk directories for all apps. This means during
boot time, when we create app data directory for system apps, we are now
creating twice the amount of directories as before. This has significant
impact on boot time.

In order to avoid the regression, we are now limiting the creation to
only when app actually consumes an sdk and needs these directories. The
PM will be responsible for passing a flag whenever an app consumes sdk.

Bug: 220095381
Bug: 217543371
Test: atest installd_service_test
Ignore-AOSP-First: Feature is being developed in internal branch
Change-Id: I96c19f43f13080b19a80fcb92b22a4042934b785
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp
index 3d4ba6f..176c84d 100644
--- a/cmds/installd/InstalldNativeService.cpp
+++ b/cmds/installd/InstalldNativeService.cpp
@@ -722,9 +722,7 @@
         }
     }
 
-    // TODO(b/220095381): Due to boot time regression, we have omitted call to
-    // createSdkSandboxDataDirectory from here temporarily (unless it's for testing)
-    if (uuid_ != nullptr && strcmp(uuid_, "TEST") == 0) {
+    if (flags & FLAG_STORAGE_SDK) {
         auto status = createSdkSandboxDataDirectory(uuid, packageName, userId, appId, previousAppId,
                                                     seInfo, flags);
         if (!status.isOk()) {