BenchmarkActivity

br.usp.ime.dspbenchmarking.activities
Class BenchmarkActivity

java.lang.Object
  extended by android.content.Context
      extended by android.content.ContextWrapper
          extended by android.view.ContextThemeWrapper
              extended by android.app.Activity
                  extended by br.usp.ime.dspbenchmarking.activities.DspActivity
                      extended by br.usp.ime.dspbenchmarking.activities.TestActivity
                          extended by br.usp.ime.dspbenchmarking.activities.BenchmarkActivity
All Implemented Interfaces:
android.content.ComponentCallbacks, android.view.KeyEvent.Callback, android.view.LayoutInflater.Factory, android.view.View.OnCreateContextMenuListener, android.view.Window.Callback

public class BenchmarkActivity
extends TestActivity

ATTENTION: This class is currently not used. This is on of the reasons why is is not properly documented.


Nested Class Summary
protected  class BenchmarkActivity.TestControlThread
           
 
Field Summary
(package private) static int END_ALGORITHM
           
(package private) static int END_BLOCK_SIZE
           
private  long lastTotalTime
           
protected  int LOG_START_BLOCK_SIZE
           
private static int MAX_DSP_CYCLES
           
(package private)  android.os.Handler mHandler
          Recebe uma mensagem e executa uma das seguintes ações: - Inicia um teste
(package private) static int START_ALGORITHM
           
(package private) static int START_BLOCK_SIZE
           
protected  double totalProgress
           
 
Fields inherited from class br.usp.ime.dspbenchmarking.activities.TestActivity
algorithm, algorithmName, blockSize, blockSizeView, dateFormat, dirName, fileName, filePrefix, is, LOG2, maxDspCycles, mExternalStorageAvailable, mExternalStorageReceiver, mExternalStorageWriteable, os, progressBar, results, toggleTestsButton, workingBar
 
Fields inherited from class br.usp.ime.dspbenchmarking.activities.DspActivity
callbackPeriodView, cpuUsageBar, dspCallbackTimeView, dspCyclesView, dspCycleTimeBar, dspPeriodView, dt, elapsedTimeView, readCyclesView, sampleReadTimeView, sampleWriteTimeView, swt, totalTime, totalTimeView
 
Fields inherited from class android.app.Activity
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK
 
Fields inherited from class android.content.Context
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, INPUT_METHOD_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MODE_APPEND, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NOTIFICATION_SERVICE, POWER_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, TELEPHONY_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Constructor Summary
BenchmarkActivity()
           
 
Method Summary
private  void finishTests()
          Finaliza os testes realizando as seguintes ações: - Escreve o tempo total para a saída
 void onCreate(android.os.Bundle savedInstanceState)
          - Carrega a tela de testes
private  void releaseTest()
           
protected  void setupTests()
          Configura os testes: - abre um arquivo de áudio de entrada (no super)
protected  void startControlThread()
           
(package private)  void updateExternalStorageState()
          Verifica o estado do dispositivo de armazenamento.
private  void writeResults(int maxFiltersize)
           
 
Methods inherited from class br.usp.ime.dspbenchmarking.activities.TestActivity
getDspThreadInfo, getFileName, getOutputStream, initTests, launchTest, onBackPressed, releaseDspThread, toggleTests, turnOff, updateScreenInfo
 
Methods inherited from class android.app.Activity
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchKeyEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, finalize, findViewById, finish, finishActivity, finishActivityFromChild, finishFromChild, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getCurrentFocus, getInstanceCount, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLocalClassName, getMenuInflater, getParent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVolumeControlStream, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, getWindow, getWindowManager, hasWindowFocus, isChild, isFinishing, isTaskRoot, managedQuery, moveTaskToBack, onActivityResult, onApplyThemeResource, onAttachedToWindow, onChildTitleChanged, onConfigurationChanged, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onDestroy, onDetachedFromWindow, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onNewIntent, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPause, onPostCreate, onPostResume, onPrepareDialog, onPrepareOptionsMenu, onPreparePanel, onRestart, onRestoreInstanceState, onResume, onRetainNonConfigurationInstance, onSaveInstanceState, onSearchRequested, onStart, onStop, onTitleChanged, onTouchEvent, onTrackballEvent, onUserInteraction, onUserLeaveHint, onWindowAttributesChanged, onWindowFocusChanged, openContextMenu, openOptionsMenu, overridePendingTransition, registerForContextMenu, removeDialog, requestWindowFeature, runOnUiThread, setContentView, setContentView, setContentView, setDefaultKeyMode, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setIntent, setPersistent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, showDialog, startActivity, startActivityForResult, startActivityFromChild, startActivityIfNeeded, startIntentSender, startIntentSenderForResult, startIntentSenderFromChild, startManagingCursor, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterForContextMenu
 
Methods inherited from class android.view.ContextThemeWrapper
attachBaseContext, getTheme, setTheme
 
Methods inherited from class android.content.ContextWrapper
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getFilesDir, getFileStreamPath, getMainLooper, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getWallpaper, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, revokeUriPermission, sendBroadcast, sendBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendStickyBroadcast, sendStickyOrderedBroadcast, setWallpaper, setWallpaper, startInstrumentation, startService, stopService, unbindService, unregisterReceiver
 
Methods inherited from class android.content.Context
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DSP_CYCLES

private static final int MAX_DSP_CYCLES
See Also:
Constant Field Values

START_BLOCK_SIZE

static final int START_BLOCK_SIZE

END_BLOCK_SIZE

static final int END_BLOCK_SIZE

START_ALGORITHM

static final int START_ALGORITHM
See Also:
Constant Field Values

END_ALGORITHM

static final int END_ALGORITHM
See Also:
Constant Field Values

LOG_START_BLOCK_SIZE

protected final int LOG_START_BLOCK_SIZE

totalProgress

protected double totalProgress

lastTotalTime

private long lastTotalTime

mHandler

final android.os.Handler mHandler
Recebe uma mensagem e executa uma das seguintes ações: - Inicia um teste. - Libera um teste. - Finaliza os testes. - Configura os testes. - Escreve os resultados dos testes.

Constructor Detail

BenchmarkActivity

public BenchmarkActivity()
Method Detail

onCreate

public void onCreate(android.os.Bundle savedInstanceState)
- Carrega a tela de testes. - Define o prefixo do nome do arquivo. - Define o máximo de ciclos DSP. - Liga os testes.

Overrides:
onCreate in class TestActivity

updateExternalStorageState

void updateExternalStorageState()
                          throws java.io.IOException
Verifica o estado do dispositivo de armazenamento.

Overrides:
updateExternalStorageState in class TestActivity
Throws:
java.io.IOException

setupTests

protected void setupTests()
Configura os testes: - abre um arquivo de áudio de entrada (no super). - Inicia uma thread DSP com as seguintes configurações: - tamanho de bloco de this.blockSize, - algoritmo igual a this.algorithm, - stream de entrada igual a this.is, - numero máximo de ciclos dsp igual a this.MAX_DSP_CYCLES.

Overrides:
setupTests in class TestActivity

releaseTest

private void releaseTest()

finishTests

private void finishTests()
Finaliza os testes realizando as seguintes ações: - Escreve o tempo total para a saída. - Fecha os stream de entrada. - Libera a thread DSP atual.


writeResults

private void writeResults(int maxFiltersize)

startControlThread

protected void startControlThread()
Specified by:
startControlThread in class TestActivity