summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2018-02-20 19:52:30 +0000
committerCalin Juravle <calin@google.com>2018-02-22 16:53:48 -0800
commit759fbda51ba6f9d0294ba8c459f73a4370567485 (patch)
tree98fb1cbb3eee4324051fd2833e32885100eb003c /core/java/android
parentcfd17093cd9cb092a7c3c31eb8afb7e91525a06c (diff)
Revert "Revert "Log the apk optimization state in the MetricsLogger""
This reverts commit 203a9ab7665787c94f7d0711a1ad172588070aa6. Reason for revert: Fix the original issue. There was a race with the cleanup method which was resetting the app record to null. Test: manual, adb logcat -b events | grep sysui_multi_action repeat steps from bugreport reporting the crash Bug: 73102540 Change-Id: I6d9c6110a9d5dadeb9d4361592711d63563c958a
Diffstat (limited to 'core/java/android')
-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");
+ }
+}