OSDN Git Service

Merge "Port Ic9d9d65c66325904c95ab3966bdcc16e7668278b to oc-dev" into oc-dev
authorTreeHugger Robot <treehugger-gerrit@google.com>
Thu, 25 May 2017 23:19:51 +0000 (23:19 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Thu, 25 May 2017 23:19:56 +0000 (23:19 +0000)
core/java/com/android/internal/app/ResolverListController.java

index ee5f6fd..5ab17e4 100644 (file)
@@ -99,6 +99,14 @@ public class ResolverListController {
                             | (shouldGetResolvedFilter ? PackageManager.GET_RESOLVED_FILTER : 0)
                             | (shouldGetActivityMetadata ? PackageManager.GET_META_DATA : 0)
                             | PackageManager.MATCH_INSTANT);
+            // Remove any activities that are not exported.
+            int totalSize = infos.size();
+            for (int j = totalSize - 1; j >= 0 ; j--) {
+                ResolveInfo info = infos.get(j);
+                if (info.activityInfo != null && !info.activityInfo.exported) {
+                    infos.remove(j);
+                }
+            }
             if (infos != null) {
                 if (resolvedComponents == null) {
                     resolvedComponents = new ArrayList<>();