File tree Expand file tree Collapse file tree
app/src/main/java/io/github/muntashirakon/AppManager/logcat/helper Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,16 +53,15 @@ public static Process getLogcatProcess(@LogBufferId int buffers) throws IOExcept
5353 @ Nullable
5454 public static String getLastLogLine (@ LogBufferId int buffers ) {
5555 Process dumpLogcatProcess = null ;
56- BufferedReader reader ;
5756 String result = null ;
5857 try {
5958 dumpLogcatProcess = ProcessCompat .exec (getLogcatArgs (buffers , true ));
60- reader = new BufferedReader (new InputStreamReader (dumpLogcatProcess
61- .getInputStream ()), 8192 );
62-
63- String line ;
64- while (( line = reader . readLine ()) != null ) {
65- result = line ;
59+ try ( BufferedReader reader = new BufferedReader (new InputStreamReader (dumpLogcatProcess
60+ .getInputStream ()), 8192 )) {
61+ String line ;
62+ while (( line = reader . readLine ()) != null ) {
63+ result = line ;
64+ }
6665 }
6766 } catch (IOException e ) {
6867 Log .e (TAG , e );
You can’t perform that action at this time.
0 commit comments