changeset 60353:d847a98a32cf

8246094: [macos] Sound Recording and playback is not working Reviewed-by: prr, serb
author erikj
date Fri, 24 Jul 2020 10:52:02 -0700
parents b22f5f666b4d
children db320f5cea0b 31a8f79a7dfe
files make/common/modules/LauncherCommon.gmk make/data/bundle/JDK-Info.plist make/data/bundle/JRE-Info.plist src/java.base/macosx/native/launcher/Info-cmdline.plist src/java.base/macosx/native/launcher/Info-privileged.plist
diffstat 5 files changed, 25 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/make/common/modules/LauncherCommon.gmk	Fri Jul 24 17:06:35 2020 +0100
+++ b/make/common/modules/LauncherCommon.gmk	Fri Jul 24 10:52:02 2020 -0700
@@ -103,12 +103,22 @@
 
   ifeq ($(call isTargetOs, macosx), true)
     ifeq ($$($1_MACOSX_PRIVILEGED), true)
-      $1_PLIST_FILE := Info-privileged.plist
+      $1_PLIST_SRC_FILE := Info-privileged.plist
     else
-      $1_PLIST_FILE := Info-cmdline.plist
+      $1_PLIST_SRC_FILE := Info-cmdline.plist
     endif
 
-    $1_LDFLAGS += -sectcreate __TEXT __info_plist $(MACOSX_PLIST_DIR)/$$($1_PLIST_FILE)
+    $1_PLIST_FILE := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$1/Info.plist
+
+    $$(eval $$(call SetupTextFileProcessing, BUILD_PLIST_$1, \
+        SOURCE_FILES := $$(TOPDIR)/src/java.base/macosx/native/launcher/$$($1_PLIST_SRC_FILE), \
+        OUTPUT_FILE := $$($1_PLIST_FILE), \
+        REPLACEMENTS := \
+            @@ID@@ => $(MACOSX_BUNDLE_ID_BASE).$(VERSION_SHORT).$1 ; \
+            @@VERSION@@ => $(VERSION_NUMBER) ; \
+    ))
+
+    $1_LDFLAGS += -sectcreate __TEXT __info_plist $$($1_PLIST_FILE)
 
     ifeq ($(STATIC_BUILD), true)
       $1_LDFLAGS += -exported_symbols_list \
@@ -168,6 +178,8 @@
   $1 += $$(BUILD_LAUNCHER_$1)
   TARGETS += $$($1)
 
+  $$(BUILD_LAUNCHER_$1): $$(BUILD_PLIST_$1)
+
   ifeq ($(call isTargetOs, aix), true)
     $$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, jli_static)
   endif
--- a/make/data/bundle/JDK-Info.plist	Fri Jul 24 17:06:35 2020 +0100
+++ b/make/data/bundle/JDK-Info.plist	Fri Jul 24 10:52:02 2020 -0700
@@ -22,6 +22,8 @@
         <string>????</string>
         <key>CFBundleVersion</key>
         <string>@@VERSION@@</string>
+        <key>NSMicrophoneUsageDescription</key>
+        <string>The application is requesting access to the microphone.</string>
         <key>JavaVM</key>
         <dict>
                 <key>JVMCapabilities</key>
--- a/make/data/bundle/JRE-Info.plist	Fri Jul 24 17:06:35 2020 +0100
+++ b/make/data/bundle/JRE-Info.plist	Fri Jul 24 10:52:02 2020 -0700
@@ -22,6 +22,8 @@
         <string>????</string>
         <key>CFBundleVersion</key>
         <string>@@VERSION@@</string>
+        <key>NSMicrophoneUsageDescription</key>
+        <string>The application is requesting access to the microphone.</string>
         <key>JavaVM</key>
         <dict>
                 <key>JVMMinimumFrameworkVersion</key>
--- a/src/java.base/macosx/native/launcher/Info-cmdline.plist	Fri Jul 24 17:06:35 2020 +0100
+++ b/src/java.base/macosx/native/launcher/Info-cmdline.plist	Fri Jul 24 10:52:02 2020 -0700
@@ -3,12 +3,14 @@
 <plist version="1.0">
 <dict>
         <key>CFBundleIdentifier</key>
-        <string>net.java.openjdk.cmd</string>
+        <string>@@ID@@</string>
         <key>CFBundleInfoDictionaryVersion</key>
         <string>6.0</string>
         <key>CFBundleShortVersionString</key>
         <string>1.0</string>
         <key>CFBundleVersion</key>
-        <string>1.0</string>
+        <string>@@VERSION@@</string>
+        <key>NSMicrophoneUsageDescription</key>
+        <string>The application is requesting access to the microphone.</string>
 </dict>
 </plist>
--- a/src/java.base/macosx/native/launcher/Info-privileged.plist	Fri Jul 24 17:06:35 2020 +0100
+++ b/src/java.base/macosx/native/launcher/Info-privileged.plist	Fri Jul 24 10:52:02 2020 -0700
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
         <key>CFBundleIdentifier</key>
-        <string>net.java.openjdk.cmd</string>
+        <string>@@ID@@</string>
         <key>CFBundleInfoDictionaryVersion</key>
         <string>6.0</string>
         <key>CFBundleName</key>
@@ -11,7 +11,7 @@
         <key>CFBundleShortVersionString</key>
         <string>1.0</string>
         <key>CFBundleVersion</key>
-        <string>1.0</string>
+        <string>@@VERSION@@</string>
         <key>SecTaskAccess</key>
         <string>allowed</string>
 </dict>