Skip to content

Commit 531f490

Browse files
bilal-alsharifijoeygrover
authored andcommitted
Fix the UnsubscribeVehicleData.setCloudAppVehicleID() method (#1027)
* Fix an issue in UnsubscribeVehicleData * Fix some javadoc issues in UnsubscribeVehicleData
1 parent 6e7a0a0 commit 531f490

File tree

2 files changed

+37
-31
lines changed

2 files changed

+37
-31
lines changed

android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ protected RPCMessage createMessage() {
5353
msg.setFuelRange(Test.GENERAL_BOOLEAN);
5454
msg.setTurnSignal(Test.GENERAL_BOOLEAN);
5555
msg.setElectronicParkBrakeStatus(Test.GENERAL_BOOLEAN);
56+
msg.setCloudAppVehicleID(Test.GENERAL_BOOLEAN);
5657

5758
return msg;
5859
}
@@ -99,7 +100,8 @@ protected JSONObject getExpectedParameters(int sdlVersion) {
99100
result.put(UnsubscribeVehicleData.KEY_MY_KEY, Test.GENERAL_BOOLEAN);
100101
result.put(UnsubscribeVehicleData.KEY_FUEL_RANGE, Test.GENERAL_BOOLEAN);
101102
result.put(UnsubscribeVehicleData.KEY_TURN_SIGNAL, Test.GENERAL_BOOLEAN);
102-
result.put(UnsubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_BOOLEAN);
103+
result.put(UnsubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_BOOLEAN);
104+
result.put(UnsubscribeVehicleData.KEY_CLOUD_APP_VEHICLE_ID, Test.GENERAL_BOOLEAN);
103105
} catch (JSONException e) {
104106
fail(Test.JSON_FAIL);
105107
}
@@ -140,6 +142,7 @@ public void testRpcValues(){
140142
assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getFuelRange());
141143
assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getTurnSignal());
142144
assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getElectronicParkBrakeStatus());
145+
assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getCloudAppVehicleID());
143146

144147
// Invalid/Null Tests
145148
UnsubscribeVehicleData msg = new UnsubscribeVehicleData();
@@ -173,7 +176,8 @@ public void testRpcValues(){
173176
assertNull(Test.NULL, msg.getMyKey());
174177
assertNull(Test.NULL, msg.getFuelRange());
175178
assertNull(Test.NULL, msg.getTurnSignal());
176-
assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
179+
assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
180+
assertNull(Test.NULL, msg.getCloudAppVehicleID());
177181
}
178182

