public void updateStates() throws CpuStateMonitorException {
  _states.clear();
  try {
    String file=null;
    if (Utils.existFile(Utils.getsysfspath(CPU_TIME_IN_STATE_ARRAY,core)) || Utils.existFile(Utils.getsysfspath(CPU_TIME_IN_STATE_ARRAY,0))) {
      if (core > 0) {
        CPU.activateCore(core,true,null);
      }
      if (Utils.existFile(Utils.getsysfspath(CPU_TIME_IN_STATE_ARRAY,core))) {
        file=Utils.getsysfspath(CPU_TIME_IN_STATE_ARRAY,core);
      }
 else {
        file=Utils.getsysfspath(CPU_TIME_IN_STATE_ARRAY,0);
      }
    }
    if (file == null)     throw new CpuStateMonitorException("Problem opening time-in-states file");
    FileReader fileReader=new FileReader(file);
    BufferedReader bufferedReader=new BufferedReader(fileReader);
    readInStates(bufferedReader);
    fileReader.close();
    bufferedReader.close();
  }
 catch (  Exception e) {
    throw new CpuStateMonitorException("Problem opening time-in-states file");
  }
  long sleepTime=(SystemClock.elapsedRealtime() - SystemClock.uptimeMillis()) / 10;
  _states.add(new CpuState(0,sleepTime));
  Collections.sort(_states,Collections.reverseOrder());
}

public void updateStates ( ) throws CpuStateMonitorException { _states . clear ( ) ; try { String file = null ; if ( Utils . existFile ( Utils . getsysfspath ( CPU_TIME_IN_STATE_ARRAY , core ) ) || Utils . existFile ( Utils . getsysfspath ( CPU_TIME_IN_STATE_ARRAY , 0 ) ) ) { if ( core > 0 ) { CPU . activateCore ( core , true , null ) ; } if ( Utils . existFile ( Utils . getsysfspath ( CPU_TIME_IN_STATE_ARRAY , core ) ) ) { file = Utils . getsysfspath ( CPU_TIME_IN_STATE_ARRAY , core ) ; } else { file = Utils . getsysfspath ( CPU_TIME_IN_STATE_ARRAY , 0 ) ; } } if ( file == null ) throw new CpuStateMonitorException ( "Problem opening time-in-states file" ) ; FileReader fileReader = new FileReader ( file ) ; BufferedReader bufferedReader = new BufferedReader ( fileReader ) ; readInStates ( bufferedReader ) ; fileReader . close ( ) ; bufferedReader . close ( ) ; } catch ( Exception e ) { throw new CpuStateMonitorException ( "Problem opening time-in-states file" ) ; } long sleepTime = ( SystemClock . elapsedRealtime ( ) - SystemClock . uptimeMillis ( ) ) / 10 ; _states . add ( new CpuState ( 0 , sleepTime ) ) ; Collections . sort ( _states , Collections . reverseOrder ( ) ) ; }
list of all the cpu frequency states , which contains both a frequency and a duration ( time spent in that state
