Skip to content

Commit 16b2ab6

Browse files
authored
Merge pull request #1795 from smartdevicelink/5.4.0_RC
Release 5.4.0
2 parents db5c943 + a174b5d commit 16b2ab6

File tree

92 files changed

+1464
-588
lines changed

Some content is hidden

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

92 files changed

+1464
-588
lines changed

CHANGELOG.md

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,57 @@
1-
# 5.3.1 Release Notes
1+
# 5.4.0 Release Notes
22

33
## Summary:
44
||Version|
55
|--|--|
66
| **Protocol** | 5.4.1
77
| **RPC** | 8.0.0
8-
| **Tested Targeting** | Android 30
8+
| **Tested Targeting** | Android 31
99

1010
## Bug Fixes / Enhancements:
1111

12-
- [userDidSubmitInput getting called multiple times after a search request is submitted](https://github.com/smartdevicelink/sdl_java_suite/issues/1768)
12+
- [Video auto restarts streaming regardless if HMI level is streamable ](https://github.com/smartdevicelink/sdl_java_suite/issues/1807)
13+
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)
1357

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.1
1+
5.4.0

android/hello_sdl_android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 30
4+
compileSdkVersion 31
55
defaultConfig {
66
applicationId "com.sdl.hellosdlandroid"
77
minSdkVersion 16
8-
targetSdkVersion 30
8+
targetSdkVersion 31
99
versionCode 1
1010
versionName "1.0"
1111
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

android/hello_sdl_android/src/main/AndroidManifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
package="com.sdl.hellosdlandroid">
55

66
<uses-permission android:name="android.permission.BLUETOOTH" />
7+
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"
8+
tools:targetApi="31"/>
79
<uses-permission android:name="android.permission.INTERNET" />
810
<!-- Required to check if WiFi is enabled -->
911
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@@ -30,6 +32,7 @@
3032
tools:ignore="DeepLinks">
3133
<activity
3234
android:name=".MainActivity"
35+
android:exported="true"
3336
android:label="@string/app_name">
3437
<intent-filter>
3538
<action android:name="android.intent.action.MAIN" />
@@ -40,6 +43,7 @@
4043

4144
<activity
4245
android:name="com.smartdevicelink.transport.USBAccessoryAttachmentActivity"
46+
android:exported="true"
4347
android:launchMode="singleTop">
4448
<intent-filter>
4549
<action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
@@ -52,6 +56,7 @@
5256

5357
<service
5458
android:name="com.sdl.hellosdlandroid.SdlService"
59+
android:exported="true"
5560
android:foregroundServiceType="connectedDevice">
5661
</service>
5762
<service

android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,66 @@
11
package com.sdl.hellosdlandroid;
22

33
import android.content.Intent;
4+
import android.content.pm.PackageManager;
5+
import android.os.Build;
46
import android.os.Bundle;
57
import android.view.Menu;
68
import android.view.MenuItem;
79

10+
import androidx.annotation.NonNull;
811
import androidx.appcompat.app.AppCompatActivity;
12+
import androidx.core.app.ActivityCompat;
13+
import androidx.core.content.ContextCompat;
14+
15+
import static android.Manifest.permission.BLUETOOTH_CONNECT;
916

1017
public class MainActivity extends AppCompatActivity {
1118

19+
private static final int REQUEST_CODE = 200;
20+
1221
@Override
1322
protected void onCreate(Bundle savedInstanceState) {
1423
super.onCreate(savedInstanceState);
1524
setContentView(R.layout.activity_main);
16-
//If we are connected to a module we want to start our SdlService
25+
26+
1727
if (BuildConfig.TRANSPORT.equals("MULTI") || BuildConfig.TRANSPORT.equals("MULTI_HB")) {
28+
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && !checkPermission()) {
29+
requestPermission();
30+
return;
31+
}
32+
//If we are connected to a module we want to start our SdlService
1833
SdlReceiver.queryForConnectedService(this);
19-
} else if (BuildConfig.TRANSPORT.equals("TCP")) {
34+
} else if (BuildConfig.TRANSPORT.equals("TCP")){
2035
Intent proxyIntent = new Intent(this, SdlService.class);
2136
startService(proxyIntent);
2237
}
2338
}
2439

40+
private boolean checkPermission() {
41+
return PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(getApplicationContext(), BLUETOOTH_CONNECT);
42+
}
43+
44+
private void requestPermission() {
45+
ActivityCompat.requestPermissions(this, new String[]{BLUETOOTH_CONNECT}, REQUEST_CODE);
46+
}
47+
48+
@Override
49+
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
50+
switch (requestCode) {
51+
case REQUEST_CODE:
52+
if (grantResults.length > 0) {
53+
54+
boolean btConnectGranted = grantResults[0] == PackageManager.PERMISSION_GRANTED;
55+
56+
if (btConnectGranted) {
57+
SdlReceiver.queryForConnectedService(this);
58+
}
59+
}
60+
break;
61+
}
62+
}
63+
2564
@Override
2665
public boolean onCreateOptionsMenu(Menu menu) {
2766
// Inflate the menu; this adds items to the action bar if it is present.

android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.sdl.hellosdlandroid;
22

3+
import android.app.PendingIntent;
34
import android.content.Context;
45
import android.content.Intent;
56
import android.os.Build;
67

78
import com.smartdevicelink.transport.SdlBroadcastReceiver;
89
import com.smartdevicelink.transport.SdlRouterService;
10+
import com.smartdevicelink.transport.TransportConstants;
911
import com.smartdevicelink.util.DebugTool;
1012

1113
public class SdlReceiver extends SdlBroadcastReceiver {
@@ -16,13 +18,27 @@ public void onSdlEnabled(Context context, Intent intent) {
1618
DebugTool.logInfo(TAG, "SDL Enabled");
1719
intent.setClass(context, SdlService.class);
1820

19-
// SdlService needs to be foregrounded in Android O and above
20-
// This will prevent apps in the background from crashing when they try to start SdlService
21-
// Because Android O doesn't allow background apps to start background services
22-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
23-
context.startForegroundService(intent);
21+
// Starting with Android S SdlService needs to be started from a foreground context.
22+
// We will check the intent for a pendingIntent parcelable extra
23+
// This pendingIntent allows us to start the SdlService from the context of the active router service which is in the foreground
24+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
25+
PendingIntent pendingIntent = (PendingIntent) intent.getParcelableExtra(TransportConstants.PENDING_INTENT_EXTRA);
26+
if (pendingIntent != null) {
27+
try {
28+
pendingIntent.send(context, 0, intent);
29+
} catch (PendingIntent.CanceledException e) {
30+
e.printStackTrace();
31+
}
32+
}
2433
} else {
25-
context.startService(intent);
34+
// SdlService needs to be foregrounded in Android O and above
35+
// This will prevent apps in the background from crashing when they try to start SdlService
36+
// Because Android O doesn't allow background apps to start background services
37+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
38+
context.startForegroundService(intent);
39+
} else {
40+
context.startService(intent);
41+
}
2642
}
2743
}
2844

@@ -35,4 +51,9 @@ public Class<? extends SdlRouterService> defineLocalSdlRouterClass() {
3551
public void onReceive(Context context, Intent intent) {
3652
super.onReceive(context, intent); // Required if overriding this method
3753
}
54+
55+
@Override
56+
public String getSdlServiceName() {
57+
return SdlService.class.getSimpleName();
58+
}
3859
}

android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,13 @@ public void enterForeground() {
108108
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
109109
if (notificationManager != null) {
110110
notificationManager.createNotificationChannel(channel);
111-
Notification serviceNotification = new Notification.Builder(this, channel.getId())
111+
Notification.Builder builder = new Notification.Builder(this, channel.getId())
112112
.setContentTitle("Connected through SDL")
113-
.setSmallIcon(R.drawable.ic_sdl)
114-
.build();
113+
.setSmallIcon(R.drawable.ic_sdl);
114+
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
115+
builder.setForegroundServiceBehavior(Notification.FOREGROUND_SERVICE_IMMEDIATE);
116+
}
117+
Notification serviceNotification = builder.build();
115118
startForeground(FOREGROUND_SERVICE_ID, serviceNotification);
116119
}
117120
}

android/sdl_android/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apply plugin: 'com.android.library'
22

33
android {
4-
compileSdkVersion 30
4+
compileSdkVersion 31
55
defaultConfig {
66
minSdkVersion 16
7-
targetSdkVersion 30
8-
versionCode 21
7+
targetSdkVersion 31
8+
versionCode 22
99
versionName new File(projectDir.path, ('/../../VERSION')).text.trim()
1010
buildConfigField "String", "VERSION_NAME", '\"' + versionName + '\"'
1111
resValue "string", "SDL_LIB_VERSION", '\"' + versionName + '\"'
@@ -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.1
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
};

0 commit comments

Comments
 (0)