@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) private static int initializeTimeout ( String property , int defaultValue ) { try { Class clazz = Class . forName ( "android.os.SystemProperties" ) ; Method method = clazz . getDeclaredMethod ( "get" , String . class ) ; String value = ( String ) method . invoke ( null , property ) ; return Integer . parseInt ( value ) ; } catch ( Exception e ) { return defaultValue ; } }
Parse a timeout value set using adb shell .