Move libartimagevalues from frameworks/native

Bug: 136082807
Test: m otapreopt
Change-Id: Ia051e03b86a5f1cf3863d6f92f16ce3a614cc483
diff --git a/libartimagevalues/Android.bp b/libartimagevalues/Android.bp
new file mode 100644
index 0000000..c47dd72
--- /dev/null
+++ b/libartimagevalues/Android.bp
@@ -0,0 +1,12 @@
+// Inherit image values.
+art_global_defaults {
+    name: "libartimagevalues_defaults",
+}
+
+cc_library_static {
+    name: "libartimagevalues",
+    defaults: ["libartimagevalues_defaults"],
+    srcs: ["art_image_values.cpp"],
+    export_include_dirs: ["."],
+    cflags: ["-Wconversion"],
+}
diff --git a/libartimagevalues/art_image_values.cpp b/libartimagevalues/art_image_values.cpp
new file mode 100644
index 0000000..849e218
--- /dev/null
+++ b/libartimagevalues/art_image_values.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "art_image_values.h"
+
+namespace android {
+namespace art {
+namespace imagevalues {
+
+uint32_t GetImageBaseAddress() {
+    return ART_BASE_ADDRESS;
+}
+int32_t GetImageMinBaseAddressDelta() {
+    return ART_BASE_ADDRESS_MIN_DELTA;
+}
+int32_t GetImageMaxBaseAddressDelta() {
+    return ART_BASE_ADDRESS_MAX_DELTA;
+}
+
+static_assert(ART_BASE_ADDRESS_MIN_DELTA < ART_BASE_ADDRESS_MAX_DELTA, "Inconsistent setup");
+
+}  // namespace imagevalues
+}  // namespace art
+}  // namespace android
diff --git a/libartimagevalues/art_image_values.h b/libartimagevalues/art_image_values.h
new file mode 100644
index 0000000..14e5f75
--- /dev/null
+++ b/libartimagevalues/art_image_values.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_LIBARTIMAGEVALUES_ART_IMAGE_VALUES_H_
+#define ART_LIBARTIMAGEVALUES_ART_IMAGE_VALUES_H_
+
+#include <cstdint>
+
+namespace android {
+namespace art {
+namespace imagevalues {
+
+uint32_t GetImageBaseAddress();
+int32_t GetImageMinBaseAddressDelta();
+int32_t GetImageMaxBaseAddressDelta();
+
+}  // namespace imagevalues
+}  // namespace art
+}  // namespace android
+
+#endif  // ART_LIBARTIMAGEVALUES_ART_IMAGE_VALUES_H_