The goal is both. Obviously they want more marketshare in console business, especially outside US. Every CoD player on Playstation is a potential gp subscriber and would potentially buy games and mtx on Xbox.
This AB aquisition ticks many boxes from console to PC and mobile, even E-Sports. Yes mobile market is huge and important push for Microsoft to bring gp there, but you put too much weight into it while dismissing all other aquisitions Microsoft has recently made to clearly push console sales too.
I don't personally think consoles are going away, afaik it's a growing business still and I can't help you're doing another spin on the "Microsoft is opting out of console business" narrative we kept hearing throughout last gen.
MS has been making the console less relevant for years now. I think they want out of the hardware market, but doing it the Nintendo way. The Switch is practically there for the ones that were playing Nintendo games on console to switch to handheld (that can also work on tv). MS has been propping up their PC presence with gamepass and the xbox app, getting people to switch from buying games on console to play anywhere through gamepass.
True every CoD player on Playstation is a potential GP subscriber, but there are far more people playing mobile games.
Console/PC is the foundation for gamepass, mobile is what will build the sky scraper on top with xCloud and more mobile oriented games.
Once gamepass is available on TV and smartphones, what would the point for MS to keep making boxes?