@@ -284,7 +284,7 @@ public void call(Object... args) {
284284 ModelResultChecker modelResultChecker = ATS .gson .fromJson ("" +args [0 ],ModelResultChecker .class );
285285 if (modelResultChecker .getResult () == 1 ){
286286 ModelTagListener modelTagListener = ATS .gson .fromJson ("" +args [0 ],ModelTagListener .class );
287- handlerForAtsTagListener ("" +modelResultChecker .getMessage (), atsTagListener ,1 );
287+ handlerForAtsTagListener ("" +modelResultChecker .getMessage (),"" , atsTagListener ,1 );
288288
289289 String tagListening = ATS .mBuilder .mApplication .getSharedPreferences (ATSConstants .PREFRENCES , Context .MODE_PRIVATE ).getString (ATSConstants .KEYS .LISTEN_TAG ,"NA" );
290290 if (!tagListening .equals ("NA" )){ mSocket .off ("" +modelTagListener .getResponse ().get (0 ).getUls ()); }
@@ -296,28 +296,29 @@ public void call(Object... args) {
296296 mSocket .on (modelTagListener .getResponse ().get (0 ).getUls (), new Emitter .Listener () {
297297 @ Override
298298 public void call (Object ... args ) {
299+ Log .e (TAG , "&& && " +args [0 ]);
299300 ModelEmitterbyTagData modelEmitterbyTagData = ATS .gson .fromJson ("" +args [0 ],ModelEmitterbyTagData .class );
300301 if (modelEmitterbyTagData .getType ().equals ("ADD" )){
301- handlerForAtsTagListener ("" +modelEmitterbyTagData .getData (), atsTagListener ,3 );
302+ handlerForAtsTagListener ("" +modelEmitterbyTagData .getData (),modelEmitterbyTagData . getAts_id (), atsTagListener ,3 );
302303 }if (modelEmitterbyTagData .getType ().equals ("CHANGE" )){
303- handlerForAtsTagListener ("" +modelEmitterbyTagData .getData (), atsTagListener ,4 );
304+ handlerForAtsTagListener ("" +modelEmitterbyTagData .getData (),modelEmitterbyTagData . getAts_id (), atsTagListener ,4 );
304305 }if (modelEmitterbyTagData .getType ().equals ("REMOVE" )){
305- handlerForAtsTagListener ("" +modelEmitterbyTagData .getData (), atsTagListener ,5 );
306+ handlerForAtsTagListener ("" +modelEmitterbyTagData .getData (),modelEmitterbyTagData . getAts_id (), atsTagListener ,5 );
306307 }
307308
308309 }
309310 });
310311
311312 }else if (modelResultChecker .getResult () == 0 ){
312- handlerForAtsTagListener ("" +modelResultChecker .getMessage (), atsTagListener ,2 );
313+ handlerForAtsTagListener ("" +modelResultChecker .getMessage (), "" , atsTagListener ,2 );
313314 }
314315 }
315316 });
316317 }else {
317- handlerForAtsTagListener ("You are not connected with the server." , atsTagListener , 2 );
318+ handlerForAtsTagListener ("You are not connected with the server." , "" , atsTagListener , 2 );
318319 }
319320 }catch (Exception e ){
320- handlerForAtsTagListener ("Exception: " +e .getMessage (), atsTagListener , 2 );
321+ handlerForAtsTagListener ("Exception: " +e .getMessage (), "" , atsTagListener , 2 );
321322 }
322323 }
323324
@@ -471,7 +472,7 @@ public void run() {
471472 }
472473
473474
474- private static void handlerForAtsTagListener (final String message , final AtsTagListener atsTagListener , int type ){
475+ private static void handlerForAtsTagListener (final String message , final String driverAtsid , final AtsTagListener atsTagListener , int type ){
475476 if (type == 1 ){ // on success
476477 mHandler .post (new Runnable () {
477478 @ Override
@@ -498,7 +499,7 @@ public void run() {
498499 location .setLongitude (Double .parseDouble ("" +splitter [1 ]));
499500 location .setAccuracy (Float .parseFloat ("" +splitter [2 ]));
500501 location .setBearing (Float .parseFloat ("" +splitter [3 ]));
501- atsTagListener .onAdd (location );
502+ atsTagListener .onAdd (location , "" + driverAtsid );
502503 }
503504 });
504505
@@ -512,7 +513,7 @@ public void run() {
512513 location .setLongitude (Double .parseDouble ("" +splitter [1 ]));
513514 location .setAccuracy (Float .parseFloat ("" +splitter [2 ]));
514515 location .setBearing (Float .parseFloat ("" +splitter [3 ]));
515- atsTagListener .onChange (location );
516+ atsTagListener .onChange (location , "" + driverAtsid );
516517 }
517518 });
518519
@@ -526,7 +527,7 @@ public void run() {
526527 location .setLongitude (Double .parseDouble ("" +splitter [1 ]));
527528 location .setAccuracy (Float .parseFloat ("" +splitter [2 ]));
528529 location .setBearing (Float .parseFloat ("" +splitter [3 ]));
529- atsTagListener .onRemove (location );
530+ atsTagListener .onRemove (location , "" + driverAtsid );
530531 }
531532 });
532533
0 commit comments