MCPcopy Index your code
hub / github.com/Stericson/RootShell / close

Method close

src/main/java/com/stericson/RootShell/execution/Shell.java:313–346  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

311 }
312
313 public void close() throws IOException {
314 RootShell.log("Request to close shell!");
315
316 int count = 0;
317 while (isExecuting) {
318 RootShell.log("Waiting on shell to finish executing before closing...");
319 count++;
320
321 //fail safe
322 if (count > 10000) {
323 break;
324 }
325
326 }
327
328 synchronized (this.commands) {
329 /**
330 * instruct the two threads monitoring input and output
331 * of the shell to close.
332 */
333 this.close = true;
334 this.notifyThreads();
335 }
336
337 RootShell.log("Shell Closed!");
338
339 if (this == Shell.rootShell) {
340 Shell.rootShell = null;
341 } else if (this == Shell.shell) {
342 Shell.shell = null;
343 } else if (this == Shell.customShell) {
344 Shell.customShell = null;
345 }
346 }
347
348 public static void closeCustomShell() throws IOException {
349 RootShell.log("Request to close custom shell!");

Callers 7

closeQuietlyMethod · 0.80
closeCustomShellMethod · 0.80
closeRootShellMethod · 0.80
closeShellMethod · 0.80
getSuVersionMethod · 0.80
isSELinuxEnforcingMethod · 0.80
NativeJavaClassMethod · 0.80

Calls 2

logMethod · 0.95
notifyThreadsMethod · 0.95

Tested by 1

NativeJavaClassMethod · 0.64