aboutsummaryrefslogtreecommitdiff
path: root/car-lib/src/android/car/vms/VmsPublisherClientService.java
diff options
context:
space:
mode:
authorAsaf Rosenfeld <asafro@google.com>2017-07-18 10:56:11 -0700
committerAsaf Rosenfeld <asafro@google.com>2017-07-21 20:35:35 +0000
commit800cb0790d57b6cb3c7d6893ec687a21b614545e (patch)
treee3d4b2ce675088c1d3de6f3bfec9de2849cb7e9e /car-lib/src/android/car/vms/VmsPublisherClientService.java
parent4f7c940029f3e53198f6bc980b137f2f4a6312c0 (diff)
downloadCar-800cb0790d57b6cb3c7d6893ec687a21b614545e.tar.gz
Routing logic to use publisher ID
When publisher P is sending message for layer L, the routing logic will send the message to all listeners that subscribed to either layer L or Layer L + publisher P. Test: all tests pass + added tests for new use cases Bug: 63933446 Change-Id: I2f674149e7982ffede1f6426737ac1aef033b2c6
Diffstat (limited to 'car-lib/src/android/car/vms/VmsPublisherClientService.java')
-rw-r--r--car-lib/src/android/car/vms/VmsPublisherClientService.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/car-lib/src/android/car/vms/VmsPublisherClientService.java b/car-lib/src/android/car/vms/VmsPublisherClientService.java
index 3dca604de8..2b88487fbe 100644
--- a/car-lib/src/android/car/vms/VmsPublisherClientService.java
+++ b/car-lib/src/android/car/vms/VmsPublisherClientService.java
@@ -99,9 +99,11 @@ public abstract class VmsPublisherClientService extends Service {
*
* @param layer the layer to publish to.
* @param payload the message to be sent.
+ * @param publisherId the ID that got assigned to the publisher that published the message by
+ * VMS core.
* @return if the call to the method VmsPublisherService.publish was successful.
*/
- public final boolean publish(VmsLayer layer, byte[] payload) {
+ public final boolean publish(VmsLayer layer, int publisherId, byte[] payload) {
if (DBG) {
Log.d(TAG, "Publishing for layer : " + layer);
}
@@ -109,7 +111,7 @@ public abstract class VmsPublisherClientService extends Service {
IBinder token = getTokenForPublisherServiceThreadSafe();
try {
- mVmsPublisherService.publish(token, layer, payload);
+ mVmsPublisherService.publish(token, layer, publisherId, payload);
return true;
} catch (RemoteException e) {
Log.e(TAG, "unable to publish message: " + payload, e);