179183
/**
@@ -223,6 +227,8 @@ public void testJsonConstructor () {
223227
assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_FUEL_RANGE), cmd.getFuelRange());
224228
assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal());
225229
assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus());
230+
assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_CLOUD_APP_VEHICLE_ID), cmd.getCloudAppVehicleID());
231+
226232
}
227233
catch (JSONException e) {
228234
fail(Test.JSON_FAIL);

base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* <tr>
2525
* <td>gps</td>
2626
* <td>Boolean</td>
27-
* <td>GPS data. See {@linkplain GPSdata} for details</td>
27+
* <td>GPS data. See {@linkplain GPSData} for details</td>
2828
* <td>N</td>
2929
* <td>Subscribable</td>
3030
* <td>SmartDeviceLink 2.0 </td>
@@ -297,7 +297,7 @@ public UnsubscribeVehicleData(Hashtable<String, Object> hash) {
297297
}
298298

299299
/**
300-
* Sets a boolean value. If true, unsubscribes Gps data
300+
* Sets a boolean value. If true, unsubscribes from Gps data
301301
*
302302
* @param gps
303303
* a boolean value
@@ -317,7 +317,7 @@ public Boolean getGps() {
317317
}
318318

319319
/**
320-
* Sets a boolean value. If true, unsubscribes speed data
320+
* Sets a boolean value. If true, unsubscribes from speed data
321321
*
322322
* @param speed
323323
* a boolean value
@@ -357,7 +357,7 @@ public Boolean getRpm() {
357357
}
358358

359359
/**
360-
* Sets a boolean value. If true, unsubscribes FuelLevel data
360+
* Sets a boolean value. If true, unsubscribes from FuelLevel data
361361
*
362362
* @param fuelLevel
363363
* a boolean value
@@ -378,7 +378,7 @@ public Boolean getFuelLevel() {
378378
}
379379

380380
/**
381-
* Sets a boolean value. If true, unsubscribes fuelLevel_State data
381+
* Sets a boolean value. If true, unsubscribes from fuelLevel_State data
382382
*
383383
* @param fuelLevel_State
384384
* a boolean value
@@ -401,7 +401,7 @@ public Boolean getFuelLevel_State() {
401401
}
402402

403403
/**
404-
* Sets a boolean value. If true, unsubscribes fuelLevelState data
404+
* Sets a boolean value. If true, unsubscribes from fuelLevelState data
405405
*
406406
* @param fuelLevelState
407407
* a boolean value
@@ -422,7 +422,7 @@ public Boolean getFuelLevelState() {
422422
}
423423

424424
/**
425-
* Sets a boolean value. If true, unsubscribes instantFuelConsumption data
425+
* Sets a boolean value. If true, unsubscribes from instantFuelConsumption data
426426
*
427427
* @param instantFuelConsumption
428428
* a boolean value
@@ -443,7 +443,7 @@ public Boolean getInstantFuelConsumption() {
443443
}
444444

445445
/**
446-
* Sets a boolean value. If true, unsubscribes externalTemperature data
446+
* Sets a boolean value. If true, unsubscribes from externalTemperature data
447447
*
448448
* @param externalTemperature
449449
* a boolean value
@@ -485,7 +485,7 @@ public Boolean getPrndl() {
485485
}
486486

487487
/**
488-
* Sets a boolean value. If true, unsubscribes tire pressure status data
488+
* Sets a boolean value. If true, unsubscribes from tire pressure status data
489489
*
490490
* @param tirePressure
491491
* a boolean value
@@ -506,7 +506,7 @@ public Boolean getTirePressure() {
506506
}
507507

508508
/**
509-
* Sets a boolean value. If true, unsubscribes odometer data
509+
* Sets a boolean value. If true, unsubscribes from odometer data
510510
*
511511
* @param odometer
512512
* a boolean value
@@ -527,7 +527,7 @@ public Boolean getOdometer() {
527527
}
528528

529529
/**
530-
* Sets a boolean value. If true, unsubscribes belt Status data
530+
* Sets a boolean value. If true, unsubscribes from belt Status data
531531
*
532532
* @param beltStatus
533533
* a boolean value
@@ -548,7 +548,7 @@ public Boolean getBeltStatus() {
548548
}
549549

550550
/**
551-
* Sets a boolean value. If true, unsubscribes body Information data
551+
* Sets a boolean value. If true, unsubscribes from body Information data
552552
*
553553
* @param bodyInformation
554554
* a boolean value
@@ -569,7 +569,7 @@ public Boolean getBodyInformation() {
569569
}
570570

571571
/**
572-
* Sets a boolean value. If true, unsubscribes device Status data
572+
* Sets a boolean value. If true, unsubscribes from device Status data
573573
*
574574
* @param deviceStatus
575575
* a boolean value
@@ -590,7 +590,7 @@ public Boolean getDeviceStatus() {
590590
}
591591

592592
/**
593-
* Sets a boolean value. If true, unsubscribes driver Braking data
593+
* Sets a boolean value. If true, unsubscribes from driver Braking data
594594
*
595595
* @param driverBraking
596596
* a boolean value
@@ -611,7 +611,7 @@ public Boolean getDriverBraking() {
611611
}
612612

613613
/**
614-
* Sets a boolean value. If true, unsubscribes wiper Status data
614+
* Sets a boolean value. If true, unsubscribes from wiper Status data
615615
*
616616
* @param wiperStatus
617617
* a boolean value
@@ -632,7 +632,7 @@ public Boolean getWiperStatus() {
632632
}
633633

634634
/**
635-
* Sets a boolean value. If true, unsubscribes Head Lamp Status data
635+
* Sets a boolean value. If true, unsubscribes from Head Lamp Status data
636636
*
637637
* @param headLampStatus
638638
* a boolean value
@@ -653,7 +653,7 @@ public Boolean getHeadLampStatus() {
653653
}
654654

655655
/**
656-
* Sets a boolean value. If true, unsubscribes Engine Torque data
656+
* Sets a boolean value. If true, unsubscribes from Engine Torque data
657657
*
658658
* @param engineTorque
659659
* a boolean value
@@ -674,7 +674,7 @@ public Boolean getEngineTorque() {
674674
}
675675

676676
/**
677-
* Sets a boolean value. If true, unsubscribes Engine Oil Life data
677+
* Sets a boolean value. If true, unsubscribes from Engine Oil Life data
678678
*
679679
* @param engineOilLife
680680
* a boolean value
@@ -696,7 +696,7 @@ public Boolean getEngineOilLife() {
696696

697697

698698
/**
699-
* Sets a boolean value. If true, unsubscribes accPedalPosition data
699+
* Sets a boolean value. If true, unsubscribes from accPedalPosition data
700700
*
701701
* @param accPedalPosition
702702
* a boolean value
@@ -756,7 +756,7 @@ public Boolean getMyKey() {
756756
}
757757

758758
/**
759-
* Sets a boolean value. If true, unsubscribes fuelRange data
759+
* Sets a boolean value. If true, unsubscribes from fuelRange data
760760
*
761761
* @param fuelRange
762762
* a boolean value
@@ -777,19 +777,19 @@ public Boolean getFuelRange() {
777777
}
778778

779779
/**
780-
* Sets a boolean value. If true, subscribes turnSignal data
780+
* Sets a boolean value. If true, unsubscribes from turnSignal data
781781
* @param turnSignal a boolean value
782782
*/
783783
public void setTurnSignal(Boolean turnSignal) { setParameters(KEY_TURN_SIGNAL, turnSignal); }
784784

