/** 将设备Token提交服务器 */
  public void postDeviceTokenToServiceLocked() {
    DebugUtils.logD(TAG, "postDeviceTokenToServiceLocked()");
    try {
      if (MyAccountManager.getInstance().hasLoginned()
          && !TextUtils.isEmpty(getDeviceTotke())
          && !getDeviceTotkeStatus()) {
        InputStream is =
            NetworkUtils.openContectionLocked(
                HaierServiceObject.getUpdateDeviceTokenUrl(
                    String.valueOf(MyAccountManager.getInstance().getAccountObject().mAccountUid),
                    getDeviceTotke(),
                    "android"),
                MyApplication.getInstance().getSecurityKeyValuesObject());
        if (is != null) {
          HaierResultObject result = HaierResultObject.parse(NetworkUtils.getContentFromInput(is));
          NetworkUtils.closeInputStream(is);

          saveDeviceTokenStatus(result.isOpSuccessfully());
          DebugUtils.logD(TAG, result.toString());
        }
      }
    } catch (ClientProtocolException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
 @Override
 protected void onPostExecute(HaierResultObject result) {
   super.onPostExecute(result);
   if (isCancelled()) {
     // 通常不走到这里
     onCancelled();
     finish();
     return;
   }
   if (!result.isOpSuccessfully()) {
     MyApplication.getInstance().showMessage(result.mStatusMessage);
     setResult(Activity.RESULT_CANCELED);
   } else if (mAccountObject.hasUid() && mAccountObject.hasId()) {
     // 如果登陆成功
     IMService.connectIMService(LoginOrUpdateAccountDialog.this);
     setResult(Activity.RESULT_OK);
     // 每次登陆,我们都需要注册设备Token
     YouMengMessageHelper.getInstance().saveDeviceTokenStatus(false);
     // 登录成功,我们需要检查是否能够上传设备Token到服务器绑定uid和token
     UpdateService.startCheckDeviceTokenToService(LoginOrUpdateAccountDialog.this);
     // 每次登录我们都重新设置需要重新拉好友列表
     ComPreferencesManager.getInstance().setFirstLaunch(RelationshipActivity.FIRST, true);
   } else {
     MyApplication.getInstance().showMessage(mAccountObject.mStatusMessage);
     setResult(Activity.RESULT_CANCELED);
   }
   finish();
 }
    @Override
    protected HaierResultObject doInBackground(Void... params) {
      HaierResultObject resultObject = new HaierResultObject();
      mAccountObject = new AccountObject();
      ;
      try {
        MyApplication.getInstance()
            .postAsync(
                new Runnable() {

                  @Override
                  public void run() {
                    mStatusView.setText(R.string.msg_login_download_accountinfo_wait);
                  }
                });
        _is =
            NetworkUtils.openContectionLocked(
                HaierServiceObject.getLoginOrUpdateUrl(mTel, mPwd), null);
        resultObject = HaierResultObject.parse(NetworkUtils.getContentFromInput(_is));
        if (resultObject.isOpSuccessfully()) {
          // 登录成功,我们解析登录返回数据
          AccountParser.parseAccountData(resultObject.mJsonData, mAccountObject);
          if (mAccountObject != null && mAccountObject.hasUid()) {
            boolean saveAccountOk =
                MyAccountManager.getInstance()
                    .saveAccountObject(
                        LoginOrUpdateAccountDialog.this.getContentResolver(), mAccountObject);
            if (!saveAccountOk) {
              // 登录成功了,但本地数据保存失败,通常不会走到这里
              resultObject.mStatusMessage =
                  LoginOrUpdateAccountDialog.this.getString(R.string.msg_login_save_success);
            }
          }
        }

      } catch (ClientProtocolException e) {
        e.printStackTrace();
        resultObject.mStatusMessage = e.getMessage();
      } catch (IOException e) {
        e.printStackTrace();
        resultObject.mStatusMessage = MyApplication.getInstance().getGernalNetworkError();
      } catch (JSONException e) {
        e.printStackTrace();
        resultObject.mStatusMessage = e.getMessage();
      } finally {
        NetworkUtils.closeInputStream(_is);
      }
      return resultObject;
    }