透传消息
@param context
@param miPushMessage
323582
@Override
  public void onReceivePassThroughMessage(Context context, com.xiaomi.mipush.sdk.MiPushMessage miPushMessage) {
    processMiPushMessage(miPushMessage);
  }
1233194
function create(context) {
    return {
        CallExpression(node) {
            if (isDefineCall(node) && !isValidDefine(node)) {
                context.report(node, message);
            }
        }
    };
}
1249910
private synchronized void onContextReady(final ContextStatusPOJO contextStatus,
                                           final boolean notifyClientOnNewActiveContext) {
    assert ContextState.READY == contextStatus.getContextState();
    final String contextID = contextStatus.getContextId();
    // This could be the first message we get from that context
    if (this.isUnknownContextId(contextID)) {
      this.onNewContext(contextStatus, notifyClientOnNewActiveContext);
    }

    // Dispatch the messages to the application, if there are any.
    for (final ContextMessagePOJO
             contextMessage : contextStatus.getContextMessageList()) {
      final byte[] theMessage = contextMessage.getMessage();
      final String sourceID = contextMessage.getSourceId();
      final long sequenceNumber = contextMessage.getSequenceNumber();
      this.messageDispatcher.onContextMessage(new ContextMessageImpl(theMessage, contextID, sourceID, sequenceNumber));
    }

  }
50693
@Override
  public void onNotificationMessageClicked(Context context, com.xiaomi.mipush.sdk.MiPushMessage miPushMessage) {
    processMiNotification(miPushMessage);
  }
1185429
function context(self, method) {
  if (self instanceof Primus) return;

  var failure = new Error('Primus#'+ method + '\'s context should called with a Primus instance');

  if ('function' !== typeof self.listeners || !self.listeners('error').length) {
    throw failure;
  }

  self.emit('error', failure);
}
443290
public synchronized void start(StartContext context) throws StartException {
        Logger.getLogger("org.mobicents.as10").debug(
                "SipConnectorService.start(), protocol = " + protocol + " - scheme = " + scheme);
        final SocketBinding binding = this.binding.getValue();
        final InetSocketAddress address = binding.getSocketAddress();
        final Executor executor = this.executor.getOptionalValue();
        try {

            SipConnector sipConnector = new SipConnector();
            sipConnector.setIpAddress(address.getAddress().getHostAddress());
            sipConnector.setPort(address.getPort());
            // https://github.com/Mobicents/sip-servlets/issues/44 support multiple connectors
            sipConnector.setTransport(binding.getName().substring(binding.getName().lastIndexOf("sip-") + ("sip-".length())));
            sipConnector.setUseLoadBalancer(useLoadBalancer);
            sipConnector.setLoadBalancerAddress(loadBalancerAddress);
            sipConnector.setLoadBalancerRmiPort(loadBalancerRmiPort);
            sipConnector.setLoadBalancerSipPort(loadBalancerSipPort);
            sipConnector.setUseStaticAddress(useStaticAddress);
            sipConnector.setStaticServerAddress(staticServerAddress);
            sipConnector.setStaticServerPort(staticServerPort);
            sipConnector.setUseStun(useStun);
            sipConnector.setStunServerAddress(stunServerAddress);
            sipConnector.setStunServerPort(stunServerPort);
            sipConnector.setHostNames(hostNames);

            Logger.getLogger("org.mobicents.as10").debug(
                    "SipConnectorService.start(), address = " + address.getAddress().getHostAddress() + " - port = "
                            + address.getPort() + " - transport = " + sipConnector.getTransport());
            Logger.getLogger("org.mobicents.as10").debug("SipConnectorService.start(), hostnames = " + hostNames);

            /*
             * FIXME: kakonyii: need an implementation in SipConnector class for the following fields: enableLookups proxyName
             * proxyPort redirectPort secure maxPostSize maxSavePostSize
             */

            SipProtocolHandler sipProtocolHandler = new SipProtocolHandler(sipConnector);

            // TODO set Executor on ProtocolHandler
            // TODO use server socket factory - or integrate with {@code ManagedBinding}

            final SipConnectorListener connector = new SipConnectorListener(sipProtocolHandler);

            connector.init();
            getSipServer().addConnector(connector);
            connector.start();

            this.connector = connector;
        } catch (Exception e) {
            throw new StartException(MESSAGES.connectorStartError(), e);
        }
        // Register the binding after the connector is started
        binding.getSocketBindings().getNamedRegistry().registerBinding(new ConnectorBinding(binding));
        //notify SipServer only when connector has already been added/started
        getSipServer().connectorAdded(connector);        
    }
1137238
public static void initializeSmsRadarService(Context context, SmsListener smsListener) {
		SmsRadar.smsListener = smsListener;
		Intent intent = new Intent(context, SmsRadarService.class);
		context.startService(intent);
	}
