History log of /packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
40af6e611d9fe06031ee9748fbcc94a34f9de5da 24-Mar-2017 Ricky Wai <rickywai@google.com> Schedule re-scan contacts directory provider if directory is force updated

Test: CTS should pass as usual, hope it can deflake some directory tests
Bug: 36371719
Change-Id: I477d7f90f48aac90ad4f88471f107a5a4986e7f6
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
fcc2655b0fca7032fcde306660da303c85125218 04-Mar-2017 Makoto Onuki <omakoto@google.com> Rescan all GAL providers when GAL provider packages have...

been added or removed at startup.

Bug 35388445
Test: adb shell am instrument -w com.android.providers.contacts.tests

Change-Id: Ifc8a9498151e5523e3657cd006e7831d68389f67
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
343f231980f4f4035b18e0402cb07d3523de0db4 22-Feb-2017 Makoto Onuki <omakoto@google.com> Some cleanup for CP2

- Get ContactDirectoryManager's debug flag from sys prop.
- Introduce a debug sys prop to all scan directories.
- Some clean up for voicemail provider too
ContentProvider.getCallingPackage() didn't used to exist, so it has
custom code for that. Now we can just use getCallingPackage().

Test: adb shell am instrument -w com.android.providers.contacts.tests
Change-Id: Ic16d598251f4bc0bb84b0b71dac2366f195425fe
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
13c52d12c2af39d7782e5fd75702d5a42b594b6f 29-Apr-2016 Ricky Wai <rickywai@google.com> Move cp2.scanPackagesByUid() to worker thread

So now cp2.scanPackagesByUid() and scanAllPackages will not
run in parallel.

Bug: 28334569
Change-Id: Ie36feb54b13ae80b9cceb4c6dc69365c67db345d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
09a3f70ebd97c739d01393f4b3748b0eaf548f02 16-Jan-2016 Makoto Onuki <omakoto@google.com> Re-scan all directories only after OTAs.

Currently CP2 scans all directory packages every time it starts,
which is a more or less slow operation.

With this change, we only do it only when after OTAs (when the OS
version changes).

Bug 26062101

Change-Id: Ifa3d6c29dacfa01572dfee31581d607f287390f9
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
08fb8384ccb36de3d3d046e287fe5c43c1f85faf 07-May-2015 Zheng Fu <zhengfu@google.com> Notify contact metadata changes to contact metadata authority.

Need to notify metadata changes in the following senario:
1. raw contacts insert/update with column pinned,starred or send_to_voicemail
2. data usage stats update
3. aggregation exception update/insert
4. data delete, or insert/update with is_primary or is_super_primary column

Bug:20893997
Change-Id: I7ca6ae4c1a96baa9bb887ec11869d4194398ae64
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
6522ca932caf4a4921115a2a3d13068c2357084c 19-Feb-2015 Makoto Onuki <omakoto@google.com> Don't use queryContentProviders to avoid "transaction too large" exception

Instead, use getInstalledPackages, which knows how to circumvent the binder
transaction size limit.

Bug 18261831

Change-Id: I2725af045c60a47bfce6eab966a5c745b6c17870
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
38210445730ee04c351c7cc1b3800cfe23e34325 27-Jun-2012 Makoto Onuki <omakoto@google.com> Reorganize import in contacts provider

Change-Id: If3afb134ea36bd93859efcd114885526e1592b91
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
565b62f354d8b6aadc760092a7dbf483f8bbbe17 08-Mar-2012 Makoto Onuki <omakoto@google.com> Use wall time instead of CPU time for performance log

Apparently what currentThreadTimeMillis() returns is the CPU time,
not wall time, which is not really interesting when we measure
performance. Use the actual wall time instead.

Change-Id: Ibe2e385ff1bdeeb1128a584c79925210dde5525a
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
a2d163097ec6630101c701723c170b5974262eb5 22-Feb-2012 Makoto Onuki <omakoto@google.com> Don't remove default directories from directories table

The directories table should always contain the DEFAULT and LOCAL_INVISIBLE
directories. Otherwise search would break.

Also re-create all directoires next time the provider starts as a part of
upgrade.

Details:

ContactDirectoryManager has two public methods to update the table:
scanAllPackages() to scan all directories from all installed packages, and
onPackageChanged() to scan only a specific package.

scanAllPackages() is called when an account is added or removed. It always
rules out the default ones when it deletes rows, so this method shouldn't
possibly remove the default ones.

However, onPackageChanged(), which is called when an app is installed or
uninstalled, doesn't check the given package name. If this method is given
the package name of the contacts provider itself, it *will* remove all the
directories that belong to the contacts provider, which are the default ones,
but doesn't re-create them because these are not exported from the provider
like a normal directory.

