com.ugrokit.api.UgiConfigurationDelegate Interface Reference

Overview


A UgiConfigurationDelegate object is set in the Ugi singleton object to handle configuration events including firmware update, region setting and automatic device configuration (for unrecognized Android android_devices).

By default, a UgiDefaultConfigurationUi object is used for this. To customize configuration functionality, an application will generally subclass UgiDefaultConfigurationUi.

Public Member Functions

void waitUntilReady (final Runnable completion)
 
Wait until the delegate is able to handle other calls More...
 
boolean getSendGrokkerSerialNumber ()
 See whether the Grokker serial number should ever be sent to the U Grok It server (default = true) More...
 
void setSendGrokkerSerialNumber (boolean sendGrokkerSerialNumber)
 Set whether the Grokker serial number should ever be sent to the U Grok It server. More...
 
void permissionNeeded (final Runnable completion)
 
Notify the user that permissions are needed (Marshmallow and beyond) and and for the permission More...
 
void notifyPermissionRequestFailed (final Runnable completion)
 
Notify the user that the user did not grant permissions More...
 
void notifyAutoRotateOff (final Runnable completion)
 
Notify the user that auto rotate is off More...
 
void showUserMessageBeforeFirstConnect (String message, final Runnable completion)
 
Notify the user of a message before first connection More...
 
void promptAudioJackLocation ()
 Prompt for changing the audio jack setting.
 
void notifyCantSetVolume (final Runnable completion)
 
Notify the user that we can't set the volume, so the user needs to More...
 
void cancelNotifyCantSetVolume ()
 Cancel any notifyCantSetVolume() message.
 
boolean getCheckServerForUnknownDevices ()
 See whether the U Grok It server should be checked if the Android device is not recognized (default = true) More...
 
void setCheckServerForUnknownDevices (boolean checkServerForUnknownDevices)
 Set whether the U Grok It server should be checked if the Android device is not recognized. More...
 
boolean getSendFirstConnectionAndAutomaticConfigurationReports ()
 See whether first-connection and automatic-configuration reports should be sent to the U Grok It server (default = true) More...
 
void setSendFirstConnectionAndAutomaticConfigurationReports (boolean sendFirstConnectionAndAutomaticConfigurationReports)
 Set whether first connection and automatic configuration reports should be sent. More...
 
void autoConfigurationProgress (boolean isPluggedIn, AudioConnectionParams params, int configNum, int progressForConfig, int totalForConfig)
 Notification that automatic configuration is in progress. More...
 
void autoConfigurationCompleted (boolean success, AudioConnectionParams params, int elapsedSeconds)
 Notification that automatic configuration has completed. More...
 
void promptAudioReconfiguration ()
 Prompt the user about audio configuration.
 
boolean getDoAutomaticFirmwareUpdate ()
 See whether automatic firmware update checks will be run (default = true) More...
 
void setDoAutomaticFirmwareUpdate (boolean doAutomaticFirmwareUpdate)
 Set whether the Grokker firmware should be automatically updated via checking the U Grok It server. More...
 
void promptForFirmwareUpdate (UgiFirmwareUpdateInfo info, final Runnable updateCompletion, final Runnable cancelCompletion, final Runnable postponeCompletion)
 
A firmware update is available. More...
 
void notifyFirmwareUpdateErrorLoadingUpdate (final Runnable completion)
 
Notify the user that there was an error loading the firmware update. More...
 
void displayFirmwareUpdateProgress (final Runnable cancelCompletion)
 
Display progress notification about the firmware update More...
 
void updateFirmwareUpdateProgress (int amountDone, int amountTotal, boolean canCancel)
 
Update the progress notification about the firmware update More...
 
void notifyFirmwareUpdateSuccess (int seconds, final Runnable completion)
 
Notify the user the firmware update completed successfully More...
 
void notifyFirmwareUpdateFailure (boolean mustRetry, Ugi.FirmwareUpdateReturnValues error, final Runnable retryCompletion, final Runnable cancelCompletion)
 
Notify the user that the firmware update failed More...
 
void abortFirmwareUpdateInteraction ()
 
Abort firmware update (Grokker has been disconnected)
 
void afterFirmwareUpdate (boolean updated)
 
Firmware update sequence has finished More...
 
void startBackgroundAction (WaitingCauses cause)
 
Notification that a background action is starting. More...
 
void finishBackgroundAction ()
 
Notification that a background action finished
 

