Index: webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java |
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java |
index 0197bcb3227dbc0fa0f290ab334199a4efa243ca..43eab0ad2055c648c71c2968f75ebda59d4e327f 100644 |
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java |
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java |
@@ -153,6 +153,12 @@ public class CallActivity extends Activity implements AppRTCClient.SignalingEven |
} |
} |
+ public interface CountingResource { |
+ public void increment(); |
+ public void decrement(); |
+ } |
+ public CountingResource countingResource; |
+ |
private final ProxyRenderer remoteProxyRenderer = new ProxyRenderer(); |
private final ProxyRenderer localProxyRenderer = new ProxyRenderer(); |
private PeerConnectionClient peerConnectionClient = null; |
@@ -378,6 +384,14 @@ public class CallActivity extends Activity implements AppRTCClient.SignalingEven |
} |
} |
+ public CountingResource getCountingResource() { |
+ return countingResource; |
+ } |
+ |
+ public void setCountingResource(CountingResource r) { |
+ countingResource = r; |
+ } |
+ |
@TargetApi(17) |
private DisplayMetrics getDisplayMetrics() { |
DisplayMetrics displayMetrics = new DisplayMetrics(); |
@@ -495,6 +509,10 @@ public class CallActivity extends Activity implements AppRTCClient.SignalingEven |
@Override |
protected void onDestroy() { |
+ Log.d(TAG, "onDestroy()"); |
+ if (countingResource != null) { |
+ countingResource.increment(); |
+ } |
Thread.setDefaultUncaughtExceptionHandler(null); |
disconnect(); |
if (logToast != null) { |
@@ -503,6 +521,9 @@ public class CallActivity extends Activity implements AppRTCClient.SignalingEven |
activityRunning = false; |
rootEglBase.release(); |
super.onDestroy(); |
+ if (countingResource != null) { |
+ countingResource.decrement(); |
+ } |
} |
// CallFragment.OnCallEvents interface implementation. |