Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.desktop/share/classes/javax/sound/sampled/AudioPermission.java
41159 views
1
/*
2
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
package javax.sound.sampled;
27
28
import java.io.Serial;
29
import java.security.BasicPermission;
30
31
/**
32
* The {@code AudioPermission} class represents access rights to the audio
33
* system resources. An {@code AudioPermission} contains a target name but no
34
* actions list; you either have the named permission or you don't.
35
* <p>
36
* The target name is the name of the audio permission (see the table below).
37
* The names follow the hierarchical property-naming convention. Also, an
38
* asterisk can be used to represent all the audio permissions.
39
* <p>
40
* The following table lists the possible {@code AudioPermission} target names.
41
* For each name, the table provides a description of exactly what that
42
* permission allows, as well as a discussion of the risks of granting code the
43
* permission.
44
*
45
* <table class="striped">
46
* <caption>Permission target name, what the permission allows, and associated
47
* risks</caption>
48
* <thead>
49
* <tr>
50
* <th scope="col">Permission Target Name
51
* <th scope="col">What the Permission Allows
52
* <th scope="col">Risks of Allowing this Permission
53
* </thead>
54
* <tbody>
55
* <tr>
56
* <th scope="row">play
57
* <td>Audio playback through the audio device or devices on the system.
58
* Allows the application to obtain and manipulate lines and mixers for
59
* audio playback (rendering).
60
* <td>In some cases use of this permission may affect other
61
* applications because the audio from one line may be mixed with other
62
* audio being played on the system, or because manipulation of a mixer
63
* affects the audio for all lines using that mixer.
64
* <tr>
65
* <th scope="row">record
66
* <td>Audio recording through the audio device or devices on the system.
67
* Allows the application to obtain and manipulate lines and mixers for
68
* audio recording (capture).
69
* <td>In some cases use of this permission may affect other applications
70
* because manipulation of a mixer affects the audio for all lines using
71
* that mixer. This permission can enable an applet or application to
72
* eavesdrop on a user.
73
* </tbody>
74
* </table>
75
*
76
* @author Kara Kytle
77
* @since 1.3
78
*/
79
public class AudioPermission extends BasicPermission {
80
81
/**
82
* Use serialVersionUID from JDK 1.3 for interoperability.
83
*/
84
@Serial
85
private static final long serialVersionUID = -5518053473477801126L;
86
87
/**
88
* Creates a new {@code AudioPermission} object that has the specified
89
* symbolic name, such as "play" or "record". An asterisk can be used to
90
* indicate all audio permissions.
91
*
92
* @param name the name of the new {@code AudioPermission}
93
* @throws NullPointerException if {@code name} is {@code null}
94
* @throws IllegalArgumentException if {@code name} is empty
95
*/
96
public AudioPermission(final String name) {
97
super(name);
98
}
99
100
/**
101
* Creates a new {@code AudioPermission} object that has the specified
102
* symbolic name, such as "play" or "record". The {@code actions} parameter
103
* is currently unused and should be {@code null}.
104
*
105
* @param name the name of the new {@code AudioPermission}
106
* @param actions (unused; should be {@code null})
107
* @throws NullPointerException if {@code name} is {@code null}
108
* @throws IllegalArgumentException if {@code name} is empty
109
*/
110
public AudioPermission(final String name, final String actions) {
111
super(name, actions);
112
}
113
}
114
115