785785
/**
786-
* Gets a boolean value. If true, means the turnSignal data has been subscribed.
786+
* Gets a boolean value. If true, means the turnSignal data has been unsubscribed.
787787
* @return a Boolean value.
788788
*/
789789
public Boolean getTurnSignal() { return getBoolean(KEY_TURN_SIGNAL); }
790790

791791
/**
792-
* Sets a boolean value. If true, subscribes electronicParkBrakeStatus data
792+
* Sets a boolean value. If true, unsubscribes from electronicParkBrakeStatus data
793793
* @param electronicParkBrakeStatus a boolean value
794794
*/
795795
public void setElectronicParkBrakeStatus(Boolean electronicParkBrakeStatus) {
@@ -805,18 +805,18 @@ public Boolean getElectronicParkBrakeStatus() {
805805
}
806806

807807
/**
808-
* Sets cloudAppVehicleID
809-
* @param cloudAppVehicleID a boolean value
808+
* Sets a boolean value. If true, unsubscribes from cloudAppVehicleID data
809+
* @param cloudAppVehicleID a boolean value.
810810
*/
811-
public void setCloudAppVehicleID(VehicleDataResult cloudAppVehicleID){
811+
public void setCloudAppVehicleID(boolean cloudAppVehicleID){
812812
setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
813813
}
814814

815815
/**
816-
* Gets a boolean value. If true, means the cloudAppVehicleDataID data should be unsubscribed.
816+
* Gets a boolean value. If true, means the cloudAppVehicleID data has been unsubscribed.
817817
* @return a Boolean value.
818818
*/
819-
public VehicleDataResult getCloudAppVehicleID(){
820-
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLOUD_APP_VEHICLE_ID);
819+
public Boolean getCloudAppVehicleID(){
820+
return getBoolean( KEY_CLOUD_APP_VEHICLE_ID);
821821
}
822822
}

0 commit comments

Comments
 (0)