aboutsummaryrefslogtreecommitdiffstats
path: root/cgeo-calendar/src/cgeo/calendar/Compatibility.java
blob: ff14a0f3aa55b7a9a60bbf1c0df4ac8ca776a694 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package cgeo.calendar;

import android.net.Uri;
import android.os.Build;

public final class Compatibility {

    private final static int SDK_VERSION = Build.VERSION.SDK_INT;
    private final static boolean IS_LEVEL_8 = SDK_VERSION >= 8;
    private final static boolean IS_LEVEL_14 = SDK_VERSION >= 14;

    public static Uri getCalendarProviderURI() {
        return Uri.parse(IS_LEVEL_8 ? "content://com.android.calendar/calendars" : "content://calendar/calendars");
    }

    public static Uri getCalendarEventsProviderURI() {
        return Uri.parse(IS_LEVEL_8 ? "content://com.android.calendar/events" : "content://calendar/events");
    }

    public static boolean isLevel14() {
        return IS_LEVEL_14;
    }
}