@@ -50,11 +50,12 @@ public String executeShellCommandSync(
50
50
String command ,
51
51
List <String > parameters ,
52
52
Map <String , String > shellEnv ,
53
- boolean executeThroughShell )
53
+ boolean executeThroughShell ,
54
+ long timeoutMs )
54
55
throws IOException {
55
56
try {
56
57
return ShellCommandClient .execOnServerSync (
57
- context , binderKey , command , parameters , shellEnv , executeThroughShell );
58
+ context , binderKey , command , parameters , shellEnv , executeThroughShell , timeoutMs );
58
59
} catch (ClientNotConnected e ) {
59
60
Log .e (TAG , "ShellCommandClient not connected. Is ShellCommandExecutor service started?" , e );
60
61
throw new RuntimeException (e );
@@ -67,15 +68,27 @@ public String executeShellCommandSync(
67
68
68
69
/** {@inheritDoc} */
69
70
@ Override
70
- public InputStream executeShellCommand (
71
+ public String executeShellCommandSync (
71
72
String command ,
72
73
List <String > parameters ,
73
74
Map <String , String > shellEnv ,
74
75
boolean executeThroughShell )
76
+ throws IOException {
77
+ return executeShellCommandSync (command , parameters , shellEnv , executeThroughShell , 0L );
78
+ }
79
+
80
+ /** {@inheritDoc} */
81
+ @ Override
82
+ public InputStream executeShellCommand (
83
+ String command ,
84
+ List <String > parameters ,
85
+ Map <String , String > shellEnv ,
86
+ boolean executeThroughShell ,
87
+ long timeoutMs )
75
88
throws IOException , RemoteException {
76
89
try {
77
90
return ShellCommandClient .execOnServer (
78
- context , binderKey , command , parameters , shellEnv , executeThroughShell );
91
+ context , binderKey , command , parameters , shellEnv , executeThroughShell , timeoutMs );
79
92
} catch (ClientNotConnected e ) {
80
93
Log .e (TAG , "ShellCommandClient not connected. Is ShellCommandExecutor service started?" , e );
81
94
throw new RuntimeException (e );
@@ -85,4 +98,15 @@ public InputStream executeShellCommand(
85
98
throw new RuntimeException (e );
86
99
}
87
100
}
101
+
102
+ /** {@inheritDoc} */
103
+ @ Override
104
+ public InputStream executeShellCommand (
105
+ String command ,
106
+ List <String > parameters ,
107
+ Map <String , String > shellEnv ,
108
+ boolean executeThroughShell )
109
+ throws IOException , RemoteException {
110
+ return executeShellCommand (command , parameters , shellEnv , executeThroughShell , 0L );
111
+ }
88
112
}
0 commit comments