Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to gradle version 8.2.2 #1886

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d0563c4
Remove package from manifest and put in build.gradle
JulianKast Feb 14, 2024
28564de
Update gradle version to 8.2.2
JulianKast Feb 14, 2024
1b1f7e3
Update gradle version to 8.2.2
JulianKast Feb 14, 2024
18d36fa
update maven plugin
JulianKast Feb 14, 2024
1a5fe56
add buildFeatures aidl as suggested by AGP update assistant
JulianKast Feb 14, 2024
088e811
Formatting
JulianKast Feb 14, 2024
b49b173
add androidTestImplementation 'androidx.test:rules:1.5.0' to test per…
JulianKast Feb 14, 2024
e0fbb56
Add permissions queries for routerService to Android test manifest
JulianKast Feb 14, 2024
7e5310d
Add TestSdlReceiver for unit test
JulianKast Feb 14, 2024
a1390bd
Reset SDK_INT version in AudioStreamManagerTest after it is changed f…
JulianKast Feb 14, 2024
1c63291
update manager layer test sleep calls to 1 sec
JulianKast Feb 14, 2024
486777b
Update DeviceUtil.isEmulator to catch new emulator for ci checks
JulianKast Feb 14, 2024
0f3792d
grant BLUETOOTH_CONNECT for TransportManagerTests
JulianKast Feb 14, 2024
2e53014
grant BLUETOOTH_CONNECT permission for MediaStreamingStatusTests
JulianKast Feb 14, 2024
fd5eab8
Ignore TransportBrokerTest with note to have an app with a running Ro…
JulianKast Feb 14, 2024
2912fb3
MultiplexBluetoothTransportTest testStateTransitions only check state…
JulianKast Feb 14, 2024
154a98a
Starting with API 30 we can not use reflection to fake NetworkCapabil…
JulianKast Feb 14, 2024
d186229
update comment for WiFiSocketFactoryTest
JulianKast Feb 14, 2024
d3027b3
Update yml to target proper API level, use newer JDK and beef up emul…
JulianKast Feb 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request, workflow_dispatch]

jobs:
test_Android:
runs-on: macOS-latest
runs-on: macos-13
steps:

- name: Checkout
Expand All @@ -15,13 +15,17 @@ jobs:
- name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Sdl Android Tests
# For more info, please check out: https://github.com/marketplace/actions/android-emulator-runner
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
api-level: 34
cores: 3
ram-size: 6000M
heap-size: 4000M
arch: x86_64
script: ./android/gradlew -p ./android :sdl_android:connectedCheck

- name: Hello Sdl Android Tests
Expand All @@ -33,7 +37,7 @@ jobs:
yml: ./codecov.yml

test_Java:
runs-on: macOS-latest
runs-on: macos-13
steps:

- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.2.2'


// NOTE: Do not place your application dependencies here; they belong
Expand Down
3 changes: 3 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
android.nonTransitiveRClass=false
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m

Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
1 change: 1 addition & 0 deletions android/hello_sdl_android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ android {
lintOptions {
disable 'GoogleAppIndexingWarning'
}
namespace 'com.sdl.hellosdlandroid'
}


Expand Down
3 changes: 1 addition & 2 deletions android/hello_sdl_android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.sdl.hellosdlandroid">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"
Expand Down
14 changes: 11 additions & 3 deletions android/sdl_android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ android {
main.java.srcDirs += '../../base/src/main/java'
androidTest.assets.srcDirs += '../../generator/rpc_spec/'
}

buildFeatures {
aidl true
}

namespace 'com.smartdevicelink'
testNamespace 'com.smartdevicelink.test'
}

ext { VERSION_NAME = "$project.android.defaultConfig.versionName" }
Expand All @@ -50,11 +57,12 @@ dependencies {
api 'androidx.annotation:annotation:1.1.0'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.2.0'

testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:5.7.0'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'org.mockito:mockito-core:5.7.0'
androidTestImplementation 'org.mockito:mockito-android:5.7.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.5.1'
}
Expand All @@ -65,7 +73,7 @@ buildscript {
}
dependencies {
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.13.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.27.0'
}
}

