Merge "Optimization: remove duplicated flags computations for getInstalledPackages"