Only enforce profile size limits on target builds

Allow large profiles for non target builds for the case where we are
merging many profiles to generate a boot image profile.

Test: run profman boot image profile on a large set of profiles
Change-Id: Iaacd15d8f0822b419b054b3404dea0d52876abfe
diff --git a/runtime/jit/profile_compilation_info.cc b/runtime/jit/profile_compilation_info.cc
index 147173c..a247b56 100644
--- a/runtime/jit/profile_compilation_info.cc
+++ b/runtime/jit/profile_compilation_info.cc
@@ -336,7 +336,9 @@
         methods_region_size +
         dex_data.bitmap_storage.size();
   }
-  if (required_capacity > kProfileSizeErrorThresholdInBytes) {
+  // Allow large profiles for non target builds for the case where we are merging many profiles
+  // to generate a boot image profile.
+  if (kIsTargetBuild && required_capacity > kProfileSizeErrorThresholdInBytes) {
     LOG(ERROR) << "Profile data size exceeds "
                << std::to_string(kProfileSizeErrorThresholdInBytes)
                << " bytes. Profile will not be written to disk.";
@@ -1030,8 +1032,9 @@
   if (status != kProfileLoadSuccess) {
     return status;
   }
-
-  if (uncompressed_data_size > kProfileSizeErrorThresholdInBytes) {
+  // Allow large profiles for non target builds for the case where we are merging many profiles
+  // to generate a boot image profile.
+  if (kIsTargetBuild && uncompressed_data_size > kProfileSizeErrorThresholdInBytes) {
     LOG(ERROR) << "Profile data size exceeds "
                << std::to_string(kProfileSizeErrorThresholdInBytes)
                << " bytes";