Don't use getInstalledPackages().

It's almost same as my previous CL 143783, except this time it uses
pm.queryContentProviders() to enumerate only packages that have a content
provider.

It still uses getPackageInfo(), but only on packages with a directory
provider and there aren't many directory providers around (there are only
two known ones: Exchange and the googlesync), so it should be okay.

(We could get rid of the getPackageInfo() call but that'd be too big a change
for MR1.)

Bug 5422702

Change-Id: I67f51f6a770bf1de6779b366017431c36b63815c
3 files changed