Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8272818

JPackage "ask for microphone permissions" broken on OSX

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      os_x

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Since "ask for microphone permissions" feature in MacOS 10.14 Mojave onwards (eg exists on Current v11 Big Sur)

      A DESCRIPTION OF THE PROBLEM :
      Microphone permissions aren’t granted to applications created by jPackage. The resulting PCM line in samples files are the correct duration, but don’t have any sound (samples all set to 0).
      System Preferences -> Security & Privacy -> Privacy -> Microphone
      (application never asks for permissions)

      There are various reports of this on the Internet - but I’m wondering if the JPackage team is aware of the issue?

      https://stackoverflow.com/questions/55727488/application-doesnt-ask-for-permission-to-access-microphone-in-macos-10-14-mojav

      This pretty much shows the solution - needs a bit of Objective C though put into the Jpackage osx executable.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Jpackage any app that records audio.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      When run the first time, the JPackaged app asks for permission to use the microphone, it is granted, you can then record audio.
      ACTUAL -
      The jPackaged app never asks for microphone permissions, and the recorded audio is of the right duration etc, but of zero volume.

      ---------- BEGIN SOURCE ----------
      https://docs.oracle.com/javase/tutorial/sound/capturing.html

      Any jPackaged audio app.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Have the app bootstrap itself using Runtime.java and grant applications to the Terminal.app (when it calls itself from `java Application.app/MacOS/Resources/Application`)

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              herrick Andy Herrick (Inactive)
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: