Deduplicate adapter-of-installed-packages code.

Conflicts:

	src/com/android/settings/headsup/HeadsUpSettings.java
	src/com/android/settings/notificationlight/NotificationLightSettings.java
	src/com/android/settings/profiles/AppGroupConfig.java

Change-Id: I454ba79eddaaff86233a2cc341f4c8bebe94729e