Skip to content

Commit

Permalink
Merge branch 'master' into staging-client
Browse files Browse the repository at this point in the history
  • Loading branch information
rod-hynes committed Feb 1, 2018
2 parents 3746872 + a0335c6 commit f234cac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions MobileLibrary/Android/PsiphonTunnel/PsiphonTunnel.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public interface HostService {
public void onBytesTransferred(long sent, long received);
public void onStartedWaitingForNetworkConnectivity();
public void onClientVerificationRequired(String serverNonce, int ttlSeconds, boolean resetCache);
public void onActiveAuthorizationIDs(List<String> authorizations);
public void onExiting();
}

Expand Down Expand Up @@ -560,6 +561,13 @@ private void handlePsiphonNotice(String noticeJSON) {
diagnostic = false;
JSONObject data = notice.getJSONObject("data");
mHostService.onBytesTransferred(data.getLong("sent"), data.getLong("received"));
} else if (noticeType.equals("ActiveAuthorizationIDs")) {
JSONArray activeAuthorizationIDs = notice.getJSONObject("data").getJSONArray("IDs");
ArrayList<String> authorizations = new ArrayList<String>();
for (int i=0; i<activeAuthorizationIDs.length(); i++) {
authorizations.add(activeAuthorizationIDs.getString(i));
}
mHostService.onActiveAuthorizationIDs(authorizations);
} else if (noticeType.equals("Exiting")) {
mHostService.onExiting();
} else if(noticeType.equals("ClientVerificationRequired")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,11 @@ public void onClientVerificationRequired(String s, int i, boolean b) {

}

@Override
public void onActiveAuthorizationIDs(List<String> authorizations) {

}

@Override
public void onExiting() {

Expand Down

0 comments on commit f234cac

Please sign in to comment.