[Android] [PATCH 1/3] Logcat: send logcats via a callback

Thomas Guillem thomas at gllm.fr
Mon Feb 9 19:36:49 CET 2015



On Mon, Feb 9, 2015, at 19:33, Jean-Baptiste Kempf wrote:
> On 09 Feb, Thomas Guillem wrote :
> > +        try {
> > +            synchronized (this) {
> > +                if (!mRun)
> > +                    return;
> > +                mProcess = Runtime.getRuntime().exec(args);
> > +            }
> > +            InputStreamReader input = new InputStreamReader(
> > +                    mProcess.getInputStream());
> > +            BufferedReader br = new BufferedReader(input);
> > +            String line;
> > +
> > +            while ((line = br.readLine()) != null)
> > +                mCallback.onLog(line);
> > +
> > +            br.close();
> > +            input.close();
> > +        } catch (IOException e) {
> > +            e.printStackTrace();
> > +        }
> 
> Are you sure you only get IOException out of all those?

exec Throws:
    SecurityException - If a security manager exists and its checkExec
    method doesn't allow creation of the subprocess
    IOException - If an I/O error occurs
    NullPointerException - If command is null
    IllegalArgumentException - If command is empty

I can add SecurityException

> 
> 
> -- 
> Jean-Baptiste Kempf
> http://www.jbkempf.com/ - +33 672 704 734
> Sent from my Electronic Device
> _______________________________________________
> Android mailing list
> Android at videolan.org
> https://mailman.videolan.org/listinfo/android


More information about the Android mailing list