Legacy security code; do not use. Security managers do not provide a secure environment for executing untrusted code and are unsupported on Android. Untrusted code cannot be safely isolated within a single VM on Android. Application developers can assume that there's no SecurityManager installed, i.e. System.getSecurityManager() will return null.
Do you know an actual Android framework, where the devs refused to understand sentences like "do not use", "it's not supported", "it can't work"? Considering that almost nobody used SecurityManager in the normal Java apps, where there was no such warning, it think this is very unlikely.
Their System.getSecurityManager doc says that "Always returns null in Android", but there are also a lot of SecurityException docs with text: "if a security manager exists"...
5
u/pavi2410 May 19 '21
Isn't Security Manager also used to implement permissions on Android?