/** * Persists this folder. We will always perform the proper database operation (e.g. 'save' or * 'update'). As an optimization, if a folder has not been modified, no database operations are * performed. */ void save(Context context) { final Mailbox mailbox = mMailbox; if (!mailbox.isSaved()) { mailbox.save(context); mHash = mailbox.getHashes(); } else { Object[] hash = mailbox.getHashes(); if (!Arrays.equals(mHash, hash)) { mailbox.update(context, mailbox.toContentValues()); mHash = hash; // Save updated hash } } }