Fixed style issues from lint and got rid of unused fields.

BUG=
R=jiayl@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/41379004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7995 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
wzh@webrtc.org
2015-01-05 17:39:43 +00:00
parent c4ad157d8d
commit 433006a6c2
5 changed files with 27 additions and 28 deletions

View File

@@ -106,7 +106,7 @@ public interface AppRTCClient {
/**
* Callback interface for messages delivered on signaling channel.
*
* Methods are guaranteed to be invoked on the UI thread of |activity|.
* <p>Methods are guaranteed to be invoked on the UI thread of |activity|.
*/
public static interface SignalingEvents {
/**

View File

@@ -54,11 +54,9 @@ public class AppRTCProximitySensor implements SensorEventListener {
// the case. Only active when |DEBUG| is set to true.
private final NonThreadSafe nonThreadSafe = new AppRTCUtils.NonThreadSafe();
private final Context apprtcContext;
private final Runnable onSensorStateListener;
private final SensorManager sensorManager;
private Sensor proximitySensor = null;
private boolean initialized = false;
private boolean lastStateReportIsNear = false;
/** Construction */
@@ -69,7 +67,6 @@ public class AppRTCProximitySensor implements SensorEventListener {
private AppRTCProximitySensor(Context context, Runnable sensorStateListener) {
Log.d(TAG, "AppRTCProximitySensor" + AppRTCUtils.getThreadInfo());
apprtcContext = context;
onSensorStateListener = sensorStateListener;
sensorManager = ((SensorManager) context.getSystemService(
Context.SENSOR_SERVICE));
@@ -161,8 +158,9 @@ public class AppRTCProximitySensor implements SensorEventListener {
/** Helper method for logging information about the proximity sensor. */
private void logProximitySensorInfo() {
if (proximitySensor == null)
if (proximitySensor == null) {
return;
}
Log.d(TAG, "Proximity sensor: " + "name=" + proximitySensor.getName()
+ ", vendor: " + proximitySensor.getVendor()
+ ", type: " + proximitySensor.getStringType()

View File

@@ -46,8 +46,10 @@ import java.net.URLConnection;
import java.util.LinkedList;
import java.util.Scanner;
// AsyncTask that converts an AppRTC room URL into the set of signaling
// parameters to use with that room.
/**
* AsyncTask that converts an AppRTC room URL into the set of signaling
* parameters to use with that room.
*/
public class RoomParametersFetcher
extends AsyncTask<String, Void, SignalingParameters> {
private static final String TAG = "RoomRTCClient";

View File

@@ -194,8 +194,8 @@ public class WebSocketChannelClient {
state = WebSocketConnectionState.CONNECTED;
}
// Close WebSocket in CONNECTED or ERROR states only.
if (state == WebSocketConnectionState.CONNECTED ||
state == WebSocketConnectionState.ERROR) {
if (state == WebSocketConnectionState.CONNECTED
|| state == WebSocketConnectionState.ERROR) {
ws.disconnect();
// Send DELETE to http WebSocket server.
@@ -244,8 +244,8 @@ public class WebSocketChannelClient {
try {
// Send POST or DELETE request.
String postUrl = postServerUrl + "/" + roomID + "/" + clientID;
Log.d(TAG, "WS " + wsHttpMessage.method + " : " + postUrl + " : " +
wsHttpMessage.message);
Log.d(TAG, "WS " + wsHttpMessage.method + " : " + postUrl + " : "
+ wsHttpMessage.message);
HttpURLConnection connection =
(HttpURLConnection) new URL(postUrl).openConnection();
connection.setRequestProperty(
@@ -258,8 +258,8 @@ public class WebSocketChannelClient {
}
int responseCode = connection.getResponseCode();
if (responseCode != 200) {
reportError("Non-200 response to " + wsHttpMessage.method + " : " +
connection.getHeaderField(null));
reportError("Non-200 response to " + wsHttpMessage.method + " : "
+ connection.getHeaderField(null));
}
} catch (IOException e) {
reportError("WS POST error: " + e.getMessage());
@@ -280,8 +280,8 @@ public class WebSocketChannelClient {
@Override
public void onClose(WebSocketCloseNotification code, String reason) {
Log.d(TAG, "WebSocket connection closed. Code: " + code +
". Reason: " + reason);
Log.d(TAG, "WebSocket connection closed. Code: " + code
+ ". Reason: " + reason);
uiHandler.post(new Runnable() {
public void run() {
if (state != WebSocketConnectionState.CLOSED) {
@@ -298,8 +298,8 @@ public class WebSocketChannelClient {
final String message = payload;
uiHandler.post(new Runnable() {
public void run() {
if (state == WebSocketConnectionState.CONNECTED ||
state == WebSocketConnectionState.REGISTERED) {
if (state == WebSocketConnectionState.CONNECTED
|| state == WebSocketConnectionState.REGISTERED) {
events.onWebSocketMessage(message);
}
}

View File

@@ -49,7 +49,7 @@ import org.webrtc.SessionDescription;
* Negotiates signaling for chatting with apprtc.appspot.com "rooms".
* Uses the client<->server specifics of the apprtc AppEngine webapp.
*
* To use: create an instance of this object (registering a message handler) and
* <p>To use: create an instance of this object (registering a message handler) and
* call connectToRoom(). Once room connection is established
* onConnectedToRoom() callback with room parameters is invoked.
* Messages to other party (with local Ice candidates and answer SDP) can
@@ -94,10 +94,10 @@ public class WebSocketRTCClient implements AppRTCClient,
Log.w(TAG, "No offer SDP in room response.");
}
initiator = params.initiator;
postMessageUrl = params.roomUrl + "/message/" +
params.roomId + "/" + params.clientId;
byeMessageUrl = params.roomUrl + "/bye/" +
params.roomId + "/" + params.clientId;
postMessageUrl = params.roomUrl + "/message/"
+ params.roomId + "/" + params.clientId;
byeMessageUrl = params.roomUrl + "/bye/"
+ params.roomId + "/" + params.clientId;
roomState = ConnectionState.CONNECTED;
// Connect to WebSocket server.
@@ -176,8 +176,7 @@ public class WebSocketRTCClient implements AppRTCClient,
} else {
reportError("Unexpected WebSocket message: " + msg);
}
}
else {
} else {
if (errorText != null && errorText.length() > 0) {
reportError("WebSocket error message: " + errorText);
} else {
@@ -370,8 +369,8 @@ public class WebSocketRTCClient implements AppRTCClient,
// Get response.
int responseCode = connection.getResponseCode();
if (responseCode != 200) {
reportError("Non-200 response to POST: " +
connection.getHeaderField(null));
reportError("Non-200 response to POST: "
+ connection.getHeaderField(null));
}
InputStream responseStream = connection.getInputStream();
String response = drainStream(responseStream);