Fixed selecting calendars

pull/209/head
M66B 2 years ago
parent 9360763110
commit 8b5fd03117

@ -70,10 +70,11 @@ public class FragmentDialogCalendar extends FragmentDialogBase {
CalendarContract.Calendars.VISIBLE, CalendarContract.Calendars.VISIBLE,
CalendarContract.Calendars.CALENDAR_DISPLAY_NAME CalendarContract.Calendars.CALENDAR_DISPLAY_NAME
}, },
CalendarContract.Calendars.VISIBLE + " = 1 AND " + CalendarContract.Calendars.VISIBLE + " <> 0",
CalendarContract.Calendars.IS_PRIMARY + " = 1",
null, null,
CalendarContract.Calendars.ACCOUNT_NAME)) { CalendarContract.Calendars.ACCOUNT_NAME + "," +
CalendarContract.Calendars.CALENDAR_DISPLAY_NAME
)) {
int colId = cursor.getColumnIndexOrThrow(CalendarContract.Calendars._ID); int colId = cursor.getColumnIndexOrThrow(CalendarContract.Calendars._ID);
int colAccount = cursor.getColumnIndexOrThrow(CalendarContract.Calendars.ACCOUNT_NAME); int colAccount = cursor.getColumnIndexOrThrow(CalendarContract.Calendars.ACCOUNT_NAME);
@ -155,11 +156,11 @@ public class FragmentDialogCalendar extends FragmentDialogBase {
String getTitle() { String getTitle() {
return (this.visible ? "" : "(") + return (this.visible ? "" : "(") +
(TextUtils.isEmpty(this.name) ? "" : this.name + ":") +
(this.account == null ? "-" : this.account) + (this.account == null ? "-" : this.account) +
(BuildConfig.DEBUG && false ? ":" + (this.type == null ? "-" : this.type) : "") + (BuildConfig.DEBUG && false ? ":" + (this.type == null ? "-" : this.type) : "") +
(TextUtils.isEmpty(this.name) ? "" : ":" + this.name) +
(this.visible ? "" : ")") + (this.visible ? "" : ")") +
" " + (this.primary && BuildConfig.DEBUG && false ? "*" : ""); " " + (this.primary ? "*" : "");
} }
} }
} }

@ -3960,8 +3960,7 @@ public class MessageHelper {
try (Cursor cursor = resolver.query(CalendarContract.Calendars.CONTENT_URI, try (Cursor cursor = resolver.query(CalendarContract.Calendars.CONTENT_URI,
new String[]{CalendarContract.Calendars._ID}, new String[]{CalendarContract.Calendars._ID},
CalendarContract.Calendars.VISIBLE + " = 1 AND " + CalendarContract.Calendars.VISIBLE + " <> 0 AND " +
CalendarContract.Calendars.IS_PRIMARY + " = 1 AND " +
CalendarContract.Calendars.ACCOUNT_NAME + " = ?" + CalendarContract.Calendars.ACCOUNT_NAME + " = ?" +
(selectedName == null (selectedName == null
? "" ? ""

Loading…
Cancel
Save