1. /*
  2. * @(#)AudioPermission.java 1.15 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.sound.sampled;
  8. import java.security.BasicPermission;
  9. /**
  10. * The <code>AudioPermission</code> class represents access rights to the audio
  11. * system resources. An <code>AudioPermission</code> contains a target name
  12. * but no actions list; you either have the named permission or you don't.
  13. * <p>
  14. * The target name is the name of the audio permission (see the table below).
  15. * The names follow the hierarchical property-naming convention. Also, an asterisk
  16. * can be used to represent all the audio permissions.
  17. * <p>
  18. * The following table lists the possible <code>AudioPermission</code> target names.
  19. * For each name, the table provides a description of exactly what that permission
  20. * allows, as well as a discussion of the risks of granting code the permission.
  21. * <p>
  22. *
  23. * <table border=1 cellpadding=5 summary="permission target name, what the permission allows, and associated risks">
  24. * <tr>
  25. * <th>Permission Target Name</th>
  26. * <th>What the Permission Allows</th>
  27. * <th>Risks of Allowing this Permission</th>
  28. * </tr>
  29. *
  30. * <tr>
  31. * <td>play</td>
  32. * <td>Audio playback through the audio device or devices on the system.
  33. * Allows the application to obtain and manipulate lines and mixers for
  34. * audio playback (rendering).</td>
  35. * <td>In some cases use of this permission may affect other
  36. * applications because the audio from one line may be mixed with other audio
  37. * being played on the system, or because manipulation of a mixer affects the
  38. * audio for all lines using that mixer.</td>
  39. *</tr>
  40. *
  41. * <tr>
  42. * <td>record</td>
  43. * <td>Audio recording through the audio device or devices on the system.
  44. * Allows the application to obtain and manipulate lines and mixers for
  45. * audio recording (capture).</td>
  46. * <td>In some cases use of this permission may affect other
  47. * applications because manipulation of a mixer affects the audio for all lines
  48. * using that mixer.
  49. * This permission can enable an applet or application to eavesdrop on a user.</td>
  50. *</tr>
  51. *</table>
  52. *<p>
  53. *
  54. * @author Kara Kytle
  55. * @version 1.15 03/01/23
  56. * @since 1.3
  57. */
  58. /*
  59. * (OLD PERMISSIONS TAKEN OUT FOR 1.2 BETA)
  60. *
  61. * <tr>
  62. * <td>playback device access</td>
  63. * <td>Direct access to the audio playback device(s), including configuration of the
  64. * playback format, volume, and balance, explicit opening and closing of the device,
  65. * etc.</td>
  66. * <td>Changes the properties of a shared system device and therefore
  67. * can affect other applications.</td>
  68. * </tr>
  69. *
  70. * <tr>
  71. * <td>playback device override</td>
  72. * <td>Manipulation of the audio playback device(s) in a way that directly conflicts
  73. * with use by other applications. This includes closing the device while it is in
  74. * use by another application, changing the device format while another application
  75. * is using it, etc. </td>
  76. * <td>Changes the properties of a shared system device and therefore
  77. * can affect other applications.</td>
  78. * </tr>
  79. *
  80. * <tr>
  81. * <td>record device access</td>
  82. * <td>Direct access to the audio recording device(s), including configuration of the
  83. * the record format, volume, and balance, explicit opening and closing of the device,
  84. * etc.</td>
  85. * <td>Changes the properties of a shared system device and therefore
  86. * can affect other applications.</td>
  87. * </tr>
  88. *
  89. * <tr>
  90. * <td>record device override</td>
  91. * <td>Manipulation of the audio recording device(s) in a way that directly conflicts
  92. * with use by other applications. This includes closing the device while it is in
  93. * use by another application, changing the device format while another application
  94. * is using it, etc. </td>
  95. * <td>Changes the properties of a shared system device and therefore
  96. * can affect other applications.</td>
  97. * </tr>
  98. *
  99. * </table>
  100. *<p>
  101. *
  102. * @author Kara Kytle
  103. * @version 1.15 03/01/23
  104. * @since 1.3
  105. */
  106. /*
  107. * The <code>AudioPermission</code> class represents access rights to the audio
  108. * system resources. An <code>AudioPermission</code> contains a target name
  109. * but no actions list; you either have the named permission or you don't.
  110. * <p>
  111. * The target name is the name of the audio permission (see the table below).
  112. * The names follow the hierarchical property-naming convention. Also, an asterisk
  113. * can be used to represent all the audio permissions.
  114. * <p>
  115. * The following table lists all the possible AudioPermission target names.
  116. * For each name, the table provides a description of exactly what that permission
  117. * allows, as well as a discussion of the risks of granting code the permission.
  118. * <p>
  119. *
  120. * <table border=1 cellpadding=5>
  121. * <tr>
  122. * <th>Permission Target Name</th>
  123. * <th>What the Permission Allows</th>
  124. * <th>Risks of Allowing this Permission</th>
  125. * </tr>
  126. *
  127. * <tr>
  128. * <td>play</td>
  129. * <td>Audio playback through the audio device or devices on the system.</td>
  130. * <td>Allows the application to use a system device. Can affect other applications,
  131. * because the result will be mixed with other audio being played on the system.</td>
  132. *</tr>
  133. *
  134. * <tr>
  135. * <td>record</td>
  136. * <td>Recording audio from the audio device or devices on the system,
  137. * commonly through a microphone.</td>
  138. * <td>Can enable an applet or application to eavesdrop on a user.</td>
  139. * </tr>
  140. *
  141. * <tr>
  142. * <td>playback device access</td>
  143. * <td>Direct access to the audio playback device(s), including configuration of the
  144. * playback format, volume, and balance, explicit opening and closing of the device,
  145. * etc.</td>
  146. * <td>Changes the properties of a shared system device and therefore
  147. * can affect other applications.</td>
  148. * </tr>
  149. *
  150. * <tr>
  151. * <td>playback device override</td>
  152. * <td>Manipulation of the audio playback device(s) in a way that directly conflicts
  153. * with use by other applications. This includes closing the device while it is in
  154. * use by another application, changing the device format while another application
  155. * is using it, etc. </td>
  156. * <td>Changes the properties of a shared system device and therefore
  157. * can affect other applications.</td>
  158. * </tr>
  159. *
  160. * <tr>
  161. * <td>record device access</td>
  162. * <td>Direct access to the audio recording device(s), including configuration of the
  163. * the record format, volume, and balance, explicit opening and closing of the device,
  164. * etc.</td>
  165. * <td>Changes the properties of a shared system device and therefore
  166. * can affect other applications.</td>
  167. * </tr>
  168. *
  169. * <tr>
  170. * <td>record device override</td>
  171. * <td>Manipulation of the audio recording device(s) in a way that directly conflicts
  172. * with use by other applications. This includes closing the device while it is in
  173. * use by another application, changing the device format while another application
  174. * is using it, etc. </td>
  175. * <td>Changes the properties of a shared system device and therefore
  176. * can affect other applications.</td>
  177. * </tr>
  178. *
  179. * </table>
  180. *<p>
  181. *
  182. * @version 1.15 03/01/23
  183. * @author Kara Kytle
  184. */
  185. public class AudioPermission extends BasicPermission {
  186. /**
  187. * Creates a new <code>AudioPermission</code> object that has the specified
  188. * symbolic name, such as "play" or "record". An asterisk can be used to indicate
  189. * all audio permissions.
  190. * @param name the name of the new <code>AudioPermission</code>
  191. */
  192. /*
  193. * Creates a new <code>AudioPermission</code> object that has the specified
  194. * symbolic name, such as "play" or "record". An asterisk can be used to indicate
  195. * all audio permissions.
  196. * @param name the name of the new <code>AudioPermission</code>
  197. */
  198. public AudioPermission(String name) {
  199. super(name);
  200. }
  201. /**
  202. * Creates a new <code>AudioPermission</code> object that has the specified
  203. * symbolic name, such as "play" or "record". The <code>actions</code>
  204. * parameter is currently unused and should be <code>null</code>.
  205. * @param name the name of the new <code>AudioPermission</code>
  206. * @param actions (unused; should be <code>null</code>)
  207. */
  208. /*
  209. * Creates a new AudioPermission object that has the specified
  210. * symbolic name, such as "play" or "record". The <code>actions</code>
  211. * parameter is currently unused and should be <code>null</code>.
  212. * @param name the name of the new <code>AudioPermission</code>
  213. * @param actions (unused; should be <code>null</code>)
  214. */
  215. public AudioPermission(String name, String actions) {
  216. super(name, actions);
  217. }
  218. }