How to find out who the ROM provider is?
<p>I have an automatic bug reporting facility in my app that includes useful information for debugging. </p>

<p>One thing that I would like to include is the ROM provider. In particular I would like to know if the user is running a custom ROM and which, preferably even with the version number.</p>

<p>Any idea how to retrieve this information programmatically?</p>

<p>--- Taken from the Quintin (see below)</p>

<p><a href="http://code.google.com/p/cyanogen-updater/source/browse/trunk/src/cmupdaterapp/utils/SysUtils.java#19" rel="nofollow">http://code.google.com/p/cyanogen-updater/source/browse/trunk/src/cmupdaterapp/utils/SysUtils.java#19</a>:</p>

<pre><code>public static String getReadableModVersion() { 
  String modVer = getSystemProperty(Constants.SYS_PROP_MOD_VERSION); 
  return (modVer == null || modVer.length() == 0 ? "Unknown" : modVer); 
}
</code></pre>

<p>Whereby the constant is this: </p>

<pre><code>public static final String SYS_PROP_MOD_VERSION = "ro.modversion";
</code></pre>

<p>And here is the getSystemProperty();</p>

<pre><code>public static String getSystemProperty(String propName){
            String line;
            BufferedReader input = null;
    try
    {
            Process p = Runtime.getRuntime().exec("getprop " + propName);
        input = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024);
        line = input.readLine();
        input.close();
    }
    catch (IOException ex)
    {
            Log.e(TAG, "Unable to read sysprop " + propName, ex);
            return null;
    }
    finally
    {
            if(input != null)
            {
                            try
                            {
                                    input.close();
                            }
                            catch (IOException e)
                            {
                                    Log.e(TAG, "Exception while closing InputStream", e);
                            }
            }
    }
    return line;
}
</code></pre>

<p>Could anybody with a CM ROM can run this for me?</p>

<p>Btw. Careful, this is GPL code. I for one can not use it.
Any easier or non-GPL way?</p>
