Implement JNI and objc implementation for Ice Candidate Pair Change event surfacing

Bug: webrtc:10419
Change-Id: I18528bf2526e933568bf052de76a434f012161da
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148320
Commit-Queue: Alex Drake <alexdrake@google.com>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28838}
diff --git a/sdk/android/api/org/webrtc/CandidatePairChangeEvent.java b/sdk/android/api/org/webrtc/CandidatePairChangeEvent.java
new file mode 100644
index 0000000..395b629
--- /dev/null
+++ b/sdk/android/api/org/webrtc/CandidatePairChangeEvent.java
@@ -0,0 +1,31 @@
+/*
+ *  Copyright 2013 The WebRTC project authors. All Rights Reserved.
+ *
+ *  Use of this source code is governed by a BSD-style license
+ *  that can be found in the LICENSE file in the root of the source
+ *  tree. An additional intellectual property rights grant can be found
+ *  in the file PATENTS.  All contributing project authors may
+ *  be found in the AUTHORS file in the root of the source tree.
+ */
+
+package org.webrtc;
+
+/**
+ * Representation of a change in selected ICE candidate pair.
+ * {@code CandidatePairChangeEvent} in the C++ API.
+ */
+public final class CandidatePairChangeEvent {
+  public final IceCandidate local;
+  public final IceCandidate remote;
+  public final int lastDataReceivedMs;
+  public final String reason;
+
+  @CalledByNative
+  CandidatePairChangeEvent(
+      IceCandidate local, IceCandidate remote, int lastDataReceivedMs, String reason) {
+    this.local = local;
+    this.remote = remote;
+    this.lastDataReceivedMs = lastDataReceivedMs;
+    this.reason = reason;
+  }
+}
diff --git a/sdk/android/api/org/webrtc/PeerConnection.java b/sdk/android/api/org/webrtc/PeerConnection.java
index a44969d..a5eeb58 100644
--- a/sdk/android/api/org/webrtc/PeerConnection.java
+++ b/sdk/android/api/org/webrtc/PeerConnection.java
@@ -15,6 +15,7 @@
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
+import org.webrtc.CandidatePairChangeEvent;
 import org.webrtc.DataChannel;
 import org.webrtc.MediaStreamTrack;
 import org.webrtc.RtpTransceiver;
@@ -118,6 +119,10 @@
     /** Triggered when some ICE candidates have been removed. */
     @CalledByNative("Observer") void onIceCandidatesRemoved(IceCandidate[] candidates);
 
+    /** Triggered when the ICE candidate pair is changed. */
+    @CalledByNative("Observer")
+    default void onSelectedCandidatePairChanged(CandidatePairChangeEvent event) {}
+
     /** Triggered when media is received on a new stream from remote peer. */
     @CalledByNative("Observer") void onAddStream(MediaStream stream);