...this lists all possible languages supported by the device. Instead, I want to acquire only those listed within res/.
That's not really a thing, sorry. Plus, it's not that simple:
You are using libraries, and some of those may have resources with translations whose languages may be a superset of the ones in your own source code
App Bundles will only ship a subset of your own languages to the user
The relationship of what the user has, compared to what is literally in your app module's res/
directory tree, is complex.
Is there a built-in function from the API, should I resort to hard-coding a string-array?
Yes, you should plan on maintaining your own language roster. You may need additional engineering work in the future for this (e.g., for App Bundles).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…