Android: Generate JNI code for remaining classes in sdk/android

Bug: webrtc:8278
Change-Id: I20a4388ab347d8745d0edde808f7a0b610f077f9
Reviewed-on: https://webrtc-review.googlesource.com/31484
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21227}
diff --git a/sdk/android/api/org/webrtc/MediaSource.java b/sdk/android/api/org/webrtc/MediaSource.java
index a26e889..c0421f7 100644
--- a/sdk/android/api/org/webrtc/MediaSource.java
+++ b/sdk/android/api/org/webrtc/MediaSource.java
@@ -13,7 +13,17 @@
 /** Java wrapper for a C++ MediaSourceInterface. */
 public class MediaSource {
   /** Tracks MediaSourceInterface.SourceState */
-  public enum State { INITIALIZING, LIVE, ENDED, MUTED }
+  public enum State {
+    INITIALIZING,
+    LIVE,
+    ENDED,
+    MUTED;
+
+    @CalledByNative("State")
+    static State fromNativeIndex(int nativeIndex) {
+      return values()[nativeIndex];
+    }
+  }
 
   final long nativeSource; // Package-protected for PeerConnectionFactory.
 
@@ -22,12 +32,12 @@
   }
 
   public State state() {
-    return nativeState(nativeSource);
+    return getNativeState(nativeSource);
   }
 
   public void dispose() {
     JniCommon.nativeReleaseRef(nativeSource);
   }
 
-  private static native State nativeState(long pointer);
+  private static native State getNativeState(long pointer);
 }