Bug 1152401 - Expect the new MediaDevice types in GeckoView. r?jchen draft
authorAlex Chronopoulos <achronop@gmail.com>
Thu, 19 Jul 2018 16:20:35 +0200
changeset 820417 c1a03a748356697f30d45546369f4036fec1aa25
parent 819608 e128b2f2e7f5f534f5f58a66a0c54ea6b949ec13
push id116816
push userachronop@gmail.com
push dateThu, 19 Jul 2018 14:22:52 +0000
reviewersjchen
bugs1152401
milestone63.0a1
Bug 1152401 - Expect the new MediaDevice types in GeckoView. r?jchen This patchset changes the MediaDevice type names from "audio" and "video" to "audioinput" and "videoinput". GeckoSession has been updated to expect the new string names. In parallel a new type "audiooutput" has been added but it is not important for this patch. MozReview-Commit-ID: FUdG5QtD9re
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
@@ -2864,19 +2864,19 @@ public class GeckoSession extends LayerS
                     return SOURCE_OTHER;
                 } else {
                     throw new IllegalArgumentException("String: " + src + " is not a valid media source string");
                 }
             }
 
             private static @Type int getTypeFromString(String type) {
                 // The strings here should match the possible types in MediaDevice::MediaDevice in MediaManager.cpp
-                if ("video".equals(type)) {
+                if ("videoinput".equals(type)) {
                     return TYPE_VIDEO;
-                } else if ("audio".equals(type)) {
+                } else if ("audioinput".equals(type)) {
                     return TYPE_AUDIO;
                 } else {
                     throw new IllegalArgumentException("String: " + type + " is not a valid media type string");
                 }
             }
 
             /* package */ MediaSource(GeckoBundle media) {
                 id = media.getString("id");