Deduplicate adapter-of-installed-packages code.

Change-Id: I454ba79eddaaff86233a2cc341f4c8bebe94729e
Merge branch 'cm-11.0' of https://github.com/CyanogenMod/android_packages_apps_Settings into android-4.4