Remove the deprecated things from Config.java. These havent been working since before 1.0.
Change-Id: I097f48d9eec969553b34765a48ed652ea16c1a98
diff --git a/src/com/android/voicedialer/CommandRecognizerEngine.java b/src/com/android/voicedialer/CommandRecognizerEngine.java
index b234c4b..166527e 100644
--- a/src/com/android/voicedialer/CommandRecognizerEngine.java
+++ b/src/com/android/voicedialer/CommandRecognizerEngine.java
@@ -26,7 +26,6 @@
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.Contacts;
import android.speech.srec.Recognizer;
-import android.util.Config;
import android.util.Log;
import java.io.File;
import java.io.FileFilter;
@@ -119,8 +118,8 @@
protected void setupGrammar() throws IOException, InterruptedException {
// fetch the contact list
- if (Config.LOGD) Log.d(TAG, "start getVoiceContacts");
- if (Config.LOGD) Log.d(TAG, "contactsFile is " + (mContactsFile == null ?
+ if (false) Log.d(TAG, "start getVoiceContacts");
+ if (false) Log.d(TAG, "contactsFile is " + (mContactsFile == null ?
"null" : "not null"));
List<VoiceContact> contacts = mContactsFile != null ?
VoiceContact.getVoiceContactsFromFile(mContactsFile) :
@@ -142,12 +141,12 @@
}
// load the empty Grammar
- if (Config.LOGD) Log.d(TAG, "start new Grammar");
+ if (false) Log.d(TAG, "start new Grammar");
mSrecGrammar = mSrec.new Grammar(SREC_DIR + "/grammars/VoiceDialer.g2g");
mSrecGrammar.setupRecognizer();
// reset slots
- if (Config.LOGD) Log.d(TAG, "start grammar.resetAllSlots");
+ if (false) Log.d(TAG, "start grammar.resetAllSlots");
mSrecGrammar.resetAllSlots();
// add names to the grammar
@@ -159,18 +158,18 @@
}
// compile the grammar
- if (Config.LOGD) Log.d(TAG, "start grammar.compile");
+ if (false) Log.d(TAG, "start grammar.compile");
mSrecGrammar.compile();
// update g2g file
- if (Config.LOGD) Log.d(TAG, "start grammar.save " + g2g.getPath());
+ if (false) Log.d(TAG, "start grammar.save " + g2g.getPath());
g2g.getParentFile().mkdirs();
mSrecGrammar.save(g2g.getPath());
}
// g2g file exists, but is not loaded
else if (mSrecGrammar == null) {
- if (Config.LOGD) Log.d(TAG, "start new Grammar loading " + g2g);
+ if (false) Log.d(TAG, "start new Grammar loading " + g2g);
mSrecGrammar = mSrec.new Grammar(g2g.getPath());
mSrecGrammar.setupRecognizer();
}
@@ -187,7 +186,7 @@
*/
private void addNameEntriesToGrammar(List<VoiceContact> contacts)
throws InterruptedException {
- if (Config.LOGD) Log.d(TAG, "addNameEntriesToGrammar " + contacts.size());
+ if (false) Log.d(TAG, "addNameEntriesToGrammar " + contacts.size());
HashSet<String> entries = new HashSet<String>();
StringBuffer sb = new StringBuffer();
@@ -221,7 +220,7 @@
* add a list of application labels to the 'open x' grammar
*/
private void loadOpenEntriesTable() throws InterruptedException, IOException {
- if (Config.LOGD) Log.d(TAG, "addOpenEntriesToGrammar");
+ if (false) Log.d(TAG, "addOpenEntriesToGrammar");
// fill this
File oe = mActivity.getFileStreamPath(OPEN_ENTRIES);
@@ -278,7 +277,7 @@
}
// write list
- if (Config.LOGD) Log.d(TAG, "addOpenEntriesToGrammar writing " + oe);
+ if (false) Log.d(TAG, "addOpenEntriesToGrammar writing " + oe);
try {
FileOutputStream fos = new FileOutputStream(oe);
try {
@@ -296,7 +295,7 @@
// read the list
else {
- if (Config.LOGD) Log.d(TAG, "addOpenEntriesToGrammar reading " + oe);
+ if (false) Log.d(TAG, "addOpenEntriesToGrammar reading " + oe);
try {
FileInputStream fis = new FileInputStream(oe);
try {
@@ -451,7 +450,7 @@
File[] files = context.getFilesDir().listFiles(ff);
if (files != null) {
for (File file : files) {
- if (Config.LOGD) Log.d(TAG, "deleteAllG2GFiles " + file);
+ if (false) Log.d(TAG, "deleteAllG2GFiles " + file);
file.delete();
}
}
@@ -465,7 +464,7 @@
public static void deleteCachedGrammarFiles(Context context) {
deleteAllG2GFiles(context);
File oe = context.getFileStreamPath(OPEN_ENTRIES);
- if (Config.LOGD) Log.v(TAG, "deleteCachedGrammarFiles " + oe);
+ if (false) Log.v(TAG, "deleteCachedGrammarFiles " + oe);
if (oe.exists()) oe.delete();
}
@@ -934,7 +933,7 @@
*/
protected void onRecognitionSuccess(RecognizerClient recognizerClient)
throws InterruptedException {
- if (Config.LOGD) Log.d(TAG, "onRecognitionSuccess");
+ if (false) Log.d(TAG, "onRecognitionSuccess");
if (mLogger != null) mLogger.logNbestHeader();
@@ -953,11 +952,11 @@
String literal = mSrec.getResult(result, Recognizer.KEY_LITERAL);
String semantic = mSrec.getResult(result, Recognizer.KEY_MEANING);
String msg = "conf=" + conf + " lit=" + literal + " sem=" + semantic;
- if (Config.LOGD) Log.d(TAG, msg);
+ if (false) Log.d(TAG, msg);
int confInt = Integer.parseInt(conf);
if (highestConfidence < confInt) highestConfidence = confInt;
if (confInt < MINIMUM_CONFIDENCE || confInt * 2 < highestConfidence) {
- if (Config.LOGD) Log.d(TAG, "confidence too low, dropping");
+ if (false) Log.d(TAG, "confidence too low, dropping");
break;
}
if (mLogger != null) mLogger.logLine(msg);
@@ -1131,7 +1130,7 @@
}
addIntent(intents, intent);
} catch (URISyntaxException e) {
- if (Config.LOGD) {
+ if (false) {
Log.d(TAG, "onRecognitionSuccess: poorly " +
"formed URI in grammar" + e);
}
@@ -1175,7 +1174,7 @@
// can't parse result
else {
- if (Config.LOGD) Log.d(TAG, "onRecognitionSuccess: parse error");
+ if (false) Log.d(TAG, "onRecognitionSuccess: parse error");
}
}
diff --git a/src/com/android/voicedialer/PhoneTypeChoiceRecognizerEngine.java b/src/com/android/voicedialer/PhoneTypeChoiceRecognizerEngine.java
index 58fe416..6ae73d5 100644
--- a/src/com/android/voicedialer/PhoneTypeChoiceRecognizerEngine.java
+++ b/src/com/android/voicedialer/PhoneTypeChoiceRecognizerEngine.java
@@ -15,7 +15,6 @@
*/
package com.android.voicedialer;
-import android.util.Config;
import android.util.Log;
import android.content.Intent;
import android.speech.srec.Recognizer;
@@ -33,7 +32,7 @@
protected void setupGrammar() throws IOException, InterruptedException {
if (mSrecGrammar == null) {
- if (Config.LOGD) Log.d(TAG, "start new Grammar");
+ if (false) Log.d(TAG, "start new Grammar");
mSrecGrammar = mSrec.new Grammar(SREC_DIR + "/grammars/phone_type_choice.g2g");
mSrecGrammar.setupRecognizer();
}
@@ -47,7 +46,7 @@
* @param recognizerClient the client that will be sent the results
*/
protected void onRecognitionSuccess(RecognizerClient recognizerClient) throws InterruptedException {
- if (Config.LOGD) Log.d(TAG, "onRecognitionSuccess " + mSrec.getResultCount());
+ if (false) Log.d(TAG, "onRecognitionSuccess " + mSrec.getResultCount());
if (mLogger != null) mLogger.logNbestHeader();
@@ -61,7 +60,7 @@
String literal = mSrec.getResult(result, Recognizer.KEY_LITERAL);
String semantic = mSrec.getResult(result, Recognizer.KEY_MEANING);
String msg = "conf=" + conf + " lit=" + literal + " sem=" + semantic;
- if (Config.LOGD) Log.d(TAG, msg);
+ if (false) Log.d(TAG, msg);
}
// we only pay attention to the first result.
@@ -71,7 +70,7 @@
String literal = mSrec.getResult(0, Recognizer.KEY_LITERAL);
String semantic = mSrec.getResult(0, Recognizer.KEY_MEANING);
String msg = "conf=" + conf + " lit=" + literal + " sem=" + semantic;
- if (Config.LOGD) Log.d(TAG, msg);
+ if (false) Log.d(TAG, msg);
if (mLogger != null) mLogger.logLine(msg);
if (("H".equalsIgnoreCase(semantic)) ||
@@ -80,7 +79,7 @@
("O".equalsIgnoreCase(semantic)) ||
("R".equalsIgnoreCase(semantic)) ||
("X".equalsIgnoreCase(semantic))) {
- if (Config.LOGD) Log.d(TAG, " got valid response");
+ if (false) Log.d(TAG, " got valid response");
Intent intent = new Intent(RecognizerEngine.ACTION_RECOGNIZER_RESULT, null);
intent.putExtra(RecognizerEngine.SENTENCE_EXTRA, literal);
intent.putExtra(RecognizerEngine.SEMANTIC_EXTRA, semantic);
@@ -97,11 +96,11 @@
if (Thread.interrupted()) throw new InterruptedException();
if (intents.size() == 0) {
- if (Config.LOGD) Log.d(TAG, " no intents");
+ if (false) Log.d(TAG, " no intents");
recognizerClient.onRecognitionFailure("No Intents generated");
}
else {
- if (Config.LOGD) Log.d(TAG, " success");
+ if (false) Log.d(TAG, " success");
recognizerClient.onRecognitionSuccess(
intents.toArray(new Intent[intents.size()]));
}
diff --git a/src/com/android/voicedialer/RecognizerEngine.java b/src/com/android/voicedialer/RecognizerEngine.java
index 9019c87..3f39884 100644
--- a/src/com/android/voicedialer/RecognizerEngine.java
+++ b/src/com/android/voicedialer/RecognizerEngine.java
@@ -21,7 +21,6 @@
import android.speech.srec.MicrophoneInputStream;
import android.speech.srec.Recognizer;
import android.speech.srec.WaveHeader;
-import android.util.Config;
import android.util.Log;
import java.io.File;
import java.io.FileInputStream;
@@ -133,7 +132,7 @@
}
// create a new recognizer
- if (Config.LOGD) Log.d(TAG, "start new Recognizer");
+ if (false) Log.d(TAG, "start new Recognizer");
if (mSrec == null) {
String parFilePath = SREC_DIR + "/baseline11k.par";
if (sampleRate == 8000) {
@@ -144,12 +143,12 @@
// start audio input
if (micFile != null) {
- if (Config.LOGD) Log.d(TAG, "using mic file");
+ if (false) Log.d(TAG, "using mic file");
mic = new FileInputStream(micFile);
WaveHeader hdr = new WaveHeader();
hdr.read(mic);
} else {
- if (Config.LOGD) Log.d(TAG, "start new MicrophoneInputStream");
+ if (false) Log.d(TAG, "start new MicrophoneInputStream");
mic = new MicrophoneInputStream(sampleRate, sampleRate * 15);
}
@@ -162,7 +161,7 @@
setupGrammar();
// start the recognition process
- if (Config.LOGD) Log.d(TAG, "start mSrec.start");
+ if (false) Log.d(TAG, "start mSrec.start");
mSrec.start();
recognizerStarted = true;
@@ -197,16 +196,16 @@
}
} catch (InterruptedException e) {
- if (Config.LOGD) Log.d(TAG, "start interrupted " + e);
+ if (false) Log.d(TAG, "start interrupted " + e);
recognizerClient.onRecognitionError(e.toString());
} catch (IOException e) {
- if (Config.LOGD) Log.d(TAG, "start new Srec failed " + e);
+ if (false) Log.d(TAG, "start new Srec failed " + e);
recognizerClient.onRecognitionError(e.toString());
} catch (Exception e) {
- if (Config.LOGD) Log.d(TAG, "exception " + e);
+ if (false) Log.d(TAG, "exception " + e);
recognizerClient.onRecognitionError(e.toString());
} finally {
- if (Config.LOGD) Log.d(TAG, "start mSrec.stop");
+ if (false) Log.d(TAG, "start mSrec.stop");
if (mSrec != null && recognizerStarted) mSrec.stop();
// stop microphone
@@ -214,7 +213,7 @@
if (mic != null) mic.close();
}
catch (IOException ex) {
- if (Config.LOGD) Log.d(TAG, "start - mic.close failed - " + ex);
+ if (false) Log.d(TAG, "start - mic.close failed - " + ex);
}
mic = null;
@@ -223,11 +222,11 @@
if (mLogger != null) mLogger.close();
}
catch (IOException ex) {
- if (Config.LOGD) Log.d(TAG, "start - mLoggger.close failed - " + ex);
+ if (false) Log.d(TAG, "start - mLoggger.close failed - " + ex);
}
mLogger = null;
}
- if (Config.LOGD) Log.d(TAG, "start bye");
+ if (false) Log.d(TAG, "start bye");
}
protected static void addIntent(ArrayList<Intent> intents, Intent intent) {
diff --git a/src/com/android/voicedialer/RecognizerLogger.java b/src/com/android/voicedialer/RecognizerLogger.java
index c6449f5..3e730e7 100644
--- a/src/com/android/voicedialer/RecognizerLogger.java
+++ b/src/com/android/voicedialer/RecognizerLogger.java
@@ -21,7 +21,6 @@
import android.os.Build;
import android.speech.srec.WaveHeader;
import android.text.format.DateFormat;
-import android.util.Config;
import android.util.Log;
import java.io.BufferedWriter;
@@ -107,7 +106,7 @@
* @param dataDir directory to contain the log files.
*/
public RecognizerLogger(Context context) throws IOException {
- if (Config.LOGD) Log.d(TAG, "RecognizerLogger");
+ if (false) Log.d(TAG, "RecognizerLogger");
// generate new root filename
File dir = context.getDir(LOGDIR, 0);
diff --git a/src/com/android/voicedialer/VoiceContact.java b/src/com/android/voicedialer/VoiceContact.java
index e9723f9..477d619 100644
--- a/src/com/android/voicedialer/VoiceContact.java
+++ b/src/com/android/voicedialer/VoiceContact.java
@@ -21,7 +21,6 @@
import android.database.DatabaseUtils;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.CallLog;
-import android.util.Config;
import android.util.Log;
import java.io.BufferedReader;
import java.io.File;
@@ -103,7 +102,7 @@
* the contact list content provider.
*/
public static List<VoiceContact> getVoiceContacts(Activity activity) {
- if (Config.LOGD) Log.d(TAG, "VoiceContact.getVoiceContacts");
+ if (false) Log.d(TAG, "VoiceContact.getVoiceContacts");
List<VoiceContact> contacts = new ArrayList<VoiceContact>();
@@ -150,7 +149,7 @@
long personIdAtCursor = cursor.getLong(personIdColumn);
/*
- if (Config.LOGD) {
+ if (false) {
Log.d(TAG, "phoneId=" + phoneIdAtCursor
+ " type=" + typeAtCursor
+ " isPrimary=" + isPrimaryAtCursor
@@ -235,7 +234,7 @@
// clean up cursor
cursor.close();
- if (Config.LOGD) Log.d(TAG, "VoiceContact.getVoiceContacts " + contacts.size());
+ if (false) Log.d(TAG, "VoiceContact.getVoiceContacts " + contacts.size());
return contacts;
}
@@ -246,7 +245,7 @@
* @return a List of {@link VoiceContact} in a File.
*/
public static List<VoiceContact> getVoiceContactsFromFile(File contactsFile) {
- if (Config.LOGD) Log.d(TAG, "getVoiceContactsFromFile " + contactsFile);
+ if (false) Log.d(TAG, "getVoiceContactsFromFile " + contactsFile);
List<VoiceContact> contacts = new ArrayList<VoiceContact>();
@@ -261,17 +260,17 @@
}
}
catch (IOException e) {
- if (Config.LOGD) Log.d(TAG, "getVoiceContactsFromFile failed " + e);
+ if (false) Log.d(TAG, "getVoiceContactsFromFile failed " + e);
}
finally {
try {
br.close();
} catch (IOException e) {
- if (Config.LOGD) Log.d(TAG, "getVoiceContactsFromFile failed during close " + e);
+ if (false) Log.d(TAG, "getVoiceContactsFromFile failed during close " + e);
}
}
- if (Config.LOGD) Log.d(TAG, "getVoiceContactsFromFile " + contacts.size());
+ if (false) Log.d(TAG, "getVoiceContactsFromFile " + contacts.size());
return contacts;
}
@@ -295,7 +294,7 @@
}
cursor.close();
- if (Config.LOGD) Log.d(TAG, "redialNumber " + number);
+ if (false) Log.d(TAG, "redialNumber " + number);
return number;
}
diff --git a/src/com/android/voicedialer/VoiceDialerActivity.java b/src/com/android/voicedialer/VoiceDialerActivity.java
index 81cb2bf..d46ce93 100644
--- a/src/com/android/voicedialer/VoiceDialerActivity.java
+++ b/src/com/android/voicedialer/VoiceDialerActivity.java
@@ -36,7 +36,6 @@
import android.os.SystemProperties;
import android.os.Vibrator;
import android.speech.tts.TextToSpeech;
-import android.util.Config;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
@@ -184,7 +183,7 @@
@Override
protected void onCreate(Bundle icicle) {
- if (Config.LOGD) Log.d(TAG, "onCreate");
+ if (false) Log.d(TAG, "onCreate");
super.onCreate(icicle);
mHandler = new Handler();
mAudioManager = (AudioManager)getSystemService(AUDIO_SERVICE);
@@ -193,7 +192,7 @@
}
protected void onStart() {
- if (Config.LOGD) Log.d(TAG, "onStart " + getIntent());
+ if (false) Log.d(TAG, "onStart " + getIntent());
super.onStart();
acquireWakeLock(this);
@@ -242,7 +241,7 @@
} else {
mUsingBluetooth = false;
- if (Config.LOGD) Log.d(TAG, "bluetooth unavailable");
+ if (false) Log.d(TAG, "bluetooth unavailable");
mSampleRate = REGULAR_SAMPLE_RATE;
mCommandEngine.setMinimizeResults(false);
mCommandEngine.setAllowOpenEntries(true);
@@ -323,7 +322,7 @@
class TtsInitListener implements TextToSpeech.OnInitListener {
public void onInit(int status) {
// status can be either TextToSpeech.SUCCESS or TextToSpeech.ERROR.
- if (Config.LOGD) Log.d(TAG, "onInit for tts");
+ if (false) Log.d(TAG, "onInit for tts");
if (status != TextToSpeech.SUCCESS) {
// Initialization failed.
Log.e(TAG, "Could not initialize TextToSpeech.");
@@ -368,7 +367,7 @@
class OnUtteranceCompletedListener
implements TextToSpeech.OnUtteranceCompletedListener {
public void onUtteranceCompleted(String utteranceId) {
- if (Config.LOGD) Log.d(TAG, "onUtteranceCompleted " + utteranceId);
+ if (false) Log.d(TAG, "onUtteranceCompleted " + utteranceId);
// since the utterance has completed, we no longer need the fallback.
mHandler.removeCallbacks(mFallbackRunnable);
mFallbackRunnable = null;
@@ -378,7 +377,7 @@
private void updateBluetoothParameters(boolean connected) {
if (connected) {
- if (Config.LOGD) Log.d(TAG, "using bluetooth");
+ if (false) Log.d(TAG, "using bluetooth");
mUsingBluetooth = true;
mBluetoothHeadset.startVoiceRecognition(mBluetoothDevice);
@@ -401,7 +400,7 @@
// we need to wait for the TTS system and the SCO connection
// before we can start listening.
} else {
- if (Config.LOGD) Log.d(TAG, "not using bluetooth");
+ if (false) Log.d(TAG, "not using bluetooth");
mUsingBluetooth = false;
mSampleRate = REGULAR_SAMPLE_RATE;
mCommandEngine.setMinimizeResults(false);
@@ -415,7 +414,7 @@
private BluetoothProfile.ServiceListener mBluetoothHeadsetServiceListener =
new BluetoothProfile.ServiceListener() {
public void onServiceConnected(int profile, BluetoothProfile proxy) {
- if (Config.LOGD) Log.d(TAG, "onServiceConnected");
+ if (false) Log.d(TAG, "onServiceConnected");
mBluetoothHeadset = (BluetoothHeadset) proxy;
List<BluetoothDevice> deviceList = mBluetoothHeadset.getConnectedDevices();
@@ -423,7 +422,7 @@
if (deviceList.size() > 0) {
mBluetoothDevice = deviceList.get(0);
int state = mBluetoothHeadset.getConnectionState(mBluetoothDevice);
- if (Config.LOGD) Log.d(TAG, "headset status " + state);
+ if (false) Log.d(TAG, "headset status " + state);
// We are already connnected to a headset
if (state == BluetoothHeadset.STATE_CONNECTED) {
@@ -448,7 +447,7 @@
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
int state = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, -1);
- if (Config.LOGD) Log.d(TAG, "HEADSET STATE -> " + state);
+ if (false) Log.d(TAG, "HEADSET STATE -> " + state);
if (state == BluetoothProfile.STATE_CONNECTED) {
mBluetoothDevice = device;
@@ -474,7 +473,7 @@
if (!mWaitingForScoConnection) {
// apparently our connection to the headset has dropped.
// we won't be able to continue voicedialing.
- if (Config.LOGD) Log.d(TAG, "lost sco connection");
+ if (false) Log.d(TAG, "lost sco connection");
mHandler.post(new ErrorRunnable(
R.string.headset_connection_lost));
@@ -583,7 +582,7 @@
* Called by the {@link RecognizerEngine} when the microphone is started.
*/
public void onMicrophoneStart(InputStream mic) {
- if (Config.LOGD) Log.d(TAG, "onMicrophoneStart");
+ if (false) Log.d(TAG, "onMicrophoneStart");
if (!mUsingBluetooth) {
playSound(ToneGenerator.TONE_PROP_BEEP);
@@ -602,7 +601,7 @@
Log.e(TAG, "IOException " + e);
}
} else {
- if (Config.LOGD) Log.d(TAG, "no tone");
+ if (false) Log.d(TAG, "no tone");
}
}
@@ -675,18 +674,18 @@
if (energy > threshold && energy > (prevE * 2) && prevE != 0) {
// rising edge if energy doubled and > abs threshold
state = RISING;
- if (Config.LOGD) Log.d(TAG, "start RISING: " + count +" time: "+ (((1000*count)/2)/mSampleRate));
+ if (false) Log.d(TAG, "start RISING: " + count +" time: "+ (((1000*count)/2)/mSampleRate));
}
break;
case RISING:
if (energy < threshold || energy < (prevE / 2)){
// energy fell back below half of previous, back to start
- if (Config.LOGD) Log.d(TAG, "back to START: " + count +" time: "+ (((1000*count)/2)/mSampleRate));
+ if (false) Log.d(TAG, "back to START: " + count +" time: "+ (((1000*count)/2)/mSampleRate));
peak = 0;
state = START;
} else if (energy > (prevE / 2) && energy < (prevE * 2)) {
// Start of constant energy
- if (Config.LOGD) Log.d(TAG, "start TOP: " + count +" time: "+ (((1000*count)/2)/mSampleRate));
+ if (false) Log.d(TAG, "start TOP: " + count +" time: "+ (((1000*count)/2)/mSampleRate));
if (peak < energy) {
peak = energy;
}
@@ -696,7 +695,7 @@
case TOP:
if (energy < threshold || energy < (peak / 2)) {
// e went to less than half of the peak
- if (Config.LOGD) Log.d(TAG, "end TOP: " + count +" time: "+ (((1000*count)/2)/mSampleRate));
+ if (false) Log.d(TAG, "end TOP: " + count +" time: "+ (((1000*count)/2)/mSampleRate));
return;
}
break;
@@ -704,14 +703,14 @@
prevE = energy;
count += blockSize;
}
- if (Config.LOGD) Log.d(TAG, "no beep detected, timed out");
+ if (false) Log.d(TAG, "no beep detected, timed out");
}
/**
* Called by the {@link RecognizerEngine} if the recognizer fails.
*/
public void onRecognitionFailure(final String msg) {
- if (Config.LOGD) Log.d(TAG, "onRecognitionFailure " + msg);
+ if (false) Log.d(TAG, "onRecognitionFailure " + msg);
// we had zero results. Just try again.
askToTryAgain();
}
@@ -720,7 +719,7 @@
* Called by the {@link RecognizerEngine} on an internal error.
*/
public void onRecognitionError(final String msg) {
- if (Config.LOGD) Log.d(TAG, "onRecognitionError " + msg);
+ if (false) Log.d(TAG, "onRecognitionError " + msg);
mHandler.post(new ErrorRunnable(R.string.recognition_error));
exitActivity();
}
@@ -733,10 +732,10 @@
* @param intents a list of Intents corresponding to the sentences.
*/
public void onRecognitionSuccess(final Intent[] intents) {
- if (Config.LOGD) Log.d(TAG, "CommandRecognizerClient onRecognitionSuccess " +
+ if (false) Log.d(TAG, "CommandRecognizerClient onRecognitionSuccess " +
intents.length);
if (mState != WAITING_FOR_COMMAND) {
- if (Config.LOGD) Log.d(TAG, "not waiting for command, ignoring");
+ if (false) Log.d(TAG, "not waiting for command, ignoring");
return;
}
@@ -766,7 +765,7 @@
// see if we the response was "exit" or "cancel".
String value = intents[0].getStringExtra(
RecognizerEngine.SEMANTIC_EXTRA);
- if (Config.LOGD) Log.d(TAG, "value " + value);
+ if (false) Log.d(TAG, "value " + value);
if ("X".equals(value)) {
exitActivity();
return;
@@ -807,7 +806,7 @@
new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
- if (Config.LOGD) {
+ if (false) {
Log.d(TAG, "cancelListener.onCancel");
}
dialog.dismiss();
@@ -819,7 +818,7 @@
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
- if (Config.LOGD) {
+ if (false) {
Log.d(TAG, "clickListener.onClick " + which);
}
startActivityHelp(intents[which]);
@@ -832,7 +831,7 @@
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
- if (Config.LOGD) {
+ if (false) {
Log.d(TAG, "negativeListener.onClick " +
which);
}
@@ -859,9 +858,9 @@
private class ChoiceRecognizerClient implements RecognizerClient {
public void onRecognitionSuccess(final Intent[] intents) {
- if (Config.LOGD) Log.d(TAG, "ChoiceRecognizerClient onRecognitionSuccess");
+ if (false) Log.d(TAG, "ChoiceRecognizerClient onRecognitionSuccess");
if (mState != WAITING_FOR_CHOICE) {
- if (Config.LOGD) Log.d(TAG, "not waiting for choice, ignoring");
+ if (false) Log.d(TAG, "not waiting for choice, ignoring");
return;
}
@@ -873,7 +872,7 @@
if (intents.length > 0) {
String value = intents[0].getStringExtra(
RecognizerEngine.SEMANTIC_EXTRA);
- if (Config.LOGD) Log.d(TAG, "value " + value);
+ if (false) Log.d(TAG, "value " + value);
if ("R".equals(value)) {
if (mUsingBluetooth) {
mHandler.post(new GreetingRunnable());
@@ -897,7 +896,7 @@
performChoice();
} else {
// invalid choice
- if (Config.LOGD) Log.d(TAG, "invalid choice" + value);
+ if (false) Log.d(TAG, "invalid choice" + value);
if (mUsingBluetooth) {
mTtsParams.remove(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID);
@@ -912,23 +911,23 @@
}
public void onRecognitionFailure(String msg) {
- if (Config.LOGD) Log.d(TAG, "ChoiceRecognizerClient onRecognitionFailure");
+ if (false) Log.d(TAG, "ChoiceRecognizerClient onRecognitionFailure");
exitActivity();
}
public void onRecognitionError(String err) {
- if (Config.LOGD) Log.d(TAG, "ChoiceRecognizerClient onRecognitionError");
+ if (false) Log.d(TAG, "ChoiceRecognizerClient onRecognitionError");
mHandler.post(new ErrorRunnable(R.string.recognition_error));
exitActivity();
}
public void onMicrophoneStart(InputStream mic) {
- if (Config.LOGD) Log.d(TAG, "ChoiceRecognizerClient onMicrophoneStart");
+ if (false) Log.d(TAG, "ChoiceRecognizerClient onMicrophoneStart");
}
}
private void speakChoices() {
- if (Config.LOGD) Log.d(TAG, "speakChoices");
+ if (false) Log.d(TAG, "speakChoices");
mState = SPEAKING_CHOICES;
String sentenceSpoken = spaceOutDigits(
@@ -1002,7 +1001,7 @@
}
private void listenForCommand() {
- if (Config.LOGD) Log.d(TAG, ""
+ if (false) Log.d(TAG, ""
+ "Command(): MICROPHONE_EXTRA: "+getArg(MICROPHONE_EXTRA)+
", CONTACTS_EXTRA: "+getArg(CONTACTS_EXTRA));
@@ -1019,7 +1018,7 @@
}
private void listenForChoice() {
- if (Config.LOGD) Log.d(TAG, "listenForChoice(): MICROPHONE_EXTRA: " +
+ if (false) Log.d(TAG, "listenForChoice(): MICROPHONE_EXTRA: " +
getArg(MICROPHONE_EXTRA));
mState = WAITING_FOR_CHOICE;
@@ -1036,7 +1035,7 @@
private void exitActivity() {
synchronized(this) {
if (mState != EXITING) {
- if (Config.LOGD) Log.d(TAG, "exitActivity");
+ if (false) Log.d(TAG, "exitActivity");
mState = SPEAKING_GOODBYE;
if (mUsingBluetooth) {
mTtsParams.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID,
@@ -1097,7 +1096,7 @@
}
protected void onStop() {
- if (Config.LOGD) Log.d(TAG, "onStop");
+ if (false) Log.d(TAG, "onStop");
synchronized(this) {
mState = EXITING;
@@ -1125,7 +1124,7 @@
try {
mRecognizerThread.join();
} catch (InterruptedException e) {
- if (Config.LOGD) Log.d(TAG, "onStop mRecognizerThread.join exception " + e);
+ if (false) Log.d(TAG, "onStop mRecognizerThread.join exception " + e);
}
mRecognizerThread = null;
}
@@ -1178,7 +1177,7 @@
@Override
protected void onDestroy() {
- if (Config.LOGD) Log.d(TAG, "onDestroy");
+ if (false) Log.d(TAG, "onDestroy");
super.onDestroy();
}
}
diff --git a/src/com/android/voicedialer/VoiceDialerReceiver.java b/src/com/android/voicedialer/VoiceDialerReceiver.java
index f9b8b75..7ba1177 100644
--- a/src/com/android/voicedialer/VoiceDialerReceiver.java
+++ b/src/com/android/voicedialer/VoiceDialerReceiver.java
@@ -21,7 +21,6 @@
import android.content.Intent;
import android.content.BroadcastReceiver;
import android.provider.Telephony.Intents;
-import android.util.Config;
import android.util.Log;
import android.widget.Toast;
@@ -30,7 +29,7 @@
@Override
public void onReceive(Context context, Intent intent) {
- if (Config.LOGD) Log.d(TAG, "onReceive " + intent);
+ if (false) Log.d(TAG, "onReceive " + intent);
// fetch up useful stuff
String action = intent.getAction();
diff --git a/src/com/android/voicedialer/VoiceDialerTester.java b/src/com/android/voicedialer/VoiceDialerTester.java
index 0ac7f89..6208e6f 100644
--- a/src/com/android/voicedialer/VoiceDialerTester.java
+++ b/src/com/android/voicedialer/VoiceDialerTester.java
@@ -17,7 +17,6 @@
package com.android.voicedialer;
import android.content.Intent;
-import android.util.Config;
import android.util.Log;
import java.io.File;
import java.io.FileFilter;
@@ -54,7 +53,7 @@
* Sweep directory of directories, listing all WAV files.
*/
public VoiceDialerTester(File dir) {
- if (Config.LOGD) {
+ if (false) {
Log.d(TAG, "VoiceDialerTester " + dir);
}
@@ -220,7 +219,7 @@
}
private void reportSummary(String label, FileFilter filter) {
- if (!Config.LOGD) return;
+ if (!false) return;
// log cumulative stats
int total = 0;
@@ -259,4 +258,4 @@
return total > 0 ? "" + (100 * count / total) + "%" : "";
}
-}
\ No newline at end of file
+}