36678
public void handleContextControlProtocol(
      final EvaluatorRuntimeProtocol.ContextControlProto controlMessage) {

    synchronized (this.heartBeatManager) {
      try {
        if (controlMessage.hasAddContext() && controlMessage.hasRemoveContext()) {
          throw new IllegalArgumentException(
              "Received a message with both add and remove context. This is unsupported.");
        }

        final byte[] message = controlMessage.hasTaskMessage() ?
            controlMessage.getTaskMessage().toByteArray() : null;

        if (controlMessage.hasAddContext()) {
          this.addContext(controlMessage.getAddContext());
          if (controlMessage.hasStartTask()) {
            // We support submitContextAndTask()
            this.startTask(controlMessage.getStartTask());
          } else {
            // We need to trigger a heartbeat here.
            // In other cases, the heartbeat will be triggered by the TaskRuntime
            // Therefore this call can not go into addContext.
            this.heartBeatManager.sendHeartbeat();
          }
        } else if (controlMessage.hasRemoveContext()) {
          this.removeContext(controlMessage.getRemoveContext().getContextId());
        } else if (controlMessage.hasStartTask()) {
          this.startTask(controlMessage.getStartTask());
        } else if (controlMessage.hasStopTask()) {
          this.contextStack.peek().closeTask(message);
        } else if (controlMessage.hasSuspendTask()) {
          this.contextStack.peek().suspendTask(message);
        } else if (controlMessage.hasTaskMessage()) {
          this.contextStack.peek().deliverTaskMessage(message);
        } else if (controlMessage.hasContextMessage()) {
          final EvaluatorRuntimeProtocol.ContextMessageProto contextMessageProto = controlMessage.getContextMessage();
          boolean deliveredMessage = false;
          for (final ContextRuntime context : this.contextStack) {
            if (context.getIdentifier().equals(contextMessageProto.getContextId())) {
              context.handleContextMessage(contextMessageProto.getMessage().toByteArray());
              deliveredMessage = true;
              break;
            }
          }
          if (!deliveredMessage) {
            throw new IllegalStateException(
                "Sent message to unknown context " + contextMessageProto.getContextId());
          }
        } else {
          throw new RuntimeException("Unknown task control message: " + controlMessage);
        }
      } catch (final TaskClientCodeException e) {
        this.handleTaskException(e);
      } catch (final ContextClientCodeException e) {
        this.handleContextException(e);
      }
    }

  }
36567
public static void registerXiaomiPush(Context context, String miAppId, String miAppKey) {
    registerXiaomiPush(context, miAppId, miAppKey, "");
  }
446777
public static boolean isSupportVIVOPush(Context context) {
    com.vivo.push.PushClient client = com.vivo.push.PushClient.getInstance(context);
    if (null == client) {
      return false;
    }
    return client.isSupport();
  }
1227594
@Override
  public void onNotificationMessageArrived(Context context, com.xiaomi.mipush.sdk.MiPushMessage miPushMessage) {
    if (null != miPushMessage) {
      String content = miPushMessage.getContent();
      if (!StringUtil.isEmpty(content)) {
        AndroidNotificationManager androidNotificationManager = AndroidNotificationManager.getInstance();
        androidNotificationManager.porcessMixNotificationArrived(content, AV_MIXPUSH_MI_NOTIFICATION_ARRIVED_ACTION);
      }
    }
  }
267380
public static void init(Context context) {
    String apiKey = readApiKey(context);
    init(context, apiKey);
  }
702274
public OkVolley init(Context context) {
        this.mContext = context;
        InstanceRequestQueue = newRequestQueue(context);
        mUserAgent = generateUserAgent(context);
        mRequestHeaders = new HashMap<>();
        mRequestHeaders.put(OkRequest.HEADER_USER_AGENT, mUserAgent);
        mRequestHeaders.put(OkRequest.HEADER_ACCEPT_CHARSET, OkRequest.CHARSET_UTF8);
        return this;
    }
485471
function (options) {
  debug("MiPush:Sender init:", options);

  this.appSecret = options.appSecret;
  this.request   = request;
  this.urls      = new constants();
}
527959
public static void stopSmsRadarService(Context context) {
		SmsRadar.smsListener = null;
		Intent intent = new Intent(context, SmsRadarService.class);
		context.stopService(intent);
	}
726214
private void processMiNotification(com.xiaomi.mipush.sdk.MiPushMessage miPushMessage) {
    if (null != miPushMessage) {
      String content = miPushMessage.getContent();
      if (!StringUtil.isEmpty(content)) {
        AndroidNotificationManager androidNotificationManager = AndroidNotificationManager.getInstance();
        androidNotificationManager.processMixNotification(content, AV_MIXPUSH_MI_NOTIFICATION_ACTION);
      }
    }
  }
1049092
public static synchronized void sendBroadcast(final Context context, final Intent intent) {
		final String action = intent.getAction();
		final Set<BroadcastReceiver> receivers = ACTIONS.get(action);

		if (receivers != null) {
			for (final BroadcastReceiver receiver : receivers) {
				BROADCASTS.add(new Broadcast(receiver, intent));
			}
			notifyMessageHandler(context);
		}
	}