public void onDestroy() { super.onDestroy(); ((TelephonyManager) getSystemService("phone")).listen(this.callStateListener, 0); this.textToSpeech.shutdown(); PreferenceManager.getDefaultSharedPreferences(this).unregisterOnSharedPreferenceChangeListener(this); } public IBinder onBind(Intent intent) { return null; } public int onStartCommand(Intent intent, int flags, int startId) { boolean readingEnabled; int result = super.onStartCommand(intent, flags, startId); if (!SayMyTextsUtils.checkVoiceRecognition(this)) { PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(getString(R.string.preference_enable_interaction_key), false).commit(); } if (intent == null) { return result; } String action = intent.getAction(); Log.d(TAG, "action " + action); SMS sms = (SMS) intent.getSerializableExtra("sms"); int attemptNumber = intent.getIntExtra("attemptNumber", 0); char c = 65535; switch (action.hashCode()) { case -2074044598: if (action.equals(ACTION_READ_NEXT_SMS)) { c = 4; break; }