Home | History | Annotate | Download | only in common

Lines Matching refs:service

55     // The list of callbacks indexed by service id.
103 * @param service The service to whom the message is addressed.
108 public boolean sendMessage(int service, int what, ByteBuffer content) {
109 checkServiceId(service);
122 mOutputBuffer.putShort((short)service);
174 * Registers a service and provides a callback to receive messages.
176 * @param service The service id.
179 public void registerService(int service, Callback callback) {
180 checkServiceId(service);
186 mServices.put(service, callback);
191 * Unregisters a service.
193 * @param service The service to unregister.
195 public void unregisterService(int service) {
196 checkServiceId(service);
199 mServices.remove(service);
203 private void dispatchMessageReceived(int service, int what, ByteBuffer content) {
206 callback = mServices.get(service);
209 callback.onMessageReceived(service, what, content);
212 + " for unregistered service " + service);
216 private static void checkServiceId(int service) {
217 if (service < 0 || service > 0xffff) {
218 throw new IllegalArgumentException("service id out of range: " + service);
243 * @param service The service to whom the message is addressed.
247 public void onMessageReceived(int service, int what, ByteBuffer content);
257 final int service = buffer.getShort() & 0xffff;
261 dispatchMessageReceived(service, what, null);
265 dispatchMessageReceived(service, what, buffer);