@SuppressWarnings("all") private boolean scanVersionLine(String line){
  if (line != null) {
    Matcher matcher=sAdbVersion.matcher(line);
    if (matcher.matches()) {
      int majorVersion=Integer.parseInt(matcher.group(1));
      int minorVersion=Integer.parseInt(matcher.group(2));
      int microVersion=Integer.parseInt(matcher.group(3));
      if (microVersion < ADB_VERSION_MICRO_MIN) {
        String message=String.format("Required minimum version of adb: %1$d.%2$d.%3$d." + "Current version is %1$d.%2$d.%4$d",majorVersion,minorVersion,ADB_VERSION_MICRO_MIN,microVersion);
        Log.logAndDisplay(LogLevel.ERROR,ADB,message);
      }
 else       if (ADB_VERSION_MICRO_MAX != -1 && microVersion > ADB_VERSION_MICRO_MAX) {
        String message=String.format("Required maximum version of adb: %1$d.%2$d.%3$d." + "Current version is %1$d.%2$d.%4$d",majorVersion,minorVersion,ADB_VERSION_MICRO_MAX,microVersion);
        Log.logAndDisplay(LogLevel.ERROR,ADB,message);
      }
 else {
        mVersionCheck=true;
      }
      return true;
    }
  }
  return false;
}

@ SuppressWarnings ( "all" ) private boolean scanVersionLine ( String line ) { if ( line != null ) { Matcher matcher = sAdbVersion . matcher ( line ) ; if ( matcher . matches ( ) ) { int majorVersion = Integer . parseInt ( matcher . group ( 1 ) ) ; int minorVersion = Integer . parseInt ( matcher . group ( 2 ) ) ; int microVersion = Integer . parseInt ( matcher . group ( 3 ) ) ; if ( microVersion < ADB_VERSION_MICRO_MIN ) { String message = String . format ( "Required minimum version of adb: %1$d.%2$d.%3$d." + "Current version is %1$d.%2$d.%4$d" , majorVersion , minorVersion , ADB_VERSION_MICRO_MIN , microVersion ) ; Log . logAndDisplay ( LogLevel . ERROR , ADB , message ) ; } else if ( ADB_VERSION_MICRO_MAX != - 1 && microVersion > ADB_VERSION_MICRO_MAX ) { String message = String . format ( "Required maximum version of adb: %1$d.%2$d.%3$d." + "Current version is %1$d.%2$d.%4$d" , majorVersion , minorVersion , ADB_VERSION_MICRO_MAX , microVersion ) ; Log . logAndDisplay ( LogLevel . ERROR , ADB , message ) ; } else { mVersionCheck = true ; } return true ; } } return false ; }
scans a line resulting from ' adb version ' for a potential version number . < p / > if a version number is found , it checks the version number against what is expected by this version of ddms . < p / > returns true when a version number has been found so that we can stop scanning , whether the version number is in the acceptable range or not .