With this CL onPackageChanged() now checks if the given package name is
of itself, and will ignore the request if so.

Bug 6005231

Change-Id: Ia19dfb1890160315ef9de8aa0530978e547abf7d
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
9ba8463dd030e5e26a4f99dfe2a6ad52b2410d73 11-Jan-2012 Makoto Onuki <omakoto@google.com> Account refactoring follow-up

- Check if there's really a new or removed account in
updateAccountsInBackground() before doing everything else.
If there's none, we'll skip re-scanning directories too.

- Preheat the account cache when the provider starts.

- Use account_id for the account filter query parameters. The contacts URI
now supports the parameters too.

Change-Id: I12e1116890df4c20b354618acfaee9dc009dc68e
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
ac6f0b8a92fccb3611a7841d0f04e4ac24a58c91 20-Oct-2011 Makoto Onuki <omakoto@google.com> 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
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
43368a3f9e05a979e454e278d6a0e8475f08923d 13-Jul-2011 Dave Santoro <dsantoro@google.com> Provider and DB changes to support data_set field.

The intent of the data set field is to provide a way for multiple
sync adapters from the same account name + type to manage separate
sets of data in the raw_contacts and groups table.

For example, this would allow for Focus groups to be synced in from
Focus via the Google Contacts sync adapter, and for Google+ Circles
to be synced in from the Google+ app, even though both are tied to
the same account name + type.

Bug 5077096

Change-Id: I641c5d233d8d4d70988d209179c4e79bdb9c7ea1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
37f0bdbb0a99b12abcc319f49a2caa5ab648add0 02-Jun-2011 Daisuke Miyakawa <dmiyakawa@google.com> Remove stale rows in directory table.

When upgrading from mr0 to mr2, we encounter some crashes on
email compose. It is because BaseEmailAddressAdapter uses directory
API, and the API has wrong resouce id in it. We need to remove
rows which don't correspond to any directory provider.

Bug: 4479240
Change-Id: Ife87a4a2ccad5d2a784eb5bd6ca56061a22c1787
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
bf732767b4d4d7104e4723bda7d3b0eb0f909997 02-Dec-2010 Dmitri Plotnikov <dplotnikov@google.com> Moving initialization and callbacks to background

Bug: 3228684
Change-Id: I7fab53092dbf55ebb502bc5d4d2012c88842c8b8
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
e0e24418cba10a5184e2966aaa32d5458fa6a387 22-Oct-2010 Dmitri Plotnikov <dplotnikov@google.com> Backing up cached resource IDs with resource names

During an OTA or an adb sync some resource IDs may
change without an android.intent.action.PACKAGE_* broadcast.

We will now verify resource IDs against their names
and if anything does not match, rescan all packages.

Bug: 3117701
Change-Id: I293c5578b7092482e8dd4637554831f3e6f93cc1
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
994c32a995a85937faf59e37a9fc88b526470d7d 19-Oct-2010 Dmitri Plotnikov <dplotnikov@google.com> Including PHOTO_SUPPORT in directory management

Change-Id: I340ade4c173b1d5dd8eb7b0e80f4c4601e654955
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
3d67ff829e8acb0f650f155c3c0d377c0f46507a 23-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding support for PHOTO_URI and PHOTO_THUMBNAIL_URI

Change-Id: I080c3227164eba6804095a4f0cbd82bb5093e161
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
cf832869bcf91b8037d8b7f510a3a213b30764a3 14-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Adding a missing column to projections

Also fixing a couple of broken tests.

Change-Id: I7e2fef3fd421fe0f6a47a39bbb5b44efb9399b69
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
1b2a89588e9593756c2627ce1683539f4ffa1e51 11-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing the rescan of packages for contact directories

Change-Id: Ic2eb69595b0bd439d1cd4a000eb509eee9be06b3
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
afb84050536a4472c13efc0e996d31132d254605 10-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Fixing NPE in ContactsProvider initialization.

Change-Id: I062db8216ab8336ec3a0e6166eef26730c01766f
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
6255d756615cfa89fb3411d1840dbe08e1375ffe 01-Sep-2010 Dmitri Plotnikov <dplotnikov@google.com> Rescanning all packages for directory providers

Now automatically scanning all packages to see
if they come with directory providers whenever
an account is added/changed.

Change-Id: I1ec1851f923aeba47c4c3dc751534c562885f0f0
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java
72e3003a810fb4793a1513d17a40f8ab83d7d0af 05-Aug-2010 Dmitri Plotnikov <dplotnikov@google.com> Introducing ContactDirectoryManager

Changing the contact directory registration protocol.
Now directory providers are mostly passive,
ContactsProvider2 is in control.

Change-Id: I93815f7dc0a30fde35d70c5fd48bb1a924076ff5
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactDirectoryManager.java