summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/os/GraphicsEnvironment.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java
index beb9a935a6ee..0f1140efe22b 100644
--- a/core/java/android/os/GraphicsEnvironment.java
+++ b/core/java/android/os/GraphicsEnvironment.java
@@ -479,9 +479,11 @@ public class GraphicsEnvironment {
final List<ResolveInfo> resolveInfos =
pm.queryIntentActivities(intent, PackageManager.MATCH_SYSTEM_ONLY);
- if (resolveInfos.size() != 1) {
- Log.v(TAG, "Invalid number of ANGLE packages. Required: 1, Found: "
- + resolveInfos.size());
+ if (resolveInfos.isEmpty()) {
+ Log.v(TAG, "No ANGLE packages installed.");
+ return "";
+ } else if (resolveInfos.size() > 1) {
+ Log.v(TAG, "Too many ANGLE packages found: " + resolveInfos.size());
if (DEBUG) {
for (ResolveInfo resolveInfo : resolveInfos) {
Log.d(TAG, "Found ANGLE package: " + resolveInfo.activityInfo.packageName);
@@ -491,7 +493,7 @@ public class GraphicsEnvironment {
}
// Must be exactly 1 ANGLE PKG found to get here.
- return resolveInfos.get(0).activityInfo.packageName;
+ return resolveInfos.getFirst().activityInfo.packageName;
}
/**
@@ -580,7 +582,6 @@ public class GraphicsEnvironment {
if (angleInfo == null) {
anglePkgName = getAnglePackageName(packageManager);
if (TextUtils.isEmpty(anglePkgName)) {
- Log.v(TAG, "Failed to find ANGLE package.");
return false;
}