aboutsummaryrefslogtreecommitdiffstats
path: root/cgeo-calendar/src/cgeo/calendar/Compatibility.java
blob: 8813f4193368863df9d0dc766aa786591ef6d923 (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 sdkVersion = Build.VERSION.SDK_INT;
    private final static boolean isLevel8 = sdkVersion >= 8;
    private final static boolean isLevel14 = sdkVersion >= 14;

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

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

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