Merge "Run restorecon on new profile directories." am: 2705d04f15 am: 903d5086e3

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1523799

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6bc16ddc8ba48a8464a2adf053ebfda32ea9e572
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp
index 6001a58..c55fc6a 100644
--- a/cmds/installd/InstalldNativeService.cpp
+++ b/cmds/installd/InstalldNativeService.cpp
@@ -398,6 +398,10 @@
         PLOG(ERROR) << "Failed to prepare " << profile_dir;
         return false;
     }
+    if (selinux_android_restorecon(profile_dir.c_str(), 0)) {
+        PLOG(ERROR) << "Failed to restorecon " << profile_dir;
+        return false;
+    }
 
     const std::string ref_profile_path =
             create_primary_reference_profile_package_dir_path(packageName);