@Test public void willSetupChannelOnFirstMessageIntent() { Intent intent = new Intent(); testAbstractChannelService.onBind(intent); assertThat(testAbstractChannelService.incomingHandler).isNotNull(); testAbstractChannelService.incomingHandler.handleMessage(setupEmptyMessage()); assertThat(testAbstractChannelService.channelServerMap).hasSize(1); assertThat(testAbstractChannelService.channelType).isEqualTo(CHANNEL_MESSENGER); }
@Override @NonNull public final IBinder onBind(Intent intent) { String clientId = getClientIdFromIntent(intent); String channelType = getChannelTypeFromIntent(intent); String clientPackageName = getClientPackageNameFromIntent(intent); Log.d(TAG, String.format("Bound to client %s channel type: %s", clientId, channelType)); return createServiceIncomingHandler(clientId, channelType, clientPackageName); }
AbstractChannelService extends Service { @Override @NonNull public final IBinder onBind(Intent intent) { String clientId = getClientIdFromIntent(intent); String channelType = getChannelTypeFromIntent(intent); String clientPackageName = getClientPackageNameFromIntent(intent); Log.d(TAG, String.format("Bound to client %s channel type: %s", clientId, channelType)); return createServiceIncomingHandler(clientId, channelType, clientPackageName); } }
AbstractChannelService extends Service { @Override @NonNull public final IBinder onBind(Intent intent) { String clientId = getClientIdFromIntent(intent); String channelType = getChannelTypeFromIntent(intent); String clientPackageName = getClientPackageNameFromIntent(intent); Log.d(TAG, String.format("Bound to client %s channel type: %s", clientId, channelType)); return createServiceIncomingHandler(clientId, channelType, clientPackageName); }  }
AbstractChannelService extends Service { @Override @NonNull public final IBinder onBind(Intent intent) { String clientId = getClientIdFromIntent(intent); String channelType = getChannelTypeFromIntent(intent); String clientPackageName = getClientPackageNameFromIntent(intent); Log.d(TAG, String.format("Bound to client %s channel type: %s", clientId, channelType)); return createServiceIncomingHandler(clientId, channelType, clientPackageName); }  @Override @NonNull final IBinder onBind(Intent intent); @NonNull IBinder createServiceIncomingHandler(String clientId, String channelType, String clientPackageName); void setStopSelfOnEndOfStream(boolean stopSelfOnEndOfStream); @Override boolean onUnbind(Intent intent); @Nullable ChannelServer getChannelServerForId(String clientMessageId); }
AbstractChannelService extends Service { @Override @NonNull public final IBinder onBind(Intent intent) { String clientId = getClientIdFromIntent(intent); String channelType = getChannelTypeFromIntent(intent); String clientPackageName = getClientPackageNameFromIntent(intent); Log.d(TAG, String.format("Bound to client %s channel type: %s", clientId, channelType)); return createServiceIncomingHandler(clientId, channelType, clientPackageName); }  @Override @NonNull final IBinder onBind(Intent intent); @NonNull IBinder createServiceIncomingHandler(String clientId, String channelType, String clientPackageName); void setStopSelfOnEndOfStream(boolean stopSelfOnEndOfStream); @Override boolean onUnbind(Intent intent); @Nullable ChannelServer getChannelServerForId(String clientMessageId);  }