下面是类internalRegister
方法的代码GCMRegistrar
static void internalRegister(Context context, String... senderIds) {
if (senderIds == null || senderIds.length == 0 ) {
throw new IllegalArgumentException("No senderIds");
}
StringBuilder builder = new StringBuilder(senderIds[0]);
for (int i = 1; i < senderIds.length; i++) {
builder.append(',').append(senderIds[i]);
}
String senders = builder.toString();
Log.v(TAG, "Registering app " + context.getPackageName() +
" of senders " + senders);
Intent intent = new Intent(GCMConstants.INTENT_TO_GCM_REGISTRATION);
intent.setPackage(GSF_PACKAGE);
intent.putExtra(GCMConstants.EXTRA_APPLICATION_PENDING_INTENT,
PendingIntent.getBroadcast(context, 0, new Intent(), 0));
intent.putExtra(GCMConstants.EXTRA_SENDER, senders);
context.startService(intent);
}
在最后一行代码中,它启动了一个应该联系 GCM 服务器的服务。GSM 服务器反过来发com.google.android.c2dm.intent.REGISTRATION
回广播。这是哪个服务?