Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b8b07c8 authored by Clara Bayarri's avatar Clara Bayarri
Browse files

Add Build.isAtLeastO

This makes it easier for features to check the build is O or later
without dealing with codenames and then the switch to an api number.

Change-Id: Ica04e0fdf1e68d72f289f5428aaff6c5aff816c9
parent 310ab035
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -840,4 +840,16 @@ public class Build {
            return -1;
        }
    }

    /**
     * Check if the device is running on the Android O release or newer.
     *
     * @return {@code true} if O APIs are available for use
     *
     * @hide
     */
    public static boolean isAtLeastO() {
        return !"REL".equals(VERSION.CODENAME)
                && "O".compareTo(VERSION.CODENAME) <= 0;
    }
}