public class SayMyTextService
extends android.app.Service
implements android.speech.tts.TextToSpeech.OnInitListener, android.content.SharedPreferences.OnSharedPreferenceChangeListener
| Modifier and Type | Class and Description |
|---|---|
static interface |
SayMyTextService.Function |
| Modifier and Type | Field and Description |
|---|---|
static String |
ACTION_CONFIRM_SMS_SENDING |
static String |
ACTION_DICTATE_SMS |
static String |
ACTION_MANAGE_BT_DEVICE |
static String |
ACTION_READ_NEXT_SMS |
static String |
ACTION_READ_SMS |
static String |
ACTION_REASK_ACTION |
protected static String |
ASK_NEXT_ACTION_UTTERANCE_ID |
protected android.media.AudioManager |
audioManager |
protected List<SMS> |
awaitingTexts
texts to read, received before the textospeech is ready or while a call is in progress
|
protected Map<android.bluetooth.BluetoothDevice,Integer> |
bluetoothDevices
bluetooth devices which are currently connected
|
protected static String |
BT_ASK_NEXT_ACTION_UTTERANCE_ID
utterance id when the bluetooth device is connected
|
protected android.telephony.PhoneStateListener |
callStateListener
Listener to call state change
|
protected Boolean |
canSpeak
null if the texttospeech is not initialized
|
protected boolean |
heisendroidModeEnabled |
static String |
INTENT_EXTRA_ADD_BT_DEVICE
If true, the device has just connected, else disconnected
|
static String |
INTENT_EXTRA_ATTEMPT_NUMBER
Attempt number: if set, it means that the user said something not understandable, so ask again
|
static String |
INTENT_EXTRA_BT_DEVICE
Bluetooth device which has just connected or disconnected
|
static String |
INTENT_EXTRA_DICTATED_MESSAGE
Bluetooth device which has just connected or disconnected
|
static String |
INTENT_EXTRA_SMS
SMS to read
|
protected boolean |
interactionEnabled |
protected int |
maxAttemptNumber |
protected boolean |
musicWasActive |
protected static String |
OTHER_UTTERANCE_ID |
protected String |
readingProfile |
protected boolean |
speakerWasOn |
protected android.speech.tts.TextToSpeech |
textToSpeech |
START_CONTINUATION_MASK, START_FLAG_REDELIVERY, START_FLAG_RETRY, START_NOT_STICKY, START_REDELIVER_INTENT, START_STICKY, START_STICKY_COMPATIBILITYACCESSIBILITY_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, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_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, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICE| Constructor and Description |
|---|
SayMyTextService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
askForActionAfterReading(SMS sms,
boolean btConnected,
int attemptNumber) |
protected void |
askSendingConfirmation(String message,
SMS originSms,
int attemptNumber) |
protected void |
dictateSMS(SMS sms,
int attemptNumber) |
android.os.IBinder |
onBind(android.content.Intent intent) |
void |
onCreate() |
void |
onDestroy() |
void |
onInit(int status) |
void |
onSharedPreferenceChanged(android.content.SharedPreferences sharedPreferences,
String key) |
int |
onStartCommand(android.content.Intent intent,
int flags,
int startId) |
protected void |
readText(SMS sms,
boolean btConnected)
Reads the texts out loud
|
protected void |
requestBluetoothSpeakingActivation(SayMyTextService.Function callback)
Starts the connection with the bluetooth device and requests the reading
|
protected void |
requestReading(SMS sms)
Requests the reading of one text through the wired headset or bluetooth device
|
protected void |
setCanSpeak(Boolean canSpeak)
Sets if the texts can be read
|
dump, getApplication, onConfigurationChanged, onLowMemory, onRebind, onStart, onTaskRemoved, onTrimMemory, onUnbind, startForeground, stopForeground, stopSelf, stopSelf, stopSelfResultattachBaseContext, 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, getObbDir, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getSystemService, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, revokeUriPermission, sendBroadcast, sendBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendStickyBroadcast, sendStickyOrderedBroadcast, setTheme, setWallpaper, setWallpaper, startActivities, startActivities, startActivity, startActivity, startInstrumentation, startIntentSender, startIntentSender, startService, stopService, unbindService, unregisterReceiverpublic static final String ACTION_READ_SMS
public static final String ACTION_READ_NEXT_SMS
public static final String ACTION_MANAGE_BT_DEVICE
public static final String ACTION_REASK_ACTION
public static final String ACTION_DICTATE_SMS
public static final String ACTION_CONFIRM_SMS_SENDING
public static final String INTENT_EXTRA_SMS
public static final String INTENT_EXTRA_BT_DEVICE
public static final String INTENT_EXTRA_ADD_BT_DEVICE
public static final String INTENT_EXTRA_DICTATED_MESSAGE
public static final String INTENT_EXTRA_ATTEMPT_NUMBER
protected static final String BT_ASK_NEXT_ACTION_UTTERANCE_ID
protected static final String ASK_NEXT_ACTION_UTTERANCE_ID
protected static final String OTHER_UTTERANCE_ID
protected int maxAttemptNumber
protected String readingProfile
protected boolean heisendroidModeEnabled
protected boolean interactionEnabled
protected android.media.AudioManager audioManager
protected Boolean canSpeak
protected boolean musicWasActive
protected boolean speakerWasOn
protected android.speech.tts.TextToSpeech textToSpeech
protected List<SMS> awaitingTexts
protected Map<android.bluetooth.BluetoothDevice,Integer> bluetoothDevices
protected final android.telephony.PhoneStateListener callStateListener
public void onCreate()
onCreate in class android.app.Servicepublic void onDestroy()
onDestroy in class android.app.Servicepublic android.os.IBinder onBind(android.content.Intent intent)
onBind in class android.app.Servicepublic int onStartCommand(android.content.Intent intent,
int flags,
int startId)
onStartCommand in class android.app.Servicepublic void onInit(int status)
onInit in interface android.speech.tts.TextToSpeech.OnInitListenerprotected void setCanSpeak(Boolean canSpeak)
canSpeak - null if the texttospeech is not ready,
false if a call is in progress
true otherwiseprotected void requestReading(SMS sms)
sms - the text to readprotected void requestBluetoothSpeakingActivation(SayMyTextService.Function callback)
callback - the function called when the bluetooth is readyprotected void readText(SMS sms, boolean btConnected)
sms - the text to readbtConnected - if true, adds the utterance id for the bluetooth deviceprotected void askForActionAfterReading(SMS sms, boolean btConnected, int attemptNumber)
protected void dictateSMS(SMS sms, int attemptNumber)
protected void askSendingConfirmation(String message, SMS originSms, int attemptNumber)
public void onSharedPreferenceChanged(android.content.SharedPreferences sharedPreferences,
String key)
onSharedPreferenceChanged in interface android.content.SharedPreferences.OnSharedPreferenceChangeListenerCopyright © 2014 CodeLutin. All rights reserved.