@RequiresApi(20)
    static Action getActionCompatFromAction(Notification.Action action) {
        final RemoteInput[] remoteInputs;
        final android.app.RemoteInput[] srcArray = action.getRemoteInputs();
        if (srcArray == null) {
            remoteInputs = null;
        } else {
            remoteInputs = new RemoteInput[srcArray.length];
            for (int i = 0; i < srcArray.length; i++) {
                android.app.RemoteInput src = srcArray[i];
                remoteInputs[i] = new RemoteInput(src.getResultKey(), src.getLabel(),
                        src.getChoices(), src.getAllowFreeFormInput(), src.getExtras(), null);
            }
        }

        final boolean allowGeneratedReplies;
        if (Build.VERSION.SDK_INT >= 24) {
            allowGeneratedReplies = action.getExtras().getBoolean(
                    NotificationCompatJellybean.EXTRA_ALLOW_GENERATED_REPLIES)
                    || action.getAllowGeneratedReplies();
        } else {
            allowGeneratedReplies = action.getExtras().getBoolean(
                    NotificationCompatJellybean.EXTRA_ALLOW_GENERATED_REPLIES);
        }

        final boolean showsUserInterface =
                action.getExtras().getBoolean(Action.EXTRA_SHOWS_USER_INTERFACE, true);

        final @Action.SemanticAction int semanticAction;
        semanticAction = action.getExtras().getInt(
                Action.EXTRA_SEMANTIC_ACTION, Action.SEMANTIC_ACTION_NONE);

        return new Action(action.icon, action.title, action.actionIntent,
                action.getExtras(), remoteInputs, null, allowGeneratedReplies,
                semanticAction, showsUserInterface);
    }
Get an action on this notification in a backwards compatible
manner. Actions were supported from JellyBean (Api level 16) forwards.

@param notification The notification to inspect.
@param actionIndex  The index of the action to retrieve.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/compat/NotificationCompat.java