Bug 1410456 - Allow OMT access to Android system audio properties. r?esawin draft
authorEugen Sawin <esawin@mozilla.com>
Tue, 20 Feb 2018 15:37:06 +0200
changeset 758409 281a676acab8352376d16f7fcb4d44a765f81693
parent 756941 d0d3693d9beff5477175a441fdb06e281e8b7f17
child 758410 aaf3cb211aa32185f3aef6560a8f0e72abbed8fc
push id100043
push userachronop@gmail.com
push dateThu, 22 Feb 2018 11:35:08 +0000
reviewersesawin
bugs1410456
milestone60.0a1
Bug 1410456 - Allow OMT access to Android system audio properties. r?esawin MozReview-Commit-ID: 4YkiuzNkNu5
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
widget/android/GeneratedJNIWrappers.h
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
@@ -1831,34 +1831,34 @@ public class GeckoAppShell
             final WindowManager wm = (WindowManager)
                     getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
             final Display disp = wm.getDefaultDisplay();
             sScreenSize = new Rect(0, 0, disp.getWidth(), disp.getHeight());
         }
         return sScreenSize;
     }
 
-    @WrapForJNI(calledFrom = "gecko")
+    @WrapForJNI(calledFrom = "any")
     public static int getAudioOutputFramesPerBuffer() {
         if (SysInfo.getVersion() < 17) {
             return 0;
         }
         final AudioManager am = (AudioManager)getApplicationContext()
                                 .getSystemService(Context.AUDIO_SERVICE);
         if (am == null) {
             return 0;
         }
         final String prop = am.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER);
         if (prop == null) {
             return 0;
         }
         return Integer.parseInt(prop);
     }
 
-    @WrapForJNI(calledFrom = "gecko")
+    @WrapForJNI(calledFrom = "any")
     public static int getAudioOutputSampleRate() {
         if (SysInfo.getVersion() < 17) {
             return 0;
         }
         final AudioManager am = (AudioManager)getApplicationContext()
                                 .getSystemService(Context.AUDIO_SERVICE);
         if (am == null) {
             return 0;
--- a/widget/android/GeneratedJNIWrappers.h
+++ b/widget/android/GeneratedJNIWrappers.h
@@ -809,17 +809,17 @@ public:
         typedef mozilla::jni::Args<> Args;
         static constexpr char name[] = "getAudioOutputFramesPerBuffer";
         static constexpr char signature[] =
                 "()I";
         static const bool isStatic = true;
         static const mozilla::jni::ExceptionMode exceptionMode =
                 mozilla::jni::ExceptionMode::ABORT;
         static const mozilla::jni::CallingThread callingThread =
-                mozilla::jni::CallingThread::GECKO;
+                mozilla::jni::CallingThread::ANY;
         static const mozilla::jni::DispatchTarget dispatchTarget =
                 mozilla::jni::DispatchTarget::CURRENT;
     };
 
     static auto GetAudioOutputFramesPerBuffer() -> int32_t;
 
     struct GetAudioOutputSampleRate_t {
         typedef GeckoAppShell Owner;
@@ -828,17 +828,17 @@ public:
         typedef mozilla::jni::Args<> Args;
         static constexpr char name[] = "getAudioOutputSampleRate";
         static constexpr char signature[] =
                 "()I";
         static const bool isStatic = true;
         static const mozilla::jni::ExceptionMode exceptionMode =
                 mozilla::jni::ExceptionMode::ABORT;
         static const mozilla::jni::CallingThread callingThread =
-                mozilla::jni::CallingThread::GECKO;
+                mozilla::jni::CallingThread::ANY;
         static const mozilla::jni::DispatchTarget dispatchTarget =
                 mozilla::jni::DispatchTarget::CURRENT;
     };
 
     static auto GetAudioOutputSampleRate() -> int32_t;
 
     struct GetConnection_t {
         typedef GeckoAppShell Owner;