FileDocCategorySizeDatePackage
VoiceDialerReceiver.javaAPI DocAndroid 1.5 API2469Wed May 06 22:42:48 BST 2009com.android.voicedialer

VoiceDialerReceiver

public class VoiceDialerReceiver extends android.content.BroadcastReceiver

Fields Summary
private static final String
TAG
Constructors Summary
Methods Summary
public voidonReceive(android.content.Context context, android.content.Intent intent)

    
    
          
        if (Config.LOGD) Log.d(TAG, "onReceive " + intent);

        // fetch up useful stuff
        String action = intent.getAction();
        String host = intent.getData() != null ? intent.getData().getHost() : null;
        
        // force recompilation of g2g on boot
        if (Intent.ACTION_BOOT_COMPLETED.equals(action)) {
            RecognizerEngine.deleteCachedGrammarFiles(context);
        }
        
        // force recompilation if apps change, for 'OPEN' command
        else if (Intent.ACTION_PACKAGE_ADDED.equals(action) ||
                Intent.ACTION_PACKAGE_CHANGED.equals(action) ||
                Intent.ACTION_PACKAGE_REMOVED.equals(action)) {
            RecognizerEngine.deleteCachedGrammarFiles(context);
        }

        // Voice Dialer Logging Enabled, *#*#8351#*#*
        else if (Intents.SECRET_CODE_ACTION.equals(action) && "8351".equals(host)) {
            RecognizerLogger.enable(context);
            Toast.makeText(context, R.string.logging_enabled, Toast.LENGTH_LONG).show();
        }

        // Voice Dialer Logging Disabled, *#*#8350#*#*
        else if (Intents.SECRET_CODE_ACTION.equals(action) && "8350".equals(host)) {
            RecognizerLogger.disable(context);
            Toast.makeText(context, R.string.logging_disabled, Toast.LENGTH_LONG).show();
        }