SecurityManager
public class SecurityManager
extends Object
java.lang.Object | |
↳ | java.lang.SecurityManager |
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.
Summary
Fields | |
---|---|
protected boolean | inCheck This field was deprecated in API level 15. Use |
Public constructors | |
---|---|
SecurityManager() |
Public methods | |
---|---|
void | checkAccept(String host, int port) |
void | checkAccess(Thread t) |
void | checkAccess(ThreadGroup g) |
void | checkAwtEventQueueAccess() |
void | checkConnect(String host, int port) |
void | checkConnect(String host, int port, Object context) |
void | checkCreateClassLoader() |
void | checkDelete(String file) |
void | checkExec(String cmd) |
void | checkExit(int status) |
void | checkLink(String lib) |
void | checkListen(int port) |
void | checkMemberAccess(Class<?> clazz, int which) This method was deprecated in API level 33. this method is deprecated. |
void | checkMulticast(InetAddress maddr) |
void | checkMulticast(InetAddress maddr, byte ttl) This method was deprecated in API level 15. use |
void | checkPackageAccess(String pkg) |
void | checkPackageDefinition(String pkg) |
void | checkPermission(Permission perm, Object context) |
void | checkPermission(Permission perm) |
void | checkPrintJobAccess() |
void | checkPropertiesAccess() |
void | checkPropertyAccess(String key) |
void | checkRead(FileDescriptor fd) |
void | checkRead(String file) |
void | checkRead(String file, Object context) |
void | checkSecurityAccess(String target) |
void | checkSetFactory() |
void | checkSystemClipboardAccess() |
boolean | checkTopLevelWindow(Object window) This method was deprecated in API level 33. this method is deprecated. |
void | checkWrite(FileDescriptor fd) |
void | checkWrite(String file) |
boolean | getInCheck() This method was deprecated in API level 15. Use |
Object | getSecurityContext() |
ThreadGroup | getThreadGroup() Returns the current thread's thread group. |
Protected methods | |
---|---|
int | classDepth(String name) This method was deprecated in API level 15. Use |
int | classLoaderDepth() This method was deprecated in API level 15. Use |
ClassLoader | currentClassLoader() This method was deprecated in API level 15. Use |
Class<?> | currentLoadedClass() This method was deprecated in API level 15. Use |
Class[] | getClassContext() |
boolean | inClass(String name) This method was deprecated in API level 15. Use |
boolean | inClassLoader() This method was deprecated in API level 15. Use |
Inherited methods | |
---|---|
Fields
inCheck
protected boolean inCheck
This field was deprecated in API level 15.
Use checkPermission(Permission)
instead.
Public constructors
Public methods
checkAccept
public void checkAccept (String host, int port)
Parameters | |
---|---|
host | String |
port | int |
checkConnect
public void checkConnect (String host, int port)
Parameters | |
---|---|
host | String |
port | int |
checkConnect
public void checkConnect (String host, int port, Object context)
Parameters | |
---|---|
host | String |
port | int |
context | Object |
checkMemberAccess
public void checkMemberAccess (Class<?> clazz, int which)
This method was deprecated in API level 33.
this method is deprecated.
Parameters | |
---|---|
clazz | Class |
which | int |
checkMulticast
public void checkMulticast (InetAddress maddr)
Parameters | |
---|---|
maddr | InetAddress |
checkMulticast
public void checkMulticast (InetAddress maddr, byte ttl)
This method was deprecated in API level 15.
use checkMulticast(java.net.InetAddress)
instead.
Parameters | |
---|---|
maddr | InetAddress |
ttl | byte |
checkPackageAccess
public void checkPackageAccess (String pkg)
Parameters | |
---|---|
pkg | String |
checkPackageDefinition
public void checkPackageDefinition (String pkg)
Parameters | |
---|---|
pkg | String |
checkPermission
public void checkPermission (Permission perm, Object context)
Parameters | |
---|---|
perm | Permission |
context | Object |
checkPermission
public void checkPermission (Permission perm)
Parameters | |
---|---|
perm | Permission |
checkPropertyAccess
public void checkPropertyAccess (String key)
Parameters | |
---|---|
key | String |
checkRead
public void checkRead (FileDescriptor fd)
Parameters | |
---|---|
fd | FileDescriptor |
checkRead
public void checkRead (String file, Object context)
Parameters | |
---|---|
file | String |
context | Object |
checkSecurityAccess
public void checkSecurityAccess (String target)
Parameters | |
---|---|
target | String |
checkTopLevelWindow
public boolean checkTopLevelWindow (Object window)
This method was deprecated in API level 33.
this method is deprecated.
Parameters | |
---|---|
window | Object |
Returns | |
---|---|
boolean |
checkWrite
public void checkWrite (FileDescriptor fd)
Parameters | |
---|---|
fd | FileDescriptor |
getInCheck
public boolean getInCheck ()
This method was deprecated in API level 15.
Use checkPermission(Permission)
instead.
Returns | |
---|---|
boolean |
getThreadGroup
public ThreadGroup getThreadGroup ()
Returns the current thread's thread group.
Returns | |
---|---|
ThreadGroup |
Protected methods
classDepth
protected int classDepth (String name)
This method was deprecated in API level 15.
Use checkPermission(Permission)
instead.
Parameters | |
---|---|
name | String |
Returns | |
---|---|
int |
classLoaderDepth
protected int classLoaderDepth ()
This method was deprecated in API level 15.
Use checkPermission(Permission)
instead.
Returns | |
---|---|
int |
currentClassLoader
protected ClassLoader currentClassLoader ()
This method was deprecated in API level 15.
Use checkPermission(Permission)
instead.
Returns | |
---|---|
ClassLoader |
currentLoadedClass
protected Class<?> currentLoadedClass ()
This method was deprecated in API level 15.
Use checkPermission(Permission)
instead.
Returns | |
---|---|
Class<?> |
inClass
protected boolean inClass (String name)
This method was deprecated in API level 15.
Use checkPermission(Permission)
instead.
Parameters | |
---|---|
name | String |
Returns | |
---|---|
boolean |
inClassLoader
protected boolean inClassLoader ()
This method was deprecated in API level 15.
Use checkPermission(Permission)
instead.
Returns | |
---|---|
boolean |