ContactsProvider2 optimization: accumulating setDirty(true) per transaction

Also reducing allocation of StringBuilders.

Stats:

Baseline:
 877 yield points, 97 ms per yp,  objects: 1265 per yp

Optimized:
 877 yield points, 89 ms per yp,  objects: 1256 per yp

Bug: http://b/2148608

Change-Id: Ic3fd7d8fe5c8174a158266d56b8cbf008a073db1
2 files changed