mobi.voiceassistant.client
Class AssistantAgent

java.lang.Object
  extended by android.content.Context
      extended by android.content.ContextWrapper
          extended by android.app.Service
              extended by mobi.voiceassistant.base.IntentExecutorService
                  extended by mobi.voiceassistant.base.Agent
                      extended by mobi.voiceassistant.client.AssistantAgent
All Implemented Interfaces:
ComponentCallbacks, ComponentCallbacks2

public abstract class AssistantAgent
extends Agent


Field Summary
static String ACTION_LIST
           
static String ACTION_START_ACTIVITY_FOR_RESULT
           
static String EXTRA_RESULT_RECEIVER
           
 
Fields inherited from class mobi.voiceassistant.base.Agent
ARG_REQUEST, ARG_RESPONSE
 
Fields inherited from class android.app.Service
START_CONTINUATION_MASK, START_FLAG_REDELIVERY, START_FLAG_RETRY, START_NOT_STICKY, START_REDELIVER_INTENT, START_STICKY, START_STICKY_COMPATIBILITY
 
Fields inherited from class android.content.Context
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_WAIVE_PRIORITY, BLUETOOTH_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_ROUTER_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, STORAGE_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, UI_MODE_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Fields inherited from interface android.content.ComponentCallbacks2
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
 
Constructor Summary
AssistantAgent()
           
 
Method Summary
protected  void onActivityResult(Bundle args, int requestCode, int resultCode, Intent data)
           
protected  void onActivityResult(Request request, Response response, int requestCode, int resultCode, Intent data)
           
 IBinder onBind(Intent intent)
           
protected  void onBubbleClick(Request request)
           
protected abstract  void onCommand(Request request)
          Override this method to handle voice commands for this agent issued by user.
protected  BubbleListAdapter onList(Uri uri, Bundle extras)
           
protected  void onRequest(String action, Request request)
          Override this method if you use custom actions for PendingRequest.
protected  void onWelcome(Request request)
           
protected  void startActivityForResult(Bundle args, Intent intent, int requestCode)
           
protected  void startActivityForResult(Request request, Response response, Intent intent, int requestCode)
           
protected  void startIntentSenderForResult(Bundle args, IntentSender intent, int requestCode)
           
protected  void startIntentSenderForResult(Request request, Response response, IntentSender intent, int requestCode)
           
 
Methods inherited from class mobi.voiceassistant.base.Agent
goBackground, goBackground, onBackground, onBackground, onExecute, onModalCancel, onModalFail
 
Methods inherited from class android.app.Service
dump, getApplication, onConfigurationChanged, onCreate, onDestroy, onLowMemory, onRebind, onStart, onStartCommand, onTaskRemoved, onTrimMemory, onUnbind, startForeground, stopForeground, stopSelf, stopSelf, stopSelfResult
 
Methods inherited from class android.content.ContextWrapper
attachBaseContext, bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createConfigurationContext, createDisplayContext, 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, getObbDir, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getSystemService, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setTheme, setWallpaper, setWallpaper, startActivities, startActivities, startActivity, startActivity, startInstrumentation, startIntentSender, startIntentSender, startService, stopService, unbindService, unregisterReceiver
 
Methods inherited from class android.content.Context
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_LIST

public static final String ACTION_LIST
See Also:
Constant Field Values

ACTION_START_ACTIVITY_FOR_RESULT

public static final String ACTION_START_ACTIVITY_FOR_RESULT
See Also:
Constant Field Values

EXTRA_RESULT_RECEIVER

public static final String EXTRA_RESULT_RECEIVER
See Also:
Constant Field Values
Constructor Detail

AssistantAgent

public AssistantAgent()
Method Detail

onCommand

protected abstract void onCommand(Request request)
Description copied from class: Agent
Override this method to handle voice commands for this agent issued by user. This method is called by Assistant when Request with AgentContract.Intents.ACTION_COMMAND arrives. Inside this method Request.getContent() returns instance of Token and Request.getDispatchId() returns id of command in corresponding module. Note that this method called on main thread.

Specified by:
onCommand in class Agent
See Also:
Agent.onModalCancel(Request), Agent.onModalFail(Request)

onRequest

protected void onRequest(String action,
                         Request request)
Description copied from class: Agent
Override this method if you use custom actions for PendingRequest. Default implementation calls Agent.onCommand(Request) for AgentContract.Intents.ACTION_COMMAND, Agent.onModalFail(Request) for AgentContract.Intents.ACTION_MODAL_FAIL and Agent.onModalCancel(Request) for AgentContract.Intents.ACTION_MODAL_CANCEL

Overrides:
onRequest in class Agent
Parameters:
action - The action from Request.getAction()
request - The request itself

onBubbleClick

protected void onBubbleClick(Request request)

onWelcome

protected void onWelcome(Request request)

onBind

public IBinder onBind(Intent intent)
Overrides:
onBind in class IntentExecutorService

onList

protected BubbleListAdapter onList(Uri uri,
                                   Bundle extras)

startActivityForResult

protected void startActivityForResult(Request request,
                                      Response response,
                                      Intent intent,
                                      int requestCode)

startActivityForResult

protected void startActivityForResult(Bundle args,
                                      Intent intent,
                                      int requestCode)

startIntentSenderForResult

protected void startIntentSenderForResult(Request request,
                                          Response response,
                                          IntentSender intent,
                                          int requestCode)

startIntentSenderForResult

protected void startIntentSenderForResult(Bundle args,
                                          IntentSender intent,
                                          int requestCode)

onActivityResult

protected void onActivityResult(Request request,
                                Response response,
                                int requestCode,
                                int resultCode,
                                Intent data)

onActivityResult

protected void onActivityResult(Bundle args,
                                int requestCode,
                                int resultCode,
                                Intent data)