private void addAction(NotificationCompat.Action action) {
        Notification.Action.Builder actionBuilder = new Notification.Action.Builder(
                action.getIcon(), action.getTitle(), action.getActionIntent());
        if (action.getRemoteInputs() != null) {
            for (android.app.RemoteInput remoteInput : RemoteInput.fromCompat(
                    action.getRemoteInputs())) {
                actionBuilder.addRemoteInput(remoteInput);
            }
        }
        Bundle actionExtras;
        if (action.getExtras() != null) {
            actionExtras = new Bundle(action.getExtras());
        } else {
            actionExtras = new Bundle();
        }
        actionExtras.putBoolean(NotificationCompatJellybean.EXTRA_ALLOW_GENERATED_REPLIES,
                action.getAllowGeneratedReplies());
        if (Build.VERSION.SDK_INT >= 24) {
            actionBuilder.setAllowGeneratedReplies(action.getAllowGeneratedReplies());
        }

        actionExtras.putInt(Action.EXTRA_SEMANTIC_ACTION,
                action.getSemanticAction());

        // TODO. Need upgrade apk.
        if (Build.VERSION.SDK_INT >= 28) {
            // actionBuilder.setSemanticAction(action.getSemanticAction());
        }

        actionExtras.putBoolean(Action.EXTRA_SHOWS_USER_INTERFACE,
                action.getShowsUserInterface());
        actionBuilder.addExtras(actionExtras);
        mBuilder.addAction(actionBuilder.build());
    }
Wrapper around {@link Notification.Builder} that works in a backwards compatible way.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/compat/NotificationCompatBuilder.java