class TextViewCompat {

    public static void setCustomSelectionActionModeCallback(@NonNull final TextView textView,
                @NonNull final ActionMode.Callback callback) {
        if (Build.VERSION.SDK_INT < 26 || Build.VERSION.SDK_INT > 27) {
            textView.setCustomSelectionActionModeCallback(callback);
            return;
        }

        // A bug in O and O_MR1 causes a number of options for handling the ACTION_PROCESS_TEXT
        // intent after selection to not be displayed in the menu, although they should be.
        // Here we fix this, by removing the menu items created by the framework code, and
        // adding them (and the missing ones) back correctly.
        textView.setCustomSelectionActionModeCallback(new OreoCallback(callback, textView));
    }

    private  TextViewCompat();

}