Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(718)

Unified Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java

Issue 1992213002: Replace LooperExecutor with built-in class in Android AppRTC Demo (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Changes according to magjed comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
index 8f30451183261a0eed30c6da6e78b1438ce0b51d..bd4a3746ae4bb71ff047dfef7f90caf6c0ce0df6 100644
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
@@ -16,7 +16,6 @@ import android.os.Environment;
import android.util.Log;
import org.appspot.apprtc.AppRTCClient.SignalingParameters;
-import org.appspot.apprtc.util.LooperExecutor;
import org.webrtc.AudioTrack;
import org.webrtc.CameraEnumerationAndroid;
import org.webrtc.DataChannel;
@@ -46,6 +45,9 @@ import java.util.EnumSet;
import java.util.LinkedList;
import java.util.Timer;
import java.util.TimerTask;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -88,7 +90,7 @@ public class PeerConnectionClient {
private static final PeerConnectionClient instance = new PeerConnectionClient();
private final PCObserver pcObserver = new PCObserver();
private final SDPObserver sdpObserver = new SDPObserver();
- private final LooperExecutor executor;
+ private final ScheduledExecutorService executor;
private PeerConnectionFactory factory;
private PeerConnection peerConnection;
@@ -219,11 +221,10 @@ public class PeerConnectionClient {
}
private PeerConnectionClient() {
- executor = new LooperExecutor();
- // Looper thread is started once in private ctor and is used for all
+ // Executor thread is started once in private ctor and is used for all
// peer connection API calls to ensure new peer connection factory is
// created on the same thread as previously destroyed factory.
- executor.requestStart();
+ executor = Executors.newSingleThreadScheduledExecutor();
}
public static PeerConnectionClient getInstance() {

Powered by Google App Engine
This is Rietveld 408576698