Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79b87df5 authored by Kristian Monsen's avatar Kristian Monsen Committed by Android (Google) Code Review
Browse files

Merge "Fix for bug 4064291 WebView uses PackageManager#getInstalledApps" into honeycomb-mr1

parents cc08c439 63a1b0ce
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1127,10 +1127,13 @@ public class WebView extends AbsoluteLayout
            protected Set<String> doInBackground(Void... unused) {
                Set<String> installedPackages = new HashSet<String>();
                PackageManager pm = mContext.getPackageManager();
                List<PackageInfo> packages = pm.getInstalledPackages(0);
                for (PackageInfo p : packages) {
                    if (sGoogleApps.contains(p.packageName)) {
                        installedPackages.add(p.packageName);
                for (String name : sGoogleApps) {
                    try {
                        PackageInfo pInfo = pm.getPackageInfo(name,
                                PackageManager.GET_ACTIVITIES | PackageManager.GET_SERVICES);
                        installedPackages.add(name);
                    } catch(PackageManager.NameNotFoundException e) {
                        // package not found
                    }
                }
                return installedPackages;