最终调用接口显示/隐藏浮标
@param show 是否显示浮标
@param activity 当前界面的activity
@param client HuaweiApiClient实例
486360
private void showFinal(boolean show, Activity activity, HuaweiApiClient client) {

        // 保存当前浮标显示状态，以便出现异常浮标消失后，能够恢复
        isCurFloatShow = show;

        Activity curActivity = activity!=null ? activity : ActivityMgr.INST.getLastActivity();

        // 取得当前 activity 用于展示浮标
        if (curActivity == null) {
            HMSAgentLog.e("activity is null");
            return;
        }

        if (show) {
            if (client == null || !client.isConnected()) {
                HMSAgentLog.e("client is invalid");
                ApiClientMgr.INST.connect(new EmptyConnectCallback("try connect end when show float:"), false);
                return;
            }

            HMSAgentLog.d("show begin");
            PendingResult<ShowFloatWindowResult> pendingRst = HuaweiGame.HuaweiGameApi.showFloatWindow(client, curActivity);
            pendingRst.setResultCallback(new ShowFloatWindowCallBack());
        } else {
            HMSAgentLog.d("hide");
            HuaweiGame.HuaweiGameApi.hideFloatWindow(client, curActivity);
        }
    }
1259219
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
  private void showProgress(final boolean show) {
    // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow
    // for very easy animations. If available, use these APIs to fade-in
    // the progress spinner.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
      int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);

      mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
      mLoginFormView.animate().setDuration(shortAnimTime).alpha(
          show ? 0 : 1).setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
          mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
        }
      });

      mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
      mProgressView.animate().setDuration(shortAnimTime).alpha(
          show ? 1 : 0).setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
          mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
        }
      });
    } else {
      // The ViewPropertyAnimator APIs are not available, so simply show
      // and hide the relevant UI components.
      mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
      mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
    }
  }
167717
public static void wapPay(HttpServletResponse response, AlipayTradeWapPayModel model, String returnUrl,
			String notifyUrl) throws AlipayApiException, IOException {
		String form = wapPayStr(response, model, returnUrl, notifyUrl);
		HttpServletResponse httpResponse = response;
		httpResponse.setContentType("text/html;charset=" + AliPayApiConfigKit.getAliPayApiConfig().getCharset());
		httpResponse.getWriter().write(form);// 直接将完整的表单html输出到页面
		httpResponse.getWriter().flush();
	}
1177274
private void startConnect() {

        // 触发一次连接将重试次数减1
        curLeftResolveTimes--;

        HMSAgentLog.d("start thread to connect");
        ThreadUtil.INST.excute(new Runnable() {
            @Override
            public void run() {
                HuaweiApiClient client =  getApiClient();

                if (client != null) {
                    HMSAgentLog.d("connect");
                    Activity curActivity = ActivityMgr.INST.getLastActivity();

                    // 考虑到有cp后台需要调用接口，HMSSDK去掉了activity不能为空的判断。这里只是取当前activity，可能为空
                    timeoutHandler.sendEmptyMessageDelayed(APICLIENT_TIMEOUT_HANDLE_MSG, APICLIENT_CONNECT_TIMEOUT);
                    client.connect(curActivity);
                } else {
                    HMSAgentLog.d("client is generate error");
                    onConnectEnd(HMSAgent.AgentResultCode.RESULT_IS_NULL);
                }
            }
        });
    }
