You don't need the request for this and the request isn't available in a regular Java action anyway. You can obtain the user agent from the ISession with the method getUserAgent, so you'd need to do something like:
getContext().getSession().getUserAgent();
You can also find this at https://apidocs.mendix.com/4/runtime/interfacecom11mendix11systemwideinterfaces11core11isession.html#a1ab2dd00b73e044747c429d5afe6b6a4
Thanks, that works fine!