Skip to content

Commit c1afd4f

Browse files
authored
Merge pull request #1816 from smartdevicelink/release/5.5.0_RC
Release 5.5.0
2 parents 16b2ab6 + 527537c commit c1afd4f

File tree

18 files changed

+244
-176
lines changed

18 files changed

+244
-176
lines changed

CHANGELOG.md

+4-46
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 5.4.0 Release Notes
1+
# 5.5.0 Release Notes
22

33
## Summary:
44
||Version|
@@ -7,51 +7,9 @@
77
| **RPC** | 8.0.0
88
| **Tested Targeting** | Android 31
99

10-
## Bug Fixes / Enhancements:
10+
## Bug Fixes:
1111

12-
- [Video auto restarts streaming regardless if HMI level is streamable ](https://github.com/smartdevicelink/sdl_java_suite/issues/1807)
12+
- [ScreenManager tries to upload images even if they are not supported (SDL 2.0)](https://github.com/smartdevicelink/sdl_java_suite/issues/1738)
1313

14-
- [Video Streaming Fails on Android 12 at Low Resolutions](https://github.com/smartdevicelink/sdl_java_suite/issues/1803)
15-
16-
- [sdl_java_se uses deprecated testCompile in build.gradle](https://github.com/smartdevicelink/sdl_java_suite/issues/1805)
17-
18-
- [Incorrect behavior and potential crashes in PresentAlertOperation.supportsSoftButtonImages()](https://github.com/smartdevicelink/sdl_java_suite/issues/1800)
19-
20-
- [Bugfix/rs notification issue usb](https://github.com/smartdevicelink/sdl_java_suite/pull/1797)
21-
22-
- [Attempting to Send Voice Command with No Strings Fails to Log Error](https://github.com/smartdevicelink/sdl_java_suite/issues/1798)
23-
24-
- [Fix LCM to close down properly](https://github.com/smartdevicelink/sdl_java_suite/pull/1796)
25-
26-
- [Cleanup/proposal sdl 0286 spacing](https://github.com/smartdevicelink/sdl_java_suite/pull/1782)
27-
28-
- [API Reference Docs Typos](https://github.com/smartdevicelink/sdl_java_suite/issues/1792)
29-
30-
- [Foreground Service Notifications can be delayed by 10 seconds](https://github.com/smartdevicelink/sdl_java_suite/issues/1733)
31-
32-
- [Bluetooth Permission Requirements will change in Android 12](https://github.com/smartdevicelink/sdl_java_suite/issues/1732)
33-
34-
- [[SDL 0345] Android 12 Issues](https://github.com/smartdevicelink/sdl_java_suite/issues/1794)
35-
36-
- [SdlRouterService crashes if SDL app sets targetSdkVersion to 31, and running on Android 12](https://github.com/smartdevicelink/sdl_java_suite/issues/1751)
37-
38-
- [Error Code is cut off from bulk data when reading a SEND_INTERNAL_ERROR query](https://github.com/smartdevicelink/sdl_java_suite/issues/1790)
39-
40-
- [NPE crash in BaseLifecycleManager on checkLifecycleConfiguration](https://github.com/smartdevicelink/sdl_java_suite/issues/1783)
41-
42-
- [NPE crash in SdlDeviceListener](https://github.com/smartdevicelink/sdl_java_suite/issues/1780)
43-
44-
- [NPE crash in BaseLifecycleManager](https://github.com/smartdevicelink/sdl_java_suite/issues/1781)
45-
46-
- [SoftButtonObject doesn't handle error states correctly](https://github.com/smartdevicelink/sdl_java_suite/issues/1774)
47-
48-
- [ScrollableMessage.timeout units should be specified in documentation](https://github.com/smartdevicelink/sdl_java_suite/issues/1775)
49-
50-
- [Incorrect SPP error notification presented to user](https://github.com/smartdevicelink/sdl_java_suite/issues/1661)
51-
52-
- [SecurityQuery error notification payload not set](https://github.com/smartdevicelink/sdl_java_suite/issues/1753)
53-
54-
- [Menu Manager won't send submenu cell images on RPC versions >= 5.0 && < 7.0 #2047](https://github.com/smartdevicelink/sdl_java_suite/issues/1756)
55-
56-
- [GenerateSources gradle task in javaSE incorrectly reads the version from gradle.properties instead of VERSION file](https://github.com/smartdevicelink/sdl_java_suite/issues/1763)
14+
- [Fix formatting of many tables within the documentation](https://github.com/smartdevicelink/sdl_java_suite/pull/1810)
5715

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.4.0
1+
5.5.0

android/sdl_android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ android {
55
defaultConfig {
66
minSdkVersion 16
77
targetSdkVersion 31
8-
versionCode 22
8+
versionCode 23
99
versionName new File(projectDir.path, ('/../../VERSION')).text.trim()
1010
buildConfigField "String", "VERSION_NAME", '\"' + versionName + '\"'
1111
resValue "string", "SDL_LIB_VERSION", '\"' + versionName + '\"'

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

+24
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public Void answer(InvocationOnMock invocation) {
140140
taskmaster.start();
141141
when(internalInterface.getTaskmaster()).thenReturn(taskmaster);
142142
softButtonManager = new SoftButtonManager(internalInterface, fileManager);
143+
softButtonManager.isDynamicGraphicSupported = true;
143144

144145

145146
// When internalInterface.sendRPC() is called inside SoftButtonManager:
@@ -516,4 +517,27 @@ public void testAssignSameNameStateListToSoftButtonObject() {
516517

517518
assertEquals(stateListUnique, softButtonObject.getStates());
518519
}
520+
521+
@Test
522+
public void testSoftButtonManagerGraphicNotSupported() {
523+
softButtonManager.isDynamicGraphicSupported = false;
524+
fileManagerUploadArtworksListenerCalledCounter = 0;
525+
internalInterfaceSendRPCListenerCalledCounter = 0;
526+
527+
softButtonManager.setSoftButtonObjects(Arrays.asList(softButtonObject1, softButtonObject2));
528+
assertEquals("SoftButtonManager is uploading artwork, when graphic is not supported", 0, fileManagerUploadArtworksListenerCalledCounter);
529+
}
530+
531+
@Test
532+
public void testSoftButtonManagerDynamicImageNotSupportedNoText() {
533+
softButtonManager.isDynamicGraphicSupported = false;
534+
fileManagerUploadArtworksListenerCalledCounter = 0;
535+
internalInterfaceSendRPCListenerCalledCounter = 0;
536+
537+
SoftButtonState softButtonState = new SoftButtonState("testState", null, new SdlArtwork("image", FileType.GRAPHIC_PNG, 1, true));
538+
SoftButtonObject softButtonObject = new SoftButtonObject("obj1", softButtonState, null);
539+
540+
softButtonManager.setSoftButtonObjects(Arrays.asList(softButtonObject));
541+
assertEquals("SoftButtonManager is uploading artwork, when graphic is not supported", 0, fileManagerUploadArtworksListenerCalledCounter);
542+
}
519543
}

base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
4444
import com.smartdevicelink.protocol.enums.FunctionID;
4545
import com.smartdevicelink.proxy.RPCNotification;
46+
import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
4647
import com.smartdevicelink.proxy.rpc.DisplayCapability;
4748
import com.smartdevicelink.proxy.rpc.OnButtonEvent;
4849
import com.smartdevicelink.proxy.rpc.OnButtonPress;
@@ -58,7 +59,6 @@
5859

5960
import java.lang.ref.WeakReference;
6061
import java.util.ArrayList;
61-
import java.util.HashSet;
6262
import java.util.List;
6363
import java.util.concurrent.CopyOnWriteArrayList;
6464

@@ -71,6 +71,7 @@ abstract class BaseSoftButtonManager extends BaseSubManager {
7171
private static final String TAG = "BaseSoftButtonManager";
7272
private final WeakReference<FileManager> fileManager;
7373
SoftButtonCapabilities softButtonCapabilities;
74+
boolean isDynamicGraphicSupported;
7475
private CopyOnWriteArrayList<SoftButtonObject> softButtonObjects;
7576
private HMILevel currentHMILevel;
7677
private final OnSystemCapabilityListener onDisplayCapabilityListener;
@@ -99,6 +100,11 @@ abstract class BaseSoftButtonManager extends BaseSubManager {
99100
this.currentHMILevel = null;
100101
this.transactionQueue = newTransactionQueue();
101102
this.batchQueue = new ArrayList<>();
103+
DisplayCapabilities displayCapabilities = null;
104+
if (internalInterface.getSystemCapabilityManager() != null) {
105+
displayCapabilities = (DisplayCapabilities) this.internalInterface.getSystemCapabilityManager().getCapability(SystemCapabilityType.DISPLAY, null, false);
106+
}
107+
isDynamicGraphicSupported = (displayCapabilities != null && displayCapabilities.getGraphicSupported() != null) ? displayCapabilities.getGraphicSupported() : true;
102108

103109
this.updateListener = new SoftButtonObject.UpdateListener() {
104110
@Override
@@ -152,7 +158,7 @@ public void onCapabilityRetrieved(Object capability) {
152158

153159
// Auto-send an updated Show if we have new capabilities
154160
if (softButtonObjects != null && !softButtonObjects.isEmpty() && softButtonCapabilities != null && !softButtonCapabilitiesEquals(oldSoftButtonCapabilities, softButtonCapabilities)) {
155-
SoftButtonReplaceOperation operation = new SoftButtonReplaceOperation(internalInterface, fileManager, softButtonCapabilities, softButtonObjects, getCurrentMainField1());
161+
SoftButtonReplaceOperation operation = new SoftButtonReplaceOperation(internalInterface, fileManager, softButtonCapabilities, softButtonObjects, getCurrentMainField1(), isDynamicGraphicSupported);
156162
transactionQueue.add(operation, false);
157163
}
158164
}
@@ -311,7 +317,7 @@ protected void setSoftButtonObjects(@NonNull List<SoftButtonObject> list) {
311317
this.softButtonObjects = softButtonObjects;
312318

313319
// We only need to pass the first softButtonCapabilities in the array due to the fact that all soft button capabilities are the same (i.e. there is no way to assign a softButtonCapabilities to a specific soft button).
314-
SoftButtonReplaceOperation operation = new SoftButtonReplaceOperation(internalInterface, fileManager.get(), softButtonCapabilities, softButtonObjects, getCurrentMainField1());
320+
SoftButtonReplaceOperation operation = new SoftButtonReplaceOperation(internalInterface, fileManager.get(), softButtonCapabilities, softButtonObjects, getCurrentMainField1(), isDynamicGraphicSupported);
315321

316322
if (batchUpdates) {
317323
batchQueue.clear();

base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonReplaceOperation.java

+80-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.smartdevicelink.proxy.rpc.Show;
1111
import com.smartdevicelink.proxy.rpc.SoftButton;
1212
import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
13+
import com.smartdevicelink.proxy.rpc.enums.ImageType;
1314
import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
1415
import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
1516
import com.smartdevicelink.util.DebugTool;
@@ -30,14 +31,16 @@ class SoftButtonReplaceOperation extends Task {
3031
private final SoftButtonCapabilities softButtonCapabilities;
3132
private final CopyOnWriteArrayList<SoftButtonObject> softButtonObjects;
3233
private String currentMainField1;
34+
private Boolean isDynamicGraphicSupported;
3335

34-
SoftButtonReplaceOperation(ISdl internalInterface, FileManager fileManager, SoftButtonCapabilities softButtonCapabilities, CopyOnWriteArrayList<SoftButtonObject> softButtonObjects, String currentMainField1) {
36+
SoftButtonReplaceOperation(ISdl internalInterface, FileManager fileManager, SoftButtonCapabilities softButtonCapabilities, CopyOnWriteArrayList<SoftButtonObject> softButtonObjects, String currentMainField1, Boolean isDynamicGraphicSupported) {
3537
super("SoftButtonReplaceOperation");
3638
this.internalInterface = new WeakReference<>(internalInterface);
3739
this.fileManager = new WeakReference<>(fileManager);
3840
this.softButtonCapabilities = softButtonCapabilities;
3941
this.softButtonObjects = softButtonObjects;
4042
this.currentMainField1 = currentMainField1;
43+
this.isDynamicGraphicSupported = isDynamicGraphicSupported;
4144
}
4245

4346
@Override
@@ -65,6 +68,18 @@ public void onComplete(boolean success) {
6568
onFinished();
6669
}
6770
});
71+
} else if (!supportsDynamicSoftButtonImages()) {
72+
DebugTool.logInfo(TAG, "Soft button images are not supported. Attempting to send text and static image only soft buttons. If any button does not contain text and/or a static image, no buttons will be sent.");
73+
sendCurrentStateStaticImageOnlySoftButtons(new CompletionListener() {
74+
@Override
75+
public void onComplete(boolean success) {
76+
if (!success) {
77+
DebugTool.logError(TAG, "Buttons will not be sent because the module does not support dynamic images and some of the buttons do not have text or static images");
78+
}
79+
onFinished();
80+
}
81+
});
82+
6883
} else if (currentStateHasImages() && !allCurrentStateImagesAreUploaded()) {
6984
// If there are images that aren't uploaded
7085
// Send text buttons if all the soft buttons have text
@@ -128,6 +143,13 @@ private void uploadInitialStateImages(final CompletionListener completionListene
128143
}
129144
return;
130145
}
146+
if (!supportsDynamicSoftButtonImages()) {
147+
DebugTool.logInfo(TAG, "Head unit does not support dynamic images, skipping upload");
148+
if (completionListener != null) {
149+
completionListener.onComplete(false);
150+
}
151+
return;
152+
}
131153

132154
DebugTool.logInfo(TAG, "Uploading soft button initial artworks");
133155
if (fileManager.get() != null) {
@@ -236,6 +258,59 @@ public void onResponse(int correlationId, RPCResponse response) {
236258
}
237259
}
238260

261+
// Send soft buttons for the current state that only contain text and static images only, if possible.
262+
private void sendCurrentStateStaticImageOnlySoftButtons(final CompletionListener completionListener) {
263+
if (getState() == Task.CANCELED) {
264+
onFinished();
265+
}
266+
267+
DebugTool.logInfo(TAG, "Preparing to send text and static image only soft buttons");
268+
List<SoftButton> textButtons = new ArrayList<>();
269+
for (SoftButtonObject softButtonObject : softButtonObjects) {
270+
SoftButton softButton = softButtonObject.getCurrentStateSoftButton();
271+
if (softButton.getText() == null && softButton.getImage() != null && softButton.getImage().getImageType() == ImageType.DYNAMIC) {
272+
DebugTool.logWarning(TAG, "Attempted to create text and static image only buttons, but some buttons don't support text and have dynamic images, so no soft buttons will be sent.");
273+
if (completionListener != null) {
274+
completionListener.onComplete(false);
275+
}
276+
return;
277+
}
278+
279+
280+
if (softButton.getImage() != null && softButton.getImage().getImageType() == ImageType.DYNAMIC) {
281+
// We should create a new softButtonObject rather than modifying the original one
282+
SoftButton textAndStaticImageOnlySoftButton = new SoftButton(SoftButtonType.SBT_TEXT, softButton.getSoftButtonID());
283+
textAndStaticImageOnlySoftButton.setText(softButton.getText());
284+
textAndStaticImageOnlySoftButton.setSystemAction(softButton.getSystemAction());
285+
textAndStaticImageOnlySoftButton.setIsHighlighted(softButton.getIsHighlighted());
286+
textAndStaticImageOnlySoftButton.setImage(softButton.getImage());
287+
textButtons.add(textAndStaticImageOnlySoftButton);
288+
} else {
289+
textButtons.add(softButton);
290+
}
291+
}
292+
293+
Show show = new Show();
294+
show.setOnRPCResponseListener(new OnRPCResponseListener() {
295+
@Override
296+
public void onResponse(int correlationId, RPCResponse response) {
297+
if (response.getSuccess()) {
298+
DebugTool.logInfo(TAG, "Finished sending text and static image only soft buttons");
299+
} else {
300+
DebugTool.logWarning(TAG, "Failed to update soft buttons with text and static image only buttons");
301+
}
302+
if (completionListener != null) {
303+
completionListener.onComplete(response.getSuccess());
304+
}
305+
}
306+
});
307+
show.setMainField1(currentMainField1);
308+
show.setSoftButtons(textButtons);
309+
if (internalInterface.get() != null) {
310+
internalInterface.get().sendRPC(show);
311+
}
312+
}
313+
239314

240315
// Returns text soft buttons representing the current states of the button objects, or returns if _any_ of the buttons' current states are image only buttons.
241316
private void sendCurrentStateTextOnlySoftButtons(final CompletionListener completionListener) {
@@ -303,6 +378,10 @@ private boolean allCurrentStateImagesAreUploaded() {
303378
return true;
304379
}
305380

381+
private boolean supportsDynamicSoftButtonImages() {
382+
return softButtonCapabilities != null && Boolean.TRUE.equals(isDynamicGraphicSupported) && Boolean.TRUE.equals(softButtonCapabilities.getImageSupported());
383+
}
384+
306385
private boolean supportsSoftButtonImages() {
307386
return softButtonCapabilities != null && Boolean.TRUE.equals(softButtonCapabilities.getImageSupported());
308387
}

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@
113113
* <td>Optional secondary image struct for menu cell</td>
114114
* <td>N</td>
115115
* <td></td>
116-
* <td>
117-
* @since SmartDeviceLink 7.1.0
118-
* </td>
116+
* <td>SmartDeviceLink 7.1.0</td>
119117
* </tr>
120118
* </table>
121119
* <p> <b>Response</b></p><p>Indicates that the corresponding request has failed or succeeded, if the response returns with a SUCCESS result code, this means a command was added to the Command Menu successfully.</p>

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

+3-9
Original file line numberDiff line numberDiff line change
@@ -112,29 +112,23 @@
112112
* <td>Optional secondary text to display</td>
113113
* <td>N</td>
114114
* <td>{"string_min_length": 1, "string_max_length": 500}</td>
115-
* <td>
116-
* @since SmartDeviceLink 7.1.0
117-
* </td>
115+
* <td>SmartDeviceLink 7.1.0</td>
118116
* </tr>
119117
* <tr>
120118
* <td>tertiaryText</td>
121119
* <td>String</td>
122120
* <td>Optional tertiary text to display</td>
123121
* <td>N</td>
124122
* <td>{"string_min_length": 1, "string_max_length": 500}</td>
125-
* <td>
126-
* @since SmartDeviceLink 7.1.0
127-
* </td>
123+
* <td>SmartDeviceLink 7.1.0</td>
128124
* </tr>
129125
* <tr>
130126
* <td>secondaryImage</td>
131127
* <td>Image</td>
132128
* <td>Optional secondary image struct for sub-menu cell</td>
133129
* <td>N</td>
134130
* <td></td>
135-
* <td>
136-
* @since SmartDeviceLink 7.1.0
137-
* </td>
131+
* <td>SmartDeviceLink 7.1.0</td>
138132
* </tr>
139133
* </table>
140134
* <b>Response</b>

0 commit comments

Comments
 (0)