60539
@Override
    public void onActivityResume(Activity activity) {
        // 通知hmssdk activity onResume了
        HuaweiApiClient client = getApiClient();
        if (client != null) {
            HMSAgentLog.d("tell hmssdk: onResume");
            client.onResume(activity);
        }

        // 如果正在解决错误，则处理被覆盖的场景
        HMSAgentLog.d("is resolving:" + isResolving);
        if (isResolving && !PACKAGE_NAME_HIAPP.equals(curAppPackageName)) {
            if (activity instanceof BridgeActivity) {
                resolveActivity = (BridgeActivity)activity;
                hasOverActivity = false;
                HMSAgentLog.d("received bridgeActivity:" + StrUtils.objDesc(resolveActivity));
            } else if (resolveActivity != null && !resolveActivity.isFinishing()){
                hasOverActivity = true;
                HMSAgentLog.d("received other Activity:" + StrUtils.objDesc(resolveActivity));
            }
            timeoutHandler.removeMessages(UPDATE_OVER_ACTIVITY_CHECK_TIMEOUT_HANDLE_MSG);
            timeoutHandler.sendEmptyMessageDelayed(UPDATE_OVER_ACTIVITY_CHECK_TIMEOUT_HANDLE_MSG, UPDATE_OVER_ACTIVITY_CHECK_TIMEOUT);
        }
    }
586013
public static void executeOnGlobalLayout(@NonNull final Activity activity, @NonNull final ViewTreeObserver.OnGlobalLayoutListener listener) {
        executeOnGlobalLayout(activity.getWindow().getDecorView().findViewById(android.R.id.content), listener);
    }
458283
public void activityEnded(ActivityHandle activityHandle) {
		final Wrapper activity = activityManagement.remove((SipActivityHandle) activityHandle);
		if (activity != null) {
			activity.clear();			
		}
	}
881385
public void activityEnded(ActivityHandle ah) {		
		if (tracer.isFineEnabled()) {
			tracer.fine("activityEnded( handle = "+ah+")");
		}
		// just remove the handle
	    activities.remove(ah);
	}
721953
public void setShow(String name, boolean show) {
        String newName = name.toLowerCase();
        if (aclList.containsKey(newName)) {
            AccountACLValue value = aclList.get(newName);
            set(newName, value.canDeposit(), value.canWithdraw(), value.canAcl(), show, value.isOwner());
        } else {
            set(newName, false, false, false, show, false);
        }
    }
1039374
public void setClient(HTTPClientPolicy client) {
        if (this.clientSidePolicy != null) {
            this.clientSidePolicy.removePropertyChangeListener(this);
        }
        this.clientSidePolicyCalced = true;
        this.clientSidePolicy = client;
        clientSidePolicy.removePropertyChangeListener(this); //make sure we aren't added twice
        clientSidePolicy.addPropertyChangeListener(this);
        endpointInfo.setProperty("org.apache.cxf.ws.addressing.replyto", client.getDecoupledEndpoint());
    }
1247320
public void queryLiveness(ActivityHandle ah) {
		if (tracer.isFineEnabled()) {
			tracer.fine("queryLiveness( handle = "+ah+")");
		}
		// guard against activity leaks:
		if (!activities.contains(ah)) {
			raContext.getSleeEndpoint().endActivity(ah);
		}			
	}
78524
@Override
    public void onConnect(int rst, HuaweiApiClient client) {

        HMSAgentLog.d("onConnect:" + rst);

        if (client == null || !ApiClientMgr.INST.isConnect(client)) {
            HMSAgentLog.e("client not connted");
            onPurchaseInfoResult(rst, null);
            return;
        }

        // 调用HMS-SDK getOrderDetail 接口
        PendingResult<PurchaseInfoResult> purchaseInfoPenddingResult = HuaweiPay.HuaweiPayApi.getPurchaseInfo(client, purchaseInfoReq);
        purchaseInfoPenddingResult.setResultCallback(new ResultCallback<PurchaseInfoResult>() {
            @Override
            public void onResult(PurchaseInfoResult result) {

                if (result == null) {
                    HMSAgentLog.e("result is null");
                    onPurchaseInfoResult(HMSAgent.AgentResultCode.RESULT_IS_NULL, null);
                    return;
                }

                Status status = result.getStatus();
                if (status == null) {
                    HMSAgentLog.e("status is null");
                    onPurchaseInfoResult(HMSAgent.AgentResultCode.STATUS_IS_NULL, null);
                    return;
                }

                int rstCode = status.getStatusCode();
                HMSAgentLog.d("status=" + status);
                // 需要重试的错误码，并且可以重试
                if ((rstCode == CommonCode.ErrorCode.SESSION_INVALID
                        || rstCode == CommonCode.ErrorCode.CLIENT_API_INVALID) && retryTimes > 0) {
                    retryTimes--;
                    connect();
                } else {
                    onPurchaseInfoResult(rstCode, result);
                }
            }
        });
    }
