Skip to content

Commit

Permalink
Removed unneded code
Browse files Browse the repository at this point in the history
  • Loading branch information
km2442 committed Jun 25, 2019
1 parent e12dea9 commit 356045a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected void onCreate(Bundle savedInstanceState) {
settingsLayout.setVisibility(View.VISIBLE);
}

private boolean getSettings() throws InterruptedException {
void getSettings() throws InterruptedException {
Packet p = new Packet();
p.Exec = "GetSettings";
Hub.cui.sendMsg(p);
Expand Down Expand Up @@ -100,22 +100,5 @@ public void run() {
// try {
// input = new BufferedReader(new InputStreamReader(s.getInputStream()));
// } catch (IOException e) {
// e.printStackTrace();
// }
// try {
// while(json.length() == 0) {
// final String st = input.readLine();
// if(st.trim().length() != 0) {
// setJson(st.toString());
// }
// }
// } catch (SocketTimeoutException e) {
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// });
// thread.start();
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ public void run() {

out = socket.getOutputStream();
output = new PrintWriter(out);
startReceiver();
cw.connected();
}
catch(SocketTimeoutException e) {
} catch (SocketTimeoutException e) {
//TODO info
Log.e(TAG, "SocketCommunicator: SocketTimeOutException");
e.printStackTrace();
Expand All @@ -69,54 +67,4 @@ public void run() {
});
thread.start();
}

public void startReceiver() {
// Thread thread = new Thread(new Runnable() {
// @Override
// public void run() {
// boolean exception = false;
// try {
// Thread.sleep(1000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// while (!exception) {
// if(socket.isClosed()) {
// Log.e(TAG, "Socket Closedd");
// break;
// }
//
// try {
// BufferedReader input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
// final String st = input.readLine();
//
// handler.post(new Runnable() {
// @Override
// public void run() {
// if (st.trim().length() != 0) {
// JsonObject json = (JsonObject) new JsonParser().parse(st);
// Set<String> keys = json.keySet();
// Log.e(TAG, keys.toString());
// }
// }
// });
// } catch (SocketException e) {
// //TODO info
// cw.finish();
// } catch (IOException e) {
// e.printStackTrace();
// exception = true;
// } catch (NetworkOnMainThreadException e) {
// Log.e(TAG, "startReceiver: NetworkOnMainThreadException");
// e.printStackTrace();
// exception = true;
// } catch (Exception e) {
// e.printStackTrace();
// exception = true;
// }
// }
// }
// });
// thread.start();
}
}

0 comments on commit 356045a

Please sign in to comment.