Classes

enum  WaitingCauses
 
Type passed to startBackgroundAction: More...
 

Member Function Documentation

◆ waitUntilReady()

void com.ugrokit.api.UgiConfigurationDelegate.waitUntilReady ( final Runnable  completion)


Wait until the delegate is able to handle other calls

Parameters
completionBlock to execute when ready to handle other calls

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ getSendGrokkerSerialNumber()

boolean com.ugrokit.api.UgiConfigurationDelegate.getSendGrokkerSerialNumber ( )

See whether the Grokker serial number should ever be sent to the U Grok It server (default = true)

Returns
true if the Grokker serial number should ever be sent to the U Grok It server

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ setSendGrokkerSerialNumber()

void com.ugrokit.api.UgiConfigurationDelegate.setSendGrokkerSerialNumber ( boolean  sendGrokkerSerialNumber)

Set whether the Grokker serial number should ever be sent to the U Grok It server.

Parameters
sendGrokkerSerialNumbertrue to allow the Grokker serial number to be sent to the U Grok It server

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ permissionNeeded()

void com.ugrokit.api.UgiConfigurationDelegate.permissionNeeded ( final Runnable  completion)


Notify the user that permissions are needed (Marshmallow and beyond) and and for the permission

Parameters
completionBlock to execute when notification is complete

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ notifyPermissionRequestFailed()

void com.ugrokit.api.UgiConfigurationDelegate.notifyPermissionRequestFailed ( final Runnable  completion)


Notify the user that the user did not grant permissions

Parameters
completionBlock to execute when notification is complete

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ notifyAutoRotateOff()

void com.ugrokit.api.UgiConfigurationDelegate.notifyAutoRotateOff ( final Runnable  completion)


Notify the user that auto rotate is off

Parameters
completionBlock to execute when notification is complete

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ showUserMessageBeforeFirstConnect()

void com.ugrokit.api.UgiConfigurationDelegate.showUserMessageBeforeFirstConnect ( String  message,
final Runnable  completion 
)


Notify the user of a message before first connection

Parameters
messageThe message to show
completionBlock to execute when notification is complete

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ notifyCantSetVolume()

void com.ugrokit.api.UgiConfigurationDelegate.notifyCantSetVolume ( final Runnable  completion)


Notify the user that we can't set the volume, so the user needs to

Parameters
completionBlock to execute when notification is complete

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ getCheckServerForUnknownDevices()

boolean com.ugrokit.api.UgiConfigurationDelegate.getCheckServerForUnknownDevices ( )

See whether the U Grok It server should be checked if the Android device is not recognized (default = true)

Returns
true if the server should be checked

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ setCheckServerForUnknownDevices()

void com.ugrokit.api.UgiConfigurationDelegate.setCheckServerForUnknownDevices ( boolean  checkServerForUnknownDevices)

Set whether the U Grok It server should be checked if the Android device is not recognized.

Parameters
checkServerForUnknownDevicestrue if the server should be checked

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ getSendFirstConnectionAndAutomaticConfigurationReports()

boolean com.ugrokit.api.UgiConfigurationDelegate.getSendFirstConnectionAndAutomaticConfigurationReports ( )

See whether first-connection and automatic-configuration reports should be sent to the U Grok It server (default = true)

Returns
true if the server should be checked

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ setSendFirstConnectionAndAutomaticConfigurationReports()

void com.ugrokit.api.UgiConfigurationDelegate.setSendFirstConnectionAndAutomaticConfigurationReports ( boolean  sendFirstConnectionAndAutomaticConfigurationReports)

Set whether first connection and automatic configuration reports should be sent.

Parameters
sendFirstConnectionAndAutomaticConfigurationReportstrue if first connection and automatic configuration reports should be sent

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ autoConfigurationProgress()

void com.ugrokit.api.UgiConfigurationDelegate.autoConfigurationProgress ( boolean  isPluggedIn,
AudioConnectionParams  params,
int  configNum,
int  progressForConfig,
int  totalForConfig 
)

Notification that automatic configuration is in progress.

Parameters
isPluggedIntrue if something is plugged in (wait until this is true to display an alert)
paramsAudio parameters being tried currently
configNumConfiguration number being tried
progressForConfigStep # with this configuration
totalForConfigTotal # of steps for this configuration

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ autoConfigurationCompleted()

void com.ugrokit.api.UgiConfigurationDelegate.autoConfigurationCompleted ( boolean  success,
AudioConnectionParams  params,
int  elapsedSeconds 
)