Expand Down
26 changes: 24 additions & 2 deletions android/sdl_android/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest package="com.smartdevicelink.test"
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-sdk android:minSdkVersion="16" />
<uses-permission android:name="android.permission.BLUETOOTH" />
Expand All @@ -13,10 +12,33 @@
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.smartdevicelink.test" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />

<queries>
<intent>
<action android:name="com.smartdevicelink.router.service" />
</intent>
<intent>
<action android:name="sdl.router.startservice" />
</intent>
</queries>

<application android:debuggable="true">
<uses-library android:name="android.test.runner" />
<activity android:name="com.smartdevicelink.managers.lockscreen.SDLLockScreenActivity" />
<receiver
android:name=".TestSdlReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.smartdevicelink.USB_ACCESSORY_ATTACHED" /> <!--For AOA -->
<action android:name="android.bluetooth.device.action.ACL_CONNECTED" />
<action android:name="sdl.router.startservice" />
</intent-filter>
</receiver>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.smartdevicelink;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
* Added so we pass IntegrationValidator when running unit test.
*/
public class TestSdlReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,99 +134,131 @@ public void onComplete(boolean success) {
}

public void testWithSquareSampleAudio16BitAnd8KhzApi16() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._8KHZ, BitsPerSample._16_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(8000, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio16BitAnd16KhzApi16() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(16000, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio16BitAnd22KhzApi16() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._22KHZ, BitsPerSample._16_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(22050, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio16BitAnd44KhzApi16() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._44KHZ, BitsPerSample._16_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(44100, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio8BitAnd8KhzApi16() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._8KHZ, BitsPerSample._8_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(8000, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio8BitAnd16KhzApi16() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._8_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(16000, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio8BitAnd22KhzApi16() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._22KHZ, BitsPerSample._8_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(22050, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio8BitAnd44KhzApi16() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._44KHZ, BitsPerSample._8_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(44100, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio16BitAnd8KhzApi21() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._8KHZ, BitsPerSample._16_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(8000, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio16BitAnd16KhzApi21() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(16000, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio16BitAnd22KhzApi21() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._22KHZ, BitsPerSample._16_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(22050, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio16BitAnd44KhzApi21() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._44KHZ, BitsPerSample._16_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(44100, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio8BitAnd8KhzApi21() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._8KHZ, BitsPerSample._8_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(8000, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio8BitAnd16KhzApi21() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._8_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(16000, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio8BitAnd22KhzApi21() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._22KHZ, BitsPerSample._8_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(22050, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

public void testWithSquareSampleAudio8BitAnd44KhzApi21() throws Exception {
int versionCode = Build.VERSION.SDK_INT;
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._44KHZ, BitsPerSample._8_BIT, AudioType.PCM);
runFullAudioManagerDecodeFlowWithSquareSampleAudio(44100, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
setFinalStatic(Build.VERSION.class.getField("SDK_INT"), versionCode);
}

private int testFullAudioManagerDecodeFlowCorrectCounter = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public Void answer(InvocationOnMock invocation) {

private void sleep() {
try {
Thread.sleep(100);
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public void testSetSelectedCellWithId() {

private void sleep() {
try {
Thread.sleep(100);
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void testGetPerformInteraction() {

private void sleep() {
try {
Thread.sleep(100);
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ private List<MenuCell> filterMenuCellsWithStatusList(List<MenuCell> menuCells, L

private void sleep() {
try {
Thread.sleep(250);
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ public void handleMessage(Message msg) {
assertEquals(bluetooth.getState(), MultiplexBluetoothTransport.STATE_NONE);

bluetooth.start();
if (DeviceUtil.isEmulator()) {
assertEquals(bluetooth.getState(), MultiplexBluetoothTransport.STATE_NONE);
} else {
if (!DeviceUtil.isEmulator()) {
assertEquals(bluetooth.getState(), MultiplexBluetoothTransport.STATE_LISTEN);
}

Expand Down
Loading
Loading