/*
  * Send all contacts name to next dispatcher
  *
  * @param contactsNameList contacts name list
  */
 public void handleAsyncContactsMsg(String[] contactsNames) {
   VoiceMessage message = new VoiceMessage();
   message.mMainAction = VoiceCommandListener.ACTION_MAIN_VOICE_CONTACTS;
   message.mSubAction = VoiceCommandListener.ACTION_VOICE_CONTACTS_NAME;
   Bundle bundle = DataPackage.packageSendInfo(contactsNames, null);
   message.mExtraData = bundle;
   mVoiceContacts.handleAsyncVoiceMessage(message);
 }
Exemple #2
0
  private void sendToMainHandler() {
    Log.d(TAG, "[sendToMainHandler]...");
    if (mMainHandler.hasMessages(VoiceCommandListener.ACTION_VOICE_CONTACTS_NAME)) {
      mMainHandler.removeMessages(VoiceCommandListener.ACTION_VOICE_CONTACTS_NAME);
    }
    // Query database after remove the contacts msg of main handler
    String[] contactsNames = getContactsNames();
    VoiceMessage message = new VoiceMessage();
    message.mMainAction = VoiceCommandListener.ACTION_MAIN_VOICE_CONTACTS;
    message.mSubAction = VoiceCommandListener.ACTION_VOICE_CONTACTS_NAME;
    Bundle bundle = DataPackage.packageSendInfo(contactsNames, null);
    message.mExtraData = bundle;

    Message msg = mMainHandler.obtainMessage();
    msg.what = VoiceCommandListener.ACTION_MAIN_VOICE_CONTACTS;
    msg.obj = message;
    mMainHandler.sendMessage(msg);
  }