Notification that automatic configuration has completed.

Parameters
successtrue if successful
paramsAudio parameters
elapsedSecondsTime required for automatic configuration

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ getDoAutomaticFirmwareUpdate()

boolean com.ugrokit.api.UgiConfigurationDelegate.getDoAutomaticFirmwareUpdate ( )

See whether automatic firmware update checks will be run (default = true)

Returns
true if automatic firmware update checks are being run

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ setDoAutomaticFirmwareUpdate()

void com.ugrokit.api.UgiConfigurationDelegate.setDoAutomaticFirmwareUpdate ( boolean  doAutomaticFirmwareUpdate)

Set whether the Grokker firmware should be automatically updated via checking the U Grok It server.

Parameters
doAutomaticFirmwareUpdatetrue if the Grokker firmware should be automatically updated

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ promptForFirmwareUpdate()

void com.ugrokit.api.UgiConfigurationDelegate.promptForFirmwareUpdate ( UgiFirmwareUpdateInfo  info,
final Runnable  updateCompletion,
final Runnable  cancelCompletion,
final Runnable  postponeCompletion 
)


A firmware update is available.

Prompt the user for whether to update. If the app does not want to update now, return NO call the Ugi method repromptForAutomaticFirmwareUpdateIfAvailable at some point.

Parameters
infoInformation about the firmware update that is available
updateCompletionBlock to execute to do the update
cancelCompletionBlock to execute if the user cancels
postponeCompletionBlock to to postpone until later

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ notifyFirmwareUpdateErrorLoadingUpdate()

void com.ugrokit.api.UgiConfigurationDelegate.notifyFirmwareUpdateErrorLoadingUpdate ( final Runnable  completion)


Notify the user that there was an error loading the firmware update.

Parameters
completionBlock to execute after notification

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ displayFirmwareUpdateProgress()

void com.ugrokit.api.UgiConfigurationDelegate.displayFirmwareUpdateProgress ( final Runnable  cancelCompletion)


Display progress notification about the firmware update

Parameters
cancelCompletionBlock to execute if the user cancels

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ updateFirmwareUpdateProgress()

void com.ugrokit.api.UgiConfigurationDelegate.updateFirmwareUpdateProgress ( int  amountDone,
int  amountTotal,
boolean  canCancel 
)


Update the progress notification about the firmware update

Parameters
amountDoneAmmount of the firmware update that is done
amountTotalAmmount of the firmware update total
canCancelYES if the user can cancel at this point

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ notifyFirmwareUpdateSuccess()

void com.ugrokit.api.UgiConfigurationDelegate.notifyFirmwareUpdateSuccess ( int  seconds,
final Runnable  completion 
)


Notify the user the firmware update completed successfully

Parameters
secondsNumber of seconds that the update took
completionBlock to execute after notification

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ notifyFirmwareUpdateFailure()

void com.ugrokit.api.UgiConfigurationDelegate.notifyFirmwareUpdateFailure ( boolean  mustRetry,
Ugi.FirmwareUpdateReturnValues  error,
final Runnable  retryCompletion,
final Runnable  cancelCompletion 
)


Notify the user that the firmware update failed

Parameters
mustRetryYES of the user must retry (do not present a Cancel option)
errorError value
retryCompletionBlock to execute to retry the update 9nil if the update cannot be retried)
cancelCompletionBlock to execute if the user cancels

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ afterFirmwareUpdate()

void com.ugrokit.api.UgiConfigurationDelegate.afterFirmwareUpdate ( boolean  updated)


Firmware update sequence has finished

Parameters
updatedtrue if update succeeded

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

◆ startBackgroundAction()

void com.ugrokit.api.UgiConfigurationDelegate.startBackgroundAction ( WaitingCauses  cause)


Notification that a background action is starting.

Display a "waiting" alert

Parameters
causeAction that is about to start

Implemented in com.ugrokit.api.UgiDefaultConfigurationUi.

com.ugrokit.api.UgiConfigurationDelegate.WaitingCauses Enum Reference

Overview


Type passed to startBackgroundAction:

Public Attributes

 Generic
 Generic.
 
 LoadingFirmwareUpdate
 loading a firmware update
 
 LoadingRegions
 loading regions
 
 SettingRegion
 setting the region
 
 StartingUpdate
 starting an update
 
 LoadingDeviceList
 loading he device list