Fix android.os.strictmode.LeakedClosableViolation

Test: Check log.

Change-Id: I488fc6c4288bc3843a2be35a8e2988738441263e
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
This commit is contained in:
Taesu Lee
2020-02-12 09:54:01 +09:00
parent ce85205894
commit 050bc461fc
5 changed files with 57 additions and 27 deletions
@@ -625,10 +625,13 @@ public abstract class MessageNotificationState extends NotificationState {
final Context context = Factory.get().getApplicationContext();
final Uri uri =
MessagingContentProvider.buildConversationParticipantsUri(conversationId);
final Cursor participantsCursor = context.getContentResolver().query(
uri, ParticipantData.ParticipantsQuery.PROJECTION, null, null, null);
final ConversationParticipantsData participantsData = new ConversationParticipantsData();
participantsData.bind(participantsCursor);
try (final Cursor participantsCursor = context.getContentResolver().query(
uri, ParticipantData.ParticipantsQuery.PROJECTION, null, null, null)) {
participantsData.bind(participantsCursor);
}
final Iterator<ParticipantData> iter = participantsData.iterator();
final HashMap<String, Integer> firstNames = new HashMap<String, Integer>();