How to prevent android system from creating folders on internal storage Is it possible to prevent Android from creating additional folders inside /data/app/  

That is, this is the folder where (user-level) apps¹ are installed. So making the whole thing recursively unwriteable will mostly likely break the apps and that's not really what I'd like. (although if you know how to do that I don't mind testing it out) But my primary reason is that I want to prevent any folders from being created there. Specifically the temporary folders that Download Manager is creating there. This is part of my quest to take control over the Download Manager. I can't replace it, so I'm trying different approaches to, well, manage the Manager.

Additional info:
Device is rooted. Storage is internal. Android: v6.0.1, ROM: MIUI 8.5.3.0



¹ meaning the apps (APKs) themselves, I'm not speaking about /data/data/&lt;package_name&gt;/*
The way to prevent creation of new files/folders inside a particular folder is to use the chattr +i command. Using "+i" makes it immutable, preventing changes by anyone, including su, until you do -i .

so doing: chattr +i /data/app

and then running: mkdir /data/app/blah will fail
but mkdir /data/app/com.android.vending-1/blah will work fine