2013-12-25 2 views

ответ

2

Я нашел, что запрос ro.product.brand с использованием getprop дает именно то, что мне нужно.

/** 
* Returns the ROM manufacturer. 
* 
* @return The ROM manufacturer, or NULL if not found. 
*/ 
public static String getROMManufacturer() { 
    String line; 
    BufferedReader input = null; 
    try { 
     Process p = Runtime.getRuntime().exec("getprop ro.product.brand"); 
     input = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024); 
     line = input.readLine(); 
     input.close(); 
    } 
    catch (IOException ex) { 
     Log.e(TAG, "Unable to read sysprop ro.product.brand", ex); 
     return null; 
    } 
    finally { 
     if (input != null) { 
      try { 
       input.close(); 
      } 
      catch (IOException e) { 
       Log.e(TAG, "Exception while closing InputStream", e); 
      } 
     } 
    } 
    return line; 
} 

Для фондовых дисков значение мы получаем обратно есть Google
Для SenseUI, например, мы получим назад HTC

выше метод будет возвращать только Google или HTC etc ...

Я надеюсь, что это помогло и кому-то еще.