• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Licensed to the Apache Software Foundation (ASF) under one or more
3  *  contributor license agreements.  See the NOTICE file distributed with
4  *  this work for additional information regarding copyright ownership.
5  *  The ASF licenses this file to You under the Apache License, Version 2.0
6  *  (the "License"); you may not use this file except in compliance with
7  *  the License.  You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  */
17 
18 package java.lang;
19 
20 import java.security.BasicPermission;
21 
22 /**
23  * Represents the permission to execute a runtime-related function. There is no
24  * action list associated with a {@code RuntimePermission}; the user either has
25  * the permission or he doesn't.
26  *
27  * @since Android 1.0
28  */
29 public final class RuntimePermission extends BasicPermission {
30 
31     private static final long serialVersionUID = 7399184964622342223L;
32 
33     /**
34      * Constants for runtime permissions used in this package.
35      */
36     static final RuntimePermission permissionToSetSecurityManager = new RuntimePermission(
37             "setSecurityManager"); //$NON-NLS-1$
38 
39     static final RuntimePermission permissionToCreateSecurityManager = new RuntimePermission(
40             "createSecurityManager"); //$NON-NLS-1$
41 
42     static final RuntimePermission permissionToGetProtectionDomain = new RuntimePermission(
43             "getProtectionDomain"); //$NON-NLS-1$
44 
45     static final RuntimePermission permissionToGetClassLoader = new RuntimePermission(
46             "getClassLoader"); //$NON-NLS-1$
47 
48     static final RuntimePermission permissionToCreateClassLoader = new RuntimePermission(
49             "createClassLoader"); //$NON-NLS-1$
50 
51     static final RuntimePermission permissionToModifyThread = new RuntimePermission(
52             "modifyThread"); //$NON-NLS-1$
53 
54     static final RuntimePermission permissionToModifyThreadGroup = new RuntimePermission(
55             "modifyThreadGroup"); //$NON-NLS-1$
56 
57     static final RuntimePermission permissionToExitVM = new RuntimePermission(
58             "exitVM"); //$NON-NLS-1$
59 
60     static final RuntimePermission permissionToReadFileDescriptor = new RuntimePermission(
61             "readFileDescriptor"); //$NON-NLS-1$
62 
63     static final RuntimePermission permissionToWriteFileDescriptor = new RuntimePermission(
64             "writeFileDescriptor"); //$NON-NLS-1$
65 
66     static final RuntimePermission permissionToQueuePrintJob = new RuntimePermission(
67             "queuePrintJob"); //$NON-NLS-1$
68 
69     static final RuntimePermission permissionToSetFactory = new RuntimePermission(
70             "setFactory"); //$NON-NLS-1$
71 
72     static final RuntimePermission permissionToSetIO = new RuntimePermission(
73             "setIO"); //$NON-NLS-1$
74 
75     static final RuntimePermission permissionToStopThread = new RuntimePermission(
76             "stopThread"); //$NON-NLS-1$
77 
78     static final RuntimePermission permissionToSetContextClassLoader = new RuntimePermission(
79             "setContextClassLoader"); //$NON-NLS-1$
80 
81     /**
82      * Creates an instance of {@code RuntimePermission} with the specified name.
83      *
84      * @param permissionName
85      *            the name of the new permission.
86      * @since Android 1.0
87      */
RuntimePermission(String permissionName)88     public RuntimePermission(String permissionName) {
89         super(permissionName);
90     }
91 
92     /**
93      * Creates an instance of {@code RuntimePermission} with the specified name
94      * and action list. The action list is ignored.
95      *
96      * @param name
97      *            the name of the new permission.
98      * @param actions
99      *            ignored.
100      * @since Android 1.0
101      */
RuntimePermission(String name, String actions)102     public RuntimePermission(String name, String actions) {
103         super(name, actions);
104     }
105 }
106