Skip to content

Commit

Permalink
Fixed attribute hiding and removed database connection close
Browse files Browse the repository at this point in the history
According to this post by a Google engineer (http://groups.google.com/group/android-developers/msg/74ee967b2fcff770), there's nothing wrong with leaving the database connection open
  • Loading branch information
federicoiosue committed Apr 17, 2019
1 parent b296aad commit eb44da1
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {


public Note updateNote(Note note, boolean updateLastModification) {
SQLiteDatabase db = getDatabase(true);
db = getDatabase(true);

String content = note.isLocked()
? Security.encrypt(note.getContent(), prefs.getString(Constants.PREF_PASSWORD, ""))
Expand Down Expand Up @@ -246,7 +246,6 @@ public Note updateNote(Note note, boolean updateLastModification) {

db.setTransactionSuccessful();
db.endTransaction();
db.close();

// Fill the note with correct data before returning it
note.setCreation(note.getCreation() > 0 ? note.getCreation() : values.getAsLong(KEY_CREATION));
Expand Down

0 comments on commit eb44da1

Please sign in to comment.