de.unikassel.android.sdcframework.app
Class AbstractServiceControlActivity

Package class diagram package AbstractServiceControlActivity
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 de.unikassel.android.sdcframework.app.AbstractServiceControlActivity
All Implemented Interfaces:
ComponentCallbacks, KeyEvent.Callback, LayoutInflater.Factory, View.OnCreateContextMenuListener, Window.Callback
Direct Known Subclasses:
SDCServiceController

public abstract class AbstractServiceControlActivity
extends Activity

Base class for service control activities.


Field Summary
private  String action
          The service action name
private static String BAK_EXTENSION
          Extension for file backups.
private  ApplicationPreferenceManager prefManager
          The preference manager
private static int SELECT_EXT_DEFAULTS_FILE
          File selection dialog identifier for external defaults file selection.
private static int SELECT_EXT_RSA_PUBKEY_FILE
          File selection dialog identifier for pub key file selection.
private  Class<?> serviceClass
          The service class name
private  ServiceRunningStateListener serviceRunningStateListner
          The service running state listener
private static String TITLE_RSA_KEY_SELECTION
          Title for RSA key file selection.
private static String TITLE_XML_CONFIG_FILE_SELECTION
          Title for XML configuration key file selection.
 
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, BIND_NOT_FOREGROUND, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DROPBOX_SERVICE, 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, UI_MODE_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Constructor Summary
AbstractServiceControlActivity(Class<?> serviceClass)
          Constructor
 
Method Summary
 ApplicationPreferenceManager getPrefManager()
          Getter for preference manager
 Class<?> getServiceClass()
          Getter for the service class
protected  void onActivityResult(int requestCode, int resultCode, Intent data)
           
 boolean onCreateOptionsMenu(Menu menu)
           
protected  void onDestroy()
           
private  boolean onLoadDefaults()
          Method to handle the selection of "load external defaults" in the option menu.
private  boolean onLoadRSAPublicKey()
          Method to handle the selection of "load external defaults" in the option menu
 boolean onOptionsItemSelected(MenuItem item)
           
protected  void onPause()
           
protected  boolean onPreferences()
          Method to handle for selection of "preferences" in the option menu
 boolean onPrepareOptionsMenu(Menu menu)
           
protected  void onResume()
           
protected abstract  void onServiceRunningStateChanged(boolean isRunning)
          Handler to react on service running state changes.
 
Methods inherited from class android.app.Activity
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchKeyEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, 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, onApplyThemeResource, onAttachedToWindow, onBackPressed, onChildTitleChanged, onConfigurationChanged, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onDetachedFromWindow, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onNewIntent, onOptionsMenuClosed, onPanelClosed, onPostCreate, onPostResume, onPrepareDialog, onPrepareDialog, onPreparePanel, onRestart, onRestoreInstanceState, 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, 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, getExternalCacheDir, getExternalFilesDir, 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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceClass

private final Class<?> serviceClass
The service class name


action

private final String action
The service action name

See Also:
Constant Field Values

BAK_EXTENSION

private static final String BAK_EXTENSION
Extension for file backups.

See Also:
Constant Field Values

TITLE_RSA_KEY_SELECTION

private static final String TITLE_RSA_KEY_SELECTION
Title for RSA key file selection.

See Also:
Constant Field Values

TITLE_XML_CONFIG_FILE_SELECTION

private static final String TITLE_XML_CONFIG_FILE_SELECTION
Title for XML configuration key file selection.

See Also:
Constant Field Values

SELECT_EXT_RSA_PUBKEY_FILE

private static final int SELECT_EXT_RSA_PUBKEY_FILE
File selection dialog identifier for pub key file selection.

See Also:
Constant Field Values

SELECT_EXT_DEFAULTS_FILE

private static final int SELECT_EXT_DEFAULTS_FILE
File selection dialog identifier for external defaults file selection.

See Also:
Constant Field Values

serviceRunningStateListner

private final ServiceRunningStateListener serviceRunningStateListner
The service running state listener


prefManager

private final ApplicationPreferenceManager prefManager
The preference manager

Constructor Detail

AbstractServiceControlActivity

public AbstractServiceControlActivity(Class<?> serviceClass)
Constructor

Parameters:
serviceClass -
Method Detail

getServiceClass

public final Class<?> getServiceClass()
Getter for the service class

Returns:
the service class

getPrefManager

public final ApplicationPreferenceManager getPrefManager()
Getter for preference manager

Returns:
the preference manager

onLoadRSAPublicKey

private final boolean onLoadRSAPublicKey()
Method to handle the selection of "load external defaults" in the option menu

Returns:
true if successful, false otherwise

onLoadDefaults

private final boolean onLoadDefaults()
Method to handle the selection of "load external defaults" in the option menu.

Returns:
true if successful, false otherwise

onPreferences

protected boolean onPreferences()
Method to handle for selection of "preferences" in the option menu

Returns:
true if successful, false otherwise

onResume

protected void onResume()
Overrides:
onResume in class Activity

onPause

protected void onPause()
Overrides:
onPause in class Activity

onDestroy

protected void onDestroy()
Overrides:
onDestroy in class Activity

onCreateOptionsMenu

public boolean onCreateOptionsMenu(Menu menu)
Overrides:
onCreateOptionsMenu in class Activity

onPrepareOptionsMenu

public boolean onPrepareOptionsMenu(Menu menu)
Overrides:
onPrepareOptionsMenu in class Activity

onOptionsItemSelected

public boolean onOptionsItemSelected(MenuItem item)
Overrides:
onOptionsItemSelected in class Activity

onActivityResult

protected void onActivityResult(int requestCode,
                                int resultCode,
                                Intent data)
Overrides:
onActivityResult in class Activity

onServiceRunningStateChanged

protected abstract void onServiceRunningStateChanged(boolean isRunning)
Handler to react on service running state changes.

Parameters:
isRunning - running state flag