static public int computePasswordQuality(String password){
  boolean hasDigit=false;
  boolean hasNonDigit=false;
  final int len=password.length();
  for (int i=0; i < len; i++) {
    if (Character.isDigit(password.charAt(i))) {
      hasDigit=true;
    }
 else {
      hasNonDigit=true;
    }
  }
  if (hasNonDigit && hasDigit) {
    return DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC;
  }
  if (hasNonDigit) {
    return DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC;
  }
  if (hasDigit) {
    return DevicePolicyManager.PASSWORD_QUALITY_NUMERIC;
  }
  return DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
}

static public int computePasswordQuality ( String password ) { boolean hasDigit = false ; boolean hasNonDigit = false ; final int len = password . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { if ( Character . isDigit ( password . charAt ( i ) ) ) { hasDigit = true ; } else { hasNonDigit = true ; } } if ( hasNonDigit && hasDigit ) { return DevicePolicyManager . PASSWORD_QUALITY_ALPHANUMERIC ; } if ( hasNonDigit ) { return DevicePolicyManager . PASSWORD_QUALITY_ALPHABETIC ; } if ( hasDigit ) { return DevicePolicyManager . PASSWORD_QUALITY_NUMERIC ; } return DevicePolicyManager . PASSWORD_QUALITY_UNSPECIFIED ; }
compute the password quality from the given password string .
