-
-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add wrappers for Android logcat broadcaster #858
Conversation
@KazuCocoa FYI |
/** | ||
* @return The list of web socket message handlers. | ||
*/ | ||
List<T> messageHandlers(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
messageHandlers()
-> getMessageHandlers()
/** | ||
* This is the basic interface for all web socket message handlers. | ||
*/ | ||
public interface MessagesHandler { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's strange that messages handler can not handle messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, I'll make it generic
* @param reason connection close reason | ||
*/ | ||
@OnClose | ||
public void onClose(Session session, CloseReason reason) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
session
parameter is never used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is used in connect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OnClose
public void onClose(CloseReason reason) {
I was also thinking about having separate callbacks for each event instead of interface implementation, which is more Java 8'ish. for example: Instead of driver.addLogcatListener(new MessagesHandler<String>() {
@Override
public void onMessage(String message) {
messageSemaphore.release();
}
@Override
public void onConnected() {
connectedSemaphore.release();
}
@Override
public void onDisconnected() {
// ignore
}
@Override
public void onError(Throwable cause) {
// ignore
}
}); it might look like driver.addLogcatMessageListener(this::onMessage);
driver.addLogcatErrorListener(this::onError); |
Make sure the hotfix appium/appium#10496 is merged to appium server before testing this PR locally |
@mykola-mokhnach Unfortunately there is a conflict. Can you please resolve this? I will get this in. |
… into ws # Conflicts: # src/main/java/io/appium/java_client/android/AndroidDriver.java
@SrinivasanTarget The conflict is resolved |
Change list
Added basic classes to support web sockets interaction in general and to interact with logcat messages broadcaster that has been implemented for Android server.
Types of changes