- Cursor doubleCheckShare =
- query(db, uri, projectionShare, whereShare, whereArgsShare, null);
- // ugly patch; serious refactorization is needed to reduce work in
- // FileDataStorageManager and bring it to FileContentProvider
- if (doubleCheckShare == null || !doubleCheckShare.moveToFirst()) {
- if (doubleCheckShare != null) {
- doubleCheckShare.close();
- }
- long rowId = db.insert(ProviderTableMeta.OCSHARES_TABLE_NAME, null, values);
- if (rowId >0) {
- insertedShareUri =
- ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_SHARE, rowId);
- } else {
- throw new SQLException("ERROR " + uri);
-
- }
+ long rowId = db.insert(ProviderTableMeta.OCSHARES_TABLE_NAME, null, values);
+ if (rowId >0) {
+ insertedShareUri =
+ ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_SHARE, rowId);