258989
public static boolean show(final Activity activity) {
        final SharedPreferences preferences = activity.getSharedPreferences(PREFERENCES_EULA,
                Activity.MODE_PRIVATE);
        if (!preferences.getBoolean(PREFERENCE_EULA_ACCEPTED, false)) {
            final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
            builder.setTitle("License");
            builder.setCancelable(true);
            builder.setPositiveButton("Accept", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    accept(preferences);
                    if (activity instanceof OnEulaAgreedTo) {
                        ((OnEulaAgreedTo) activity).onEulaAgreedTo();
                    }
                }
            });
            builder.setNegativeButton("Refuse", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    refuse(activity);
                }
            });
            builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
                public void onCancel(DialogInterface dialog) {
                    refuse(activity);
                }
            });
            builder.setMessage(readEula(activity));
            builder.create().show();
            return false;
        }
        return true;
    }
1169135
public function viewAction($externalNetworkId, $externalRouteId, $externalLineId, $seasonId, $externalStopPointId = null)
    {
        $lineManager = $this->get('canal_tp_mtt.line_manager');
        $customerId = $this->getRequest()->get('customerId');

        if ($customerId == null) {
            $customer = $this->getUser()->getCustomer();
        } else {
            $customer = $this->get('sam_core.customer')->find($customerId);
        }
        $perimeter = $this->get('nmm.perimeter_manager')->findOneByExternalNetworkId(
            $customer,
            $externalNetworkId
        );
        $timetable = $this->getTimetable(
            $externalRouteId,
            $perimeter->getExternalCoverageId(),
            $lineManager->getLineConfigByExternalLineIdAndSeasonId($externalLineId, $seasonId)
        );

        $displayMenu = $this->get('security.context')->getToken()->getUser() != 'anon.';
        if ($displayMenu) {
            $displayMenu = $this->get('request')->get('timetableOnly', false) != true;
        }

        return $this->renderLayout($timetable, $externalStopPointId, false, $displayMenu);
    }
969995
function showInterfaceJavaMethod(intf, method, html) {
    var line = ""

    line += "\n    /**"
    line += "\n     * "
    line += "\n     */"
    line += "\n    <span class='methodName'>public void " + method.name + "</span>(" + getJavaParameterListSimple(method.parameters, method.returns) + ") throws IOException {"
    line += "\n        Main.warn(getClass().getName() + \"." + method.name + "() not implemented\");"
    line += "\n"
    line += "\n        channel.sendCallback(\"" + intf.name + "\", callbackId" + getJavaCallbackParameterListSimple(method.callbackParameters) + ");"
    line += "\n    }"
    line += "\n"
    html.push(line)
}
315633
function(requestParameters, next) {
    if(self.providerProvidesValidateNotReplayClient) {
      self.provider.validateNotReplayClient(requestParameters.oauth_consumer_key, requestParameters.oauth_token, requestParameters.oauth_timestamp, requestParameters.oauth_nonce, function(err, result) {
        if(err) {
          callback(new errors.OAuthUnauthorizedError('Invalid / used nonce'), null);
        } else {
          next();
        }
      });
    } else {
      self.provider.validateNotReplay(requestParameters.oauth_token, requestParameters.oauth_timestamp, requestParameters.oauth_nonce, function(err, result) {
        if(err) {
          callback(new errors.OAuthUnauthorizedError('Invalid / used nonce'), null);
        } else {
          next();
        }
      });
    }
  }
1136098
function showInterfaceJava(intf, html) {
    html.push("<div class='show-Java'><h3>Java</h3><pre>")

    intf.methods.forEach(function(method){
        showInterfaceJavaMethod(intf, method, html)
    })

    html.push("</pre></div>")
}