Skip to content

Commit 997b231

Browse files
committed
Merge branch 'develop' into feature/android_12_fixes
2 parents 71f80f4 + b51cda0 commit 997b231

79 files changed

Lines changed: 785 additions & 462 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 5.3.0 Release Notes
1+
# 5.3.1 Release Notes
22

33
## Summary:
44
||Version|
@@ -7,45 +7,8 @@
77
| **RPC** | 8.0.0
88
| **Tested Targeting** | Android 30
99

10-
11-
## Features:
12-
13-
- [[SDL 0293] Enable OEM exclusive apps support](https://github.com/smartdevicelink/sdl_java_suite/issues/1588)
14-
1510
## Bug Fixes / Enhancements:
1611

17-
- [New TaskMaster release needs to be added to Java Suite Library ](https://github.com/smartdevicelink/sdl_java_suite/issues/1745)
18-
19-
- [File Manager will upload the same file multiple times](https://github.com/smartdevicelink/sdl_java_suite/issues/1736)
20-
21-
- [Fix description for `SeatControlCapabilities` and `RadioControlCapabilities`](https://github.com/smartdevicelink/sdl_java_suite/issues/1739)
22-
23-
- [AudioStreamManager and AlertManager have the same queue ID](https://github.com/smartdevicelink/sdl_java_suite/issues/1742)
24-
25-
- [java.lang.IndexOutOfBoundsException Crash: SdlRouterService.java line 3275 ](https://github.com/smartdevicelink/sdl_java_suite/issues/1741)
26-
27-
- [Old devices with SDL 2.0 can't display text fields and SoftButtons](https://github.com/smartdevicelink/sdl_java_suite/issues/1729)
28-
29-
- [Swapping de-duplicated menu items causes incorrect unique titles](https://github.com/smartdevicelink/sdl_java_suite/issues/1723)
30-
31-
- [MenuCell title update issue](https://github.com/smartdevicelink/sdl_java_suite/issues/1651)
32-
33-
- [Refactor the Menu Manager to Use Queues ](https://github.com/smartdevicelink/sdl_java_suite/issues/1605)
34-
35-
- [Security queries are not implemented to spec](https://github.com/smartdevicelink/sdl_java_suite/issues/1720)
36-
37-
- [Choice Set Present followed directly by a Delete can have undefined behavior](https://github.com/smartdevicelink/sdl_java_suite/issues/1718)
38-
39-
- [Back-to-back choice sets can fail](https://github.com/smartdevicelink/sdl_java_suite/issues/1717)
40-
41-
- [Github CI fails even though tests pass locally ](https://github.com/smartdevicelink/sdl_java_suite/issues/1731)
42-
43-
- [Handler instances using deprecated constructors ](https://github.com/smartdevicelink/sdl_java_suite/issues/1696)
44-
45-
- [[SDL 0236] Update mismatch in TireStatus structure](https://github.com/smartdevicelink/sdl_java_suite/issues/1089)
46-
47-
- [Choices not saved as preloaded if some choices fail](https://github.com/smartdevicelink/sdl_java_suite/issues/1715)
48-
49-
- [MenuManager should print warning when trying to send AddSubMenu with voice commands](https://github.com/smartdevicelink/sdl_java_suite/issues/1760)
12+
- [userDidSubmitInput getting called multiple times after a search request is submitted](https://github.com/smartdevicelink/sdl_java_suite/issues/1768)
5013

51-
- [Spelling/ Grammar Updates](https://github.com/smartdevicelink/sdl_java_suite/issues/1754)
14+
- [NPE in SoftButtonReplaceOperation](https://github.com/smartdevicelink/sdl_java_suite/issues/1767)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.3.0
1+
5.3.1

android/sdl_android/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ android {
4040
}
4141
}
4242

43+
ext { VERSION_NAME = "$project.android.defaultConfig.versionName" }
44+
4345
dependencies {
4446
api fileTree(dir: 'libs', include: ['*.jar'])
4547
//api 'com.livio.taskmaster:taskmaster:0.6.0'

android/sdl_android/gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
GROUP=com.smartdevicelink
22
POM_ARTIFACT_ID=sdl_android
3-
VERSION_NAME=5.3.0
43

54
POM_NAME=sdl_android
65
POM_PACKAGING=aar

android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/AlertManagerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ public void setUp() throws Exception {
6868
public Void answer(InvocationOnMock invocation) {
6969
Object[] args = invocation.getArguments();
7070
OnPermissionChangeListener onPermissionChangeListener = (OnPermissionChangeListener) args[2];
71-
Map<FunctionID, PermissionStatus > allowedPermissions = new HashMap<>();
71+
Map<FunctionID, PermissionStatus> allowedPermissions = new HashMap<>();
7272
int permissionGroupStatus = PermissionManager.PERMISSION_GROUP_STATUS_DISALLOWED;
73-
onPermissionChangeListener.onPermissionsChange(allowedPermissions,permissionGroupStatus);
73+
onPermissionChangeListener.onPermissionsChange(allowedPermissions, permissionGroupStatus);
7474
return null;
7575
}
7676
};

android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/PresentAlertOperationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ public void testPresentAlertTruncatedText() {
194194

195195
windowCapability = getWindowCapability(2);
196196

197-
presentAlertOperation = new PresentAlertOperation(internalInterface, alertView, windowCapability, speechCapabilities, fileManager, 1, alertCompletionListener, alertSoftButtonClearListener);
197+
presentAlertOperation = new PresentAlertOperation(internalInterface, alertView, windowCapability, speechCapabilities, fileManager, 1, alertCompletionListener, alertSoftButtonClearListener);
198198
alert = presentAlertOperation.alertRpc();
199199
assertEquals(alert.getAlertText1(), alertView.getText());
200-
assertEquals(alert.getAlertText2(),alertView.getSecondaryText() + " - " + alertView.getTertiaryText());
200+
assertEquals(alert.getAlertText2(), alertView.getSecondaryText() + " - " + alertView.getTertiaryText());
201201
}
202202

203203
@Test

android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -209,22 +209,19 @@ public void testSettingSoftButtonId() {
209209
SoftButtonObject softButtonObject3 = new SoftButtonObject("object1", Arrays.asList(softButtonState1, softButtonState2), softButtonState1.getName(), null);
210210
SoftButtonObject softButtonObject4 = new SoftButtonObject("object2", Arrays.asList(softButtonState3, softButtonState4), softButtonState3.getName(), null);
211211
assertTrue(screenManager.checkAndAssignButtonIds(softButtonObjects, BaseScreenManager.ManagerLocation.SOFTBUTTON_MANAGER));
212-
213-
214-
215-
216-
217212
}
213+
218214
@Test
219215
public void testAssigningIdsToSoftButtonObjects() {
216+
SoftButtonState defaultState = new SoftButtonState("default", "hi", null);
220217
SoftButtonObject sbo1, sbo2, sbo3, sbo4, sbo5;
221218

222219
// Case 1 - don't set id for any button (Manager should set ids automatically starting from 1 and up)
223-
sbo1 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
224-
sbo2 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
225-
sbo3 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
226-
sbo4 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
227-
sbo5 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
220+
sbo1 = new SoftButtonObject(null, defaultState, null);
221+
sbo2 = new SoftButtonObject(null, defaultState, null);
222+
sbo3 = new SoftButtonObject(null, defaultState, null);
223+
sbo4 = new SoftButtonObject(null, defaultState, null);
224+
sbo5 = new SoftButtonObject(null, defaultState, null);
228225
screenManager.checkAndAssignButtonIds(Arrays.asList(sbo1, sbo2, sbo3, sbo4, sbo5), BaseScreenManager.ManagerLocation.SOFTBUTTON_MANAGER);
229226
assertEquals("SoftButtonObject id doesn't match the expected value", 1, sbo1.getButtonId());
230227
assertEquals("SoftButtonObject id doesn't match the expected value", 2, sbo2.getButtonId());
@@ -234,15 +231,15 @@ public void testAssigningIdsToSoftButtonObjects() {
234231

235232

236233
// Case 2 - Set ids for all buttons (Manager shouldn't alter the ids set by developer)
237-
sbo1 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
234+
sbo1 = new SoftButtonObject(null, defaultState, null);
238235
sbo1.setButtonId(100);
239-
sbo2 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
236+
sbo2 = new SoftButtonObject(null, defaultState, null);
240237
sbo2.setButtonId(200);
241-
sbo3 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
238+
sbo3 = new SoftButtonObject(null, defaultState, null);
242239
sbo3.setButtonId(300);
243-
sbo4 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
240+
sbo4 = new SoftButtonObject(null, defaultState, null);
244241
sbo4.setButtonId(400);
245-
sbo5 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
242+
sbo5 = new SoftButtonObject(null, defaultState, null);
246243
sbo5.setButtonId(500);
247244
screenManager.checkAndAssignButtonIds(Arrays.asList(sbo1, sbo2, sbo3, sbo4, sbo5), BaseScreenManager.ManagerLocation.SOFTBUTTON_MANAGER);
248245
assertEquals("SoftButtonObject id doesn't match the expected value", 100, sbo1.getButtonId());
@@ -253,13 +250,13 @@ public void testAssigningIdsToSoftButtonObjects() {
253250

254251

255252
// Case 3 - Set ids for some buttons (Manager shouldn't alter the ids set by developer. And it should assign ids for the ones that don't have id)
256-
sbo1 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
253+
sbo1 = new SoftButtonObject(null, defaultState, null);
257254
sbo1.setButtonId(50);
258-
sbo2 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
259-
sbo3 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
260-
sbo4 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
255+
sbo2 = new SoftButtonObject(null, defaultState, null);
256+
sbo3 = new SoftButtonObject(null, defaultState, null);
257+
sbo4 = new SoftButtonObject(null, defaultState, null);
261258
sbo4.setButtonId(100);
262-
sbo5 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
259+
sbo5 = new SoftButtonObject(null, defaultState, null);
263260
screenManager.checkAndAssignButtonIds(Arrays.asList(sbo1, sbo2, sbo3, sbo4, sbo5), BaseScreenManager.ManagerLocation.SOFTBUTTON_MANAGER);
264261
assertEquals("SoftButtonObject id doesn't match the expected value", 50, sbo1.getButtonId());
265262
assertEquals("SoftButtonObject id doesn't match the expected value", 101, sbo2.getButtonId());

android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java

Lines changed: 118 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import java.util.Collections;
4545
import java.util.List;
4646

47+
4748
import static junit.framework.TestCase.assertEquals;
4849
import static junit.framework.TestCase.assertFalse;
4950
import static junit.framework.TestCase.assertNull;
@@ -350,8 +351,8 @@ public void onEvent(SoftButtonObject softButtonObject, OnButtonEvent onButtonEve
350351
softButtonStateList.add(softButtonState1);
351352
softButtonStateList2.add(softButtonState1);
352353
softButtonStateList2.add(softButtonState2);
353-
softButtonObject1 = new SoftButtonObject("hi", softButtonStateList, "Hi", null);
354-
softButtonObject2 = new SoftButtonObject("hi", softButtonStateList2, "Hi", null);
354+
softButtonObject1 = new SoftButtonObject("hi", softButtonStateList, softButtonStateList.get(0).getName(), null);
355+
softButtonObject2 = new SoftButtonObject("hi", softButtonStateList2, softButtonStateList2.get(0).getName(), null);
355356
assertNotEquals(softButtonObject1, softButtonObject2);
356357

357358
// Case 5: SoftButtonStates are not the same, assertFalse
@@ -365,8 +366,8 @@ public void onEvent(SoftButtonObject softButtonObject, OnButtonEvent onButtonEve
365366
assertNotEquals(softButtonObject1, softButtonObject2);
366367

367368
// Case 7: SoftButtonObject currentStateName not same, assertFalse
368-
softButtonObject1 = new SoftButtonObject("hi", softButtonStateList, "Hi", null);
369-
softButtonObject2 = new SoftButtonObject("hi", softButtonStateList, "Hi2", null);
369+
softButtonObject1 = new SoftButtonObject("hi", softButtonStateList2, softButtonStateList2.get(0).getName(), null);
370+
softButtonObject2 = new SoftButtonObject("hi", softButtonStateList2, softButtonStateList2.get(1).getName(), null);
370371
assertNotEquals(softButtonObject1, softButtonObject2);
371372
}
372373

@@ -402,4 +403,117 @@ public void testSoftButtonStateEquals() {
402403
softButtonState2 = new SoftButtonState("object1-state1", "o1s1", artwork1);
403404
assertEquals(softButtonState1, softButtonState2);
404405
}
406+
407+
/**
408+
* Test constructing SoftButtonObject with an empty state list
409+
*/
410+
@Test
411+
public void testConstructSoftButtonObjectWithEmptyStateList() {
412+
List<SoftButtonState> stateList = new ArrayList<>();
413+
SoftButtonObject softButtonObject = new SoftButtonObject("hello_there", stateList, "general_kenobi", null);
414+
assertNull(softButtonObject.getStates());
415+
}
416+
417+
/**
418+
* Test constructing SoftButtonObject with an nonempty state list
419+
*/
420+
@Test
421+
public void testConstructSoftButtonObjectWithNonEmptyStateList() {
422+
List<SoftButtonState> stateList = new ArrayList<>();
423+
SoftButtonState softButtonState = new SoftButtonState("general_kenobi", "General Kenobi", null);
424+
stateList.add(softButtonState);
425+
SoftButtonObject softButtonObject = new SoftButtonObject("hello_there", stateList, "general_kenobi", null);
426+
assertEquals(stateList, softButtonObject.getStates());
427+
}
428+
429+
/**
430+
* Test constructing SoftButtonObject with an invalid initialStateName
431+
*/
432+
@Test
433+
public void testConstructSoftButtonObjectWithInvalidInitialStateName() {
434+
List<SoftButtonState> stateList = new ArrayList<>();
435+
SoftButtonState softButtonState = new SoftButtonState("general_kenobi", "General Kenobi", null);
436+
stateList.add(softButtonState);
437+
SoftButtonObject softButtonObject = new SoftButtonObject("hello_there", stateList, "hello_there", null);
438+
assertNull(softButtonObject.getStates());
439+
}
440+
441+
/**
442+
* Test assigning an empty state list to existing SoftButtonObject
443+
*/
444+
@Test
445+
public void testAssignEmptyStateListToSoftButtonObject() {
446+
List<SoftButtonState> nonEmptyStateList = new ArrayList<>();
447+
List<SoftButtonState> emptyStateList = new ArrayList<>();
448+
SoftButtonState softButtonState = new SoftButtonState("general_kenobi", "General Kenobi", null);
449+
nonEmptyStateList.add(softButtonState);
450+
451+
SoftButtonObject softButtonObject = new SoftButtonObject("hello_there", nonEmptyStateList, "general_kenobi", null);
452+
453+
softButtonObject.setStates(emptyStateList);
454+
assertEquals(nonEmptyStateList, softButtonObject.getStates());
455+
}
456+
457+
/**
458+
* Test assigning a state list with the current state to existing SoftButtonObject
459+
*/
460+
@Test
461+
public void testAssignStateListWithCurrentStateToSoftButtonObject() {
462+
List<SoftButtonState> stateList1 = new ArrayList<>();
463+
SoftButtonState softButtonState1 = new SoftButtonState("hello_there", "Hello there", null);
464+
stateList1.add(softButtonState1);
465+
466+
List<SoftButtonState> stateList2 = new ArrayList<>();
467+
SoftButtonState softButtonState2 = new SoftButtonState("general_kenobi", "General Kenobi", null);
468+
stateList2.add(softButtonState1);
469+
stateList2.add(softButtonState2);
470+
471+
SoftButtonObject softButtonObject = new SoftButtonObject("general_kenobi", stateList1, "hello_there", null);
472+
473+
softButtonObject.setStates(stateList2);
474+
475+
assertEquals(stateList2, softButtonObject.getStates());
476+
}
477+
478+
/**
479+
* Test assigning a state list without the current state to existing SoftButtonObject
480+
*/
481+
@Test
482+
public void testAssignStateListWithoutCurrentStateToSoftButtonObject() {
483+
List<SoftButtonState> stateList1 = new ArrayList<>();
484+
SoftButtonState softButtonState1 = new SoftButtonState("hello_there", "Hello there", null);
485+
stateList1.add(softButtonState1);
486+
487+
List<SoftButtonState> stateList2 = new ArrayList<>();
488+
SoftButtonState softButtonState2 = new SoftButtonState("general_kenobi", "General Kenobi", null);
489+
stateList2.add(softButtonState2);
490+
491+
SoftButtonObject softButtonObject = new SoftButtonObject("general_kenobi", stateList1, "hello_there", null);
492+
493+
softButtonObject.setStates(stateList2);
494+
495+
assertEquals(stateList2, softButtonObject.getStates());
496+
}
497+
498+
/**
499+
* Test assigning a state list with states that have the same name to existing SoftButtonObject
500+
*/
501+
@Test
502+
public void testAssignSameNameStateListToSoftButtonObject() {
503+
List<SoftButtonState> stateListUnique = new ArrayList<>();
504+
SoftButtonState softButtonState1 = new SoftButtonState("hello_there", "Hello there", null);
505+
stateListUnique.add(softButtonState1);
506+
507+
List<SoftButtonState> stateListDuplicateNames = new ArrayList<>();
508+
SoftButtonState softButtonState2 = new SoftButtonState("general_kenobi", "General Kenobi", null);
509+
stateListDuplicateNames.add(softButtonState2);
510+
SoftButtonState softButtonState3 = new SoftButtonState("general_kenobi", "General Kenobi Again", null);
511+
stateListDuplicateNames.add(softButtonState3);
512+
513+
SoftButtonObject softButtonObject = new SoftButtonObject("general_kenobi", stateListUnique, "hello_there", null);
514+
515+
softButtonObject.setStates(stateListDuplicateNames);
516+
517+
assertEquals(stateListUnique, softButtonObject.getStates());
518+
}
405519
}

android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManagerTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,15 @@ public void testDefaultWindowCapabilityNotSet() throws NoSuchFieldException, Ill
279279
newCSM.setKeyboardConfiguration(newCSM.defaultKeyboardConfiguration());
280280
Field field = BaseChoiceSetManager.class.getDeclaredField("keyboardConfiguration");
281281
field.setAccessible(true);
282-
KeyboardProperties properties = (KeyboardProperties)field.get(newCSM);
282+
KeyboardProperties properties = (KeyboardProperties) field.get(newCSM);
283283
assertEquals(properties, csm.defaultKeyboardConfiguration());
284284

285285
// Test presentKeyboard
286286
newCSM = new ChoiceSetManager(internalInterface, fileManager);
287287
newCSM.presentKeyboard("qwerty", newCSM.defaultKeyboardConfiguration(), null);
288288
field = BaseChoiceSetManager.class.getDeclaredField("keyboardConfiguration");
289289
field.setAccessible(true);
290-
properties = (KeyboardProperties)field.get(newCSM);
290+
properties = (KeyboardProperties) field.get(newCSM);
291291
assertEquals(properties, csm.defaultKeyboardConfiguration());
292292
}
293293

@@ -314,7 +314,7 @@ public void testDefaultWindowCapabilityTooManyKeys() throws NoSuchFieldException
314314
Field field = BaseChoiceSetManager.class.getDeclaredField("keyboardConfiguration");
315315
field.setAccessible(true);
316316

317-
KeyboardProperties getProperties = (KeyboardProperties)field.get(newCSM);
317+
KeyboardProperties getProperties = (KeyboardProperties) field.get(newCSM);
318318

319319
assertEquals(getProperties.getCustomKeys().size(), 1);
320320
}
@@ -342,7 +342,7 @@ public void testCustomKeysNull() throws NoSuchFieldException, IllegalAccessExcep
342342
Field field = BaseChoiceSetManager.class.getDeclaredField("keyboardConfiguration");
343343
field.setAccessible(true);
344344

345-
KeyboardProperties getProperties = (KeyboardProperties)field.get(newCSM);
345+
KeyboardProperties getProperties = (KeyboardProperties) field.get(newCSM);
346346

347347
assertNull(getProperties.getCustomKeys());
348348
}
@@ -373,7 +373,7 @@ public void testMaskInputCharactersNotSupported() throws NoSuchFieldException, I
373373
Field field = BaseChoiceSetManager.class.getDeclaredField("keyboardConfiguration");
374374
field.setAccessible(true);
375375

376-
KeyboardProperties getProperties = (KeyboardProperties)field.get(newCSM);
376+
KeyboardProperties getProperties = (KeyboardProperties) field.get(newCSM);
377377

378378
assertNull(getProperties.getMaskInputCharacters());
379379
}

0 commit comments

Comments
 (0)