mozilla-services/android-sync — comment on commit b22efc7db4e9df28155013643cdde3ecb07a0c82
File: src/main/java/org/mozilla/gecko/sync/repositories/android/AndroidBrowserHistoryDataExtender.java line 135
By rnewman:

> It looks like SQLiteDatabase.update() returns an int for number of affected rows. So why not attempt an update first, if 0 rows are affected, then do an insert? This would save you the fetch at the beginning.

This is exactly how Fennec does this sort of thing. Common pattern.