lightbulb_outline Help shape the future of the Google Play Console, Android Studio, and Firebase. Start survey

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 1. Use checkPermission(Permission) instead.

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)
void checkMulticast(InetAddress maddr)
void checkMulticast(InetAddress maddr, byte ttl)

This method was deprecated in API level 1. use checkMulticast(java.net.InetAddress) instead.

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)
void checkWrite(FileDescriptor fd)
void checkWrite(String file)
boolean getInCheck()

This method was deprecated in API level 1. Use checkPermission(Permission) instead.

Object getSecurityContext()
ThreadGroup getThreadGroup()

Returns the current thread's thread group.

Protected methods

int classDepth(String name)

This method was deprecated in API level 1. Use checkPermission(Permission) instead.

int classLoaderDepth()

This method was deprecated in API level 1. Use checkPermission(Permission) instead.

ClassLoader currentClassLoader()

This method was deprecated in API level 1. Use checkPermission(Permission) instead.

Class<?> currentLoadedClass()

This method was deprecated in API level 1. Use checkPermission(Permission) instead.

Class[] getClassContext()
boolean inClass(String name)

This method was deprecated in API level 1. Use checkPermission(Permission) instead.

boolean inClassLoader()

This method was deprecated in API level 1. Use checkPermission(Permission) instead.

Inherited methods

Fields

inCheck

added in API level 1
protected boolean inCheck

This field was deprecated in API level 1.
Use checkPermission(Permission) instead.

Public constructors

SecurityManager

added in API level 1
public SecurityManager ()

Public methods

checkAccept

added in API level 1
public void checkAccept (String host, 
                int port)

Parameters
host String

port int

checkAccess

added in API level 1
public void checkAccess (Thread t)

Parameters
t Thread

checkAccess

added in API level 1
public void checkAccess (ThreadGroup g)

Parameters
g ThreadGroup

checkAwtEventQueueAccess

added in API level 1
public void checkAwtEventQueueAccess ()

checkConnect

added in API level 1
public void checkConnect (String host, 
                int port)

Parameters
host String

port int

checkConnect

added in API level 1
public void checkConnect (String host, 
                int port, 
                Object context)

Parameters
host String

port int

context Object

checkCreateClassLoader

added in API level 1
public void checkCreateClassLoader ()

checkDelete

added in API level 1
public void checkDelete (String file)

Parameters
file String

checkExec

added in API level 1
public void checkExec (String cmd)

Parameters
cmd String

checkExit

added in API level 1
public void checkExit (int status)

Parameters
status int

checkLink

added in API level 1
public void checkLink (String lib)

Parameters
lib String

checkListen

added in API level 1
public void checkListen (int port)

Parameters
port int

checkMemberAccess

added in API level 1
public void checkMemberAccess (Class<?> clazz, 
                int which)

Parameters
clazz Class

which int

checkMulticast

added in API level 1
public void checkMulticast (InetAddress maddr)

Parameters
maddr InetAddress

checkMulticast

added in API level 1
public void checkMulticast (InetAddress maddr, 
                byte ttl)

This method was deprecated in API level 1.
use checkMulticast(java.net.InetAddress) instead.

Parameters
maddr InetAddress

ttl byte

checkPackageAccess

added in API level 1
public void checkPackageAccess (String pkg)

Parameters
pkg String

checkPackageDefinition

added in API level 1
public void checkPackageDefinition (String pkg)

Parameters
pkg String

checkPermission

added in API level 1
public void checkPermission (Permission perm, 
                Object context)

Parameters
perm Permission

context Object

checkPermission

added in API level 1
public void checkPermission (Permission perm)

Parameters
perm Permission

checkPrintJobAccess

added in API level 1
public void checkPrintJobAccess ()

checkPropertiesAccess

added in API level 1
public void checkPropertiesAccess ()

checkPropertyAccess

added in API level 1
public void checkPropertyAccess (String key)

Parameters
key String

checkRead

added in API level 1
public void checkRead (FileDescriptor fd)

Parameters
fd FileDescriptor

checkRead

added in API level 1
public void checkRead (String file)

Parameters
file String

checkRead

added in API level 1
public void checkRead (String file, 
                Object context)

Parameters
file String

context Object

checkSecurityAccess

added in API level 1
public void checkSecurityAccess (String target)

Parameters
target String

checkSetFactory

added in API level 1
public void checkSetFactory ()

checkSystemClipboardAccess

added in API level 1
public void checkSystemClipboardAccess ()

checkTopLevelWindow

added in API level 1
public boolean checkTopLevelWindow (Object window)

Parameters
window Object

Returns
boolean

checkWrite

added in API level 1
public void checkWrite (FileDescriptor fd)

Parameters
fd FileDescriptor

checkWrite

added in API level 1
public void checkWrite (String file)

Parameters
file String

getInCheck

added in API level 1
public boolean getInCheck ()

This method was deprecated in API level 1.
Use checkPermission(Permission) instead.

Returns
boolean

getSecurityContext

added in API level 1
public Object getSecurityContext ()

Returns
Object

getThreadGroup

added in API level 1
public ThreadGroup getThreadGroup ()

Returns the current thread's thread group.

Returns
ThreadGroup

Protected methods

classDepth

added in API level 1
protected int classDepth (String name)

This method was deprecated in API level 1.
Use checkPermission(Permission) instead.

Parameters
name String

Returns
int

classLoaderDepth

added in API level 1
protected int classLoaderDepth ()

This method was deprecated in API level 1.
Use checkPermission(Permission) instead.

Returns
int

currentClassLoader

added in API level 1
protected ClassLoader currentClassLoader ()

This method was deprecated in API level 1.
Use checkPermission(Permission) instead.

Returns
ClassLoader

currentLoadedClass

added in API level 1
protected Class<?> currentLoadedClass ()

This method was deprecated in API level 1.
Use checkPermission(Permission) instead.

Returns
Class<?>

getClassContext

added in API level 1
protected Class[] getClassContext ()

Returns
Class[]

inClass

added in API level 1
protected boolean inClass (String name)

This method was deprecated in API level 1.
Use checkPermission(Permission) instead.

Parameters
name String

Returns
boolean

inClassLoader

added in API level 1
protected boolean inClassLoader ()

This method was deprecated in API level 1.
Use checkPermission(Permission) instead.

Returns
boolean