use of com.android.launcher3.provider.LauncherDbUtils.SQLiteTransaction in project Neo-Launcher by NeoApplications.
the class LauncherProvider method bulkInsert.
@Override
public int bulkInsert(Uri uri, ContentValues[] values) {
createDbIfNotExists();
SqlArguments args = new SqlArguments(uri);
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
try (SQLiteTransaction t = new SQLiteTransaction(db)) {
int numValues = values.length;
for (int i = 0; i < numValues; i++) {
addModifiedTime(values[i]);
if (dbInsertAndCheck(mOpenHelper, db, args.table, null, values[i]) < 0) {
return 0;
}
}
mOpenHelper.onAddOrDeleteOp(db);
t.commit();
}
notifyListeners();
reloadLauncherIfExternal();
return values.length;
}
Aggregations