private boolean startCompactMode(String type){
  long timePassed=System.currentTimeMillis() - compactModeStart;
  if (timePassed > MAX_COMPACTMODE_TIME) {
    closeCompactMode();
  }
  if (!type.equals(compactMode)) {
    closeCompactMode();
  }
  if (compactMode == null) {
    compactMode=type;
    compactModeStart=System.currentTimeMillis();
    compactModeLength=0;
    return true;
  }
  return false;
}

private boolean startCompactMode ( String type ) { long timePassed = System . currentTimeMillis ( ) - compactModeStart ; if ( timePassed > MAX_COMPACTMODE_TIME ) { closeCompactMode ( ) ; } if ( ! type . equals ( compactMode ) ) { closeCompactMode ( ) ; } if ( compactMode == null ) { compactMode = type ; compactModeStart = System . currentTimeMillis ( ) ; compactModeLength = 0 ; return true ; } return false ; }
enters compact mode , closes it first if necessary .
