Bypass the initialization of account attributes on the accounts whose
attribute has been set by App (i.e. has_owner_set_attributes set to 1)

If the App has overridden account attributes before, ContactsProvider
should stick with the App overridden ones and skip initializating of
account attributes.

Bug: 430941895
Flag: android.provider.new_account_attributes_api_enabled
Test: atest AccountAttributeManagerTet

	new file:   src/com/android/providers/contacts/AccountAttributesInfo.java
	modified:   src/com/android/providers/contacts/AccountAttributesManager.java
	modified:   src/com/android/providers/contacts/ContactsDatabaseHelper.java
	modified:   tests/src/com/android/providers/contacts/AccountAttributesManagerTest.java
	modified:   tests/src/com/android/providers/contacts/ContactsDatabaseHelperTest.java

Change-Id: Iefc90399864b805a86efd98dc6742e33ee2b2885
5 files changed
tree: 771a7d66cba4ed8af61ddcffe8e5e292726390eb
  1. qc/
  2. res/
  3. src/
  4. test_common/
  5. tests/
  6. tools/
  7. Android.bp
  8. AndroidManifest.xml
  9. CleanSpec.mk
  10. contactsprovider_flags.aconfig
  11. contactsproviderutils.sh
  12. logging.sh
  13. OWNERS
  14. PREUPLOAD.cfg
  15. proguard.flags
  16. README-tests.md
  17. README.md
  18. TEST_MAPPING
README.md

Debugging Tools

Enable all verbose logs

Running ./logging.sh will enable all verbose logs for the queries in the provider. More details in the script itself.

Querying the database

There are 2 different ways to easily query the database, qc and contatcsproviderutils.sh.

QC usage

qc queries the deivce directly. For usage, append the query in single quotes after the command:

e.g.

qc/qc 'select * from raw_contacts'

or to get all the tables

qc/qc '.tables'

QC support SQLite language, but it might have some limitations working with complex nested queries.

contactsproviderutils.sh usage

This script downlaods the database locally and logins into a local version. It is also possible to push any change back to the device.

  • Add tools to path
    source contactsproviderutils.sh
    
  • Pull contacts2.db and query:
    sqlite3-pull
    
    This will open a sql terminal with rlwrap which can be easily used for queries.
  • Pull contacts2.db and query with a graphical interface:
    sqlitebrowser-pull
    
  • Push local updates to the device:
    sqlite3-push