Dang. Google are notorious for “fixing” things that ain’t broken. The way they’ve been messing up sd card support over and over again, ever since KitKat, is maddening.
Anyway, in this case, it seems they added official support for the Dualshock 4 in Pie, which messed up your bindings. Nevermind that gamepads have already working for many years, let’s fix it anyway! ?
You might want to try different connection methods (i.e. bluetooth / usb). At least on Oreo, I get (slightly) different mappings then.
A possible solution would be a remapping tool, if there’s a working one. You can try GameKeyboard+ by Locnet, but you have to buy it, and it’s rather wonky. Another tool I found via Google is this one here. The website is in German, but Google Translate should do the trick. Liek GameKeyboard+, it’s a keyboard app that needs to be activated in the IME settings of the phone.
It’s from 2013 though, so I’m not sure if it will actually work. Also, even though it looks safe, I would advise a virus scan prior to installing this.