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

Commit 1b79c5c8 authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

Merge "Allow hidden apps to opt-out" into jb-mr2-dev

parents 681b21f3 48b8b8fd
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -513,6 +513,17 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen
                info.activityName = info.appName;
                info.icon = app.loadIcon(pm);
                mVisibleApps.add(info);
            } else {
                try {
                    PackageInfo pi = pm.getPackageInfo(app.packageName, 0);
                    // If it's a system app that requires an account and doesn't see restricted
                    // accounts, mark for removal. It might get shown in the UI if it has an icon
                    // but will still be marked as false and immutable.
                    if (pi.requiredAccountType != null && pi.restrictedAccountType == null) {
                        mSelectedPackages.put(app.packageName, false);
                    }
                } catch (NameNotFoundException re) {
                }
            }
        }