batch the multiple insertion in one transaction

this will help improve efficieny (1/10 time).
In the long term, we could investigate moving all db function to
handlerthread to unblock main thread.

Bug: 71899210
Bug: 64131637

Test: Manual test
Change-Id: I3534122a799af827a2318d0f835732e21323d143
(cherry picked from commit edc27c8605a2fac8b12836e77e97c9199596b002)
Merged-in: I3534122a799af827a2318d0f835732e21323d143
1 file changed