summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorZhi An Ng <zhin@google.com>2018-02-23 21:15:32 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-02-23 21:15:32 +0000
commitc9b2722cb8055e23a2ef903fe29244498a4b4255 (patch)
tree4224062e6dc45a94ee2c6d31ba318f53d8ca9ff9 /core/java
parent147c44d9782c6149a88cda3117d593a459546fea (diff)
parent759fbda51ba6f9d0294ba8c459f73a4370567485 (diff)
Merge "Revert "Revert "Log the apk optimization state in the MetricsLogger"""
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/content/pm/dex/ArtManagerInternal.java34
-rw-r--r--core/java/android/content/pm/dex/PackageOptimizationInfo.java47
2 files changed, 81 insertions, 0 deletions
diff --git a/core/java/android/content/pm/dex/ArtManagerInternal.java b/core/java/android/content/pm/dex/ArtManagerInternal.java
new file mode 100644
index 000000000000..62ab9e02f858
--- /dev/null
+++ b/core/java/android/content/pm/dex/ArtManagerInternal.java
@@ -0,0 +1,34 @@
+/**
+ * Copyright 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.
+ */
+
+package android.content.pm.dex;
+
+import android.content.pm.ApplicationInfo;
+
+/**
+ * Art manager local system service interface.
+ *
+ * @hide Only for use within the system server.
+ */
+public abstract class ArtManagerInternal {
+
+ /**
+ * Return optimization information about the application {@code info} when
+ * in executes using the specified {@code abi}.
+ */
+ public abstract PackageOptimizationInfo getPackageOptimizationInfo(
+ ApplicationInfo info, String abi);
+}
diff --git a/core/java/android/content/pm/dex/PackageOptimizationInfo.java b/core/java/android/content/pm/dex/PackageOptimizationInfo.java
new file mode 100644
index 000000000000..b65045794d35
--- /dev/null
+++ b/core/java/android/content/pm/dex/PackageOptimizationInfo.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright 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.
+ */
+
+package android.content.pm.dex;
+
+/**
+ * Encapsulates information about the optimizations performed on a package.
+ *
+ * @hide
+ */
+public class PackageOptimizationInfo {
+ private final String mCompilationFilter;
+ private final String mCompilationReason;
+
+ public PackageOptimizationInfo(String compilerFilter, String compilationReason) {
+ this.mCompilationReason = compilationReason;
+ this.mCompilationFilter = compilerFilter;
+ }
+
+ public String getCompilationReason() {
+ return mCompilationReason;
+ }
+
+ public String getCompilationFilter() {
+ return mCompilationFilter;
+ }
+
+ /**
+ * Create a default optimization info object for the case when we have no information.
+ */
+ public static PackageOptimizationInfo createWithNoInfo() {
+ return new PackageOptimizationInfo("no-info", "no-info");
+ }
+}