Quantcast
Channel: xda-developers - Android Software and Hacking General [Developers Only]
Viewing all articles
Browse latest Browse all 3614

[Q] Have any ideas how to temporarily empty the contacts and call log DBs? $40 Reward

$
0
0
So I'm hacking the AppRadio and one thing it likes to do is copy the entire contacts and call log databases over bluetooth. This can take a while and with the way it is hacked now it is completely unnecessary. What I would like to do is empty the contacts and call logs databases and restore them when that part of the connection process is over. It seems like these things are cached because after renaming the dabases all the contacts are still there. I renamed contacts.db to contacts.bak and the next morning all my contacts were gone. However when I renamed every .db file to .bak all my contacts are still there two days later. Heres what the folder looks like

Code:

contacts2.bak    contacts2.db-wal  profile.db-shm
contacts2.db-shm  profile.bak      profile.db-wal

Even with calling this the contacts are still there:

Code:

getContentResolver().notifyChange(Calls.CONTENT_URI, null);

getContentResolver().notifyChange(Phone.CONTENT_URI, null);

So does anyone have an idea on how would be the best way to do this? I'd also be open to override the bluetooth AT command. The Android source where this happens can be seen here:

http://androidxref.com/source/xref/p...Phonebook.java

I'll Paypal $40 to anyone who can produce code to empty and restore the contacts and call databases. It needs to be able to run in 0-2 seconds because there is a short window of time. It needs to be done between when the radio pairs and when it requests the logs and address book. It can prepare for this in advance and take any amount of time.

Heres basicly the code I'm using now:

Shell
Code:

cd /data/data/com.android.providers.contacts/databases
for file in *.db ; do mv $file `echo $file | sed 's/\\(.*\\.\\)db/\\1bak/'` ; done

Java
Code:

getContentResolver().notifyChange(Calls.CONTENT_URI, null);

getContentResolver().notifyChange(Phone.CONTENT_URI, null);


Viewing all articles
Browse latest Browse all 3614

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>