Merge "Add getPackageStates to replace forAllPackageStates"