Add copy system profile functionality

Test: Flash preopted speed-profile maps.
Test: Confirm ref profile exists.
Test: Close maps, recompile with speed-profile, test the profile was used.
Test: Launch maps, do some stuff until cur profile exists.
Test: Re-compile with speed-profile and confirm cur merged over ref correctly.

Bug: 38032017

Change-Id: I19c8009ad61213bdcb52f010329eb459ca82f92b
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp
index 19dfb87..eac2564 100644
--- a/cmds/installd/InstalldNativeService.cpp
+++ b/cmds/installd/InstalldNativeService.cpp
@@ -1779,6 +1779,16 @@
     return ok();
 }
 
+// Copy the contents of a system profile over the data profile.
+binder::Status InstalldNativeService::copySystemProfile(const std::string& systemProfile,
+        int32_t packageUid, const std::string& packageName, bool* _aidl_return) {
+    ENFORCE_UID(AID_SYSTEM);
+    CHECK_ARGUMENT_PACKAGE_NAME(packageName);
+    std::lock_guard<std::recursive_mutex> lock(mLock);
+    *_aidl_return = copy_system_profile(systemProfile, packageUid, packageName);
+    return ok();
+}
+
 // TODO: Consider returning error codes.
 binder::Status InstalldNativeService::mergeProfiles(int32_t uid, const std::string& packageName,
         bool* _aidl_return) {