Android APIs
public class

SecurityManager

extends Object
java.lang.Object
   ↳ java.lang.SecurityManager

Class Overview

Legacy security code; do not use.

Security managers do not provide a secure environment for executing untrusted code. Untrusted code cannot be safely isolated within the Dalvik VM.

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(ThreadGroup group)
void checkAccess(Thread thread)
void checkAwtEventQueueAccess()
void checkConnect(String host, int port, Object context)
void checkConnect(String host, int port)
void checkCreateClassLoader()
void checkDelete(String file)
void checkExec(String cmd)
void checkExit(int status)
void checkLink(String libName)
void checkListen(int port)
void checkMemberAccess(Class<?> cls, int type)
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 packageName)
void checkPackageDefinition(String packageName)
void checkPermission(Permission permission)
void checkPermission(Permission permission, Object context)
void checkPrintJobAccess()
void checkPropertiesAccess()
void checkPropertyAccess(String key)
void checkRead(String file)
void checkRead(FileDescriptor fd)
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.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected boolean inCheck

Added in API level 1

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

Public Constructors

public SecurityManager ()

Added in API level 1

Public Methods

public void checkAccept (String host, int port)

Added in API level 1

Parameters
host
port

public void checkAccess (ThreadGroup group)

Added in API level 1

Parameters
group

public void checkAccess (Thread thread)

Added in API level 1

Parameters
thread

public void checkAwtEventQueueAccess ()

Added in API level 1

public void checkConnect (String host, int port, Object context)

Added in API level 1

Parameters
host
port
context

public void checkConnect (String host, int port)

Added in API level 1

Parameters
host
port

public void checkCreateClassLoader ()

Added in API level 1

public void checkDelete (String file)

Added in API level 1

Parameters
file

public void checkExec (String cmd)

Added in API level 1

Parameters
cmd

public void checkExit (int status)

Added in API level 1

Parameters
status

public void checkLink (String libName)

Added in API level 1

Parameters
libName

public void checkListen (int port)

Added in API level 1

Parameters
port

public void checkMemberAccess (Class<?> cls, int type)

Added in API level 1

Parameters
cls
type

public void checkMulticast (InetAddress maddr)

Added in API level 1

Parameters
maddr

public void checkMulticast (InetAddress maddr, byte ttl)

Added in API level 1

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

Parameters
maddr
ttl

public void checkPackageAccess (String packageName)

Added in API level 1

Parameters
packageName

public void checkPackageDefinition (String packageName)

Added in API level 1

Parameters
packageName

public void checkPermission (Permission permission)

Added in API level 1

Parameters
permission

public void checkPermission (Permission permission, Object context)

Added in API level 1

Parameters
permission
context

public void checkPrintJobAccess ()

Added in API level 1

public void checkPropertiesAccess ()

Added in API level 1

public void checkPropertyAccess (String key)

Added in API level 1

Parameters
key

public void checkRead (String file)

Added in API level 1

Parameters
file

public void checkRead (FileDescriptor fd)

Added in API level 1

Parameters
fd

public void checkRead (String file, Object context)

Added in API level 1

Parameters
file
context

public void checkSecurityAccess (String target)

Added in API level 1

Parameters
target

public void checkSetFactory ()

Added in API level 1

public void checkSystemClipboardAccess ()

Added in API level 1

public boolean checkTopLevelWindow (Object window)

Added in API level 1

Parameters
window
Returns
boolean

public void checkWrite (FileDescriptor fd)

Added in API level 1

Parameters
fd

public void checkWrite (String file)

Added in API level 1

Parameters
file

public boolean getInCheck ()

Added in API level 1

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

Returns
boolean

public Object getSecurityContext ()

Added in API level 1

Returns
Object

public ThreadGroup getThreadGroup ()

Added in API level 1

Returns the current thread's thread group.

Returns
ThreadGroup

Protected Methods

protected int classDepth (String name)

Added in API level 1

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

Parameters
name
Returns
int

protected int classLoaderDepth ()

Added in API level 1

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

Returns
int

protected ClassLoader currentClassLoader ()

Added in API level 1

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

Returns
ClassLoader

protected Class<?> currentLoadedClass ()

Added in API level 1

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

Returns
Class<?>

protected Class[] getClassContext ()

Added in API level 1

Returns
Class[]

protected boolean inClass (String name)

Added in API level 1

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

Parameters
name
Returns
boolean

protected boolean inClassLoader ()

Added in API level 1

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

Returns
boolean