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

Commit eab0b82f authored by Nancy Chen's avatar Nancy Chen
Browse files

Add CompatUtils class for compat common to Dialer and Contacts.

So far, we're just adding a method to determine whether the version is
multi-SIM compatible or not.

Bug: 25776171
Change-Id: If1edda1a157f35bf74dddbef8b9aaa49538c606f
parent 20fb6787
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -27,4 +27,15 @@ public final class CompatUtils {
        return SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M)
                >= Build.VERSION_CODES.M;
    }

    /**
     * Determines if this version is compatible with multi-SIM and the phone account APIs.
     * Can also force the version to be lower through SdkVersionOverride.
     *
     * @return {@code true} if multi-SIM capability is available, {@code false} otherwise.
     */
    public static boolean isMSIMCompatible() {
        return SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.LOLLIPOP)
                >= Build.VERSION_CODES.LOLLIPOP_MR1;
    }
}