diff options
author | Bilal Alsharifi <bilal.alsharifi@gmail.com> | 2020-08-13 13:18:14 -0400 |
---|---|---|
committer | Bilal Alsharifi <bilal.alsharifi@gmail.com> | 2020-08-13 13:18:14 -0400 |
commit | d637a72c6583fc58ae6fb9b4d9889cd9d835654e (patch) | |
tree | 17475936a4f539a89a358d916e3a2e58319d5c18 | |
parent | 2ed8fff21e6ab20dffdbfef35e1053d64df6db73 (diff) | |
parent | 25a849c9c1e852c24356f569f8877e7bf5193f0b (diff) | |
download | sdl_android-feature/issue_1438_missing_min_max.tar.gz |
Merge branch 'develop' into feature/issue_1438_missing_min_maxfeature/issue_1438_missing_min_max
592 files changed, 2883 insertions, 2997 deletions
diff --git a/android/gradle.properties b/android/gradle.properties index aac7c9b46..9e6fce102 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -9,6 +9,8 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. +android.enableJetifier=true +android.useAndroidX=true org.gradle.jvmargs=-Xmx1536m # When configured, Gradle will run in incubating parallel mode. diff --git a/android/hello_sdl_android/build.gradle b/android/hello_sdl_android/build.gradle index 6124ae700..3e3a83528 100755 --- a/android/hello_sdl_android/build.gradle +++ b/android/hello_sdl_android/build.gradle @@ -8,7 +8,7 @@ android { targetSdkVersion 28 versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } buildTypes { release { @@ -51,10 +51,10 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { + androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { exclude group: 'com.android.support', module: 'support-annotations' }) - implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'androidx.appcompat:appcompat:1.0.0' implementation project(path: ':sdl_android') testImplementation 'junit:junit:4.12' }
\ No newline at end of file diff --git a/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java index 6fc9203db..3c4fabc57 100755 --- a/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java +++ b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java @@ -2,7 +2,7 @@ package com.sdl.hellosdlandroid; import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; diff --git a/android/sdl_android/build.gradle b/android/sdl_android/build.gradle index c600dd6dd..100a266ca 100644 --- a/android/sdl_android/build.gradle +++ b/android/sdl_android/build.gradle @@ -9,7 +9,7 @@ android { targetSdkVersion 29 versionCode 14 versionName new File(projectDir.path, ('/../../VERSION')).text.trim() - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' resValue "string", "SDL_LIB_VERSION", '\"' + versionName + '\"' } buildTypes { @@ -36,37 +36,25 @@ android { } sourceSets { - if(Os.isFamily(Os.FAMILY_WINDOWS)){ - //The buildWindowsSymLinks task must be run first if this is - //being compiled on a Windows machine - main.java.srcDirs += '../../baseAndroid/windows/src/main/java' - }else{ - main.java.srcDirs += '../../baseAndroid/src/main/java' - } + main.java.srcDirs += '../../base/src/main/java' } } -task buildWindowSymLinks(type:Exec){ - - workingDir '../../baseAndroid' - - commandLine 'cmd', '/c', 'make_symlinks.lnk' -} - dependencies { api fileTree(dir: 'libs', include: ['*.jar']) api 'com.smartdevicelink:bson_java_port:1.2.0' api 'com.livio.taskmaster:taskmaster:0.3.0' - androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { + androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { exclude group: 'com.android.support', module: 'support-annotations' }) testImplementation 'junit:junit:4.12' testImplementation 'org.mockito:mockito-core:2.9.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'org.mockito:mockito-core:2.9.0' androidTestImplementation 'org.mockito:mockito-android:2.9.0' - api 'com.android.support:support-annotations:28.0.0' - api "android.arch.lifecycle:extensions:1.1.1" - annotationProcessor "android.arch.lifecycle:compiler:1.1.1" + api 'androidx.annotation:annotation:1.0.0' + api 'androidx.lifecycle:lifecycle-extensions:2.0.0' + annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.0.0' } buildscript { diff --git a/android/sdl_android/src/androidTest/assets/json/GetVehicleData.json b/android/sdl_android/src/androidTest/assets/json/GetVehicleData.json index 7cef581b7..3c8b6129b 100644 --- a/android/sdl_android/src/androidTest/assets/json/GetVehicleData.json +++ b/android/sdl_android/src/androidTest/assets/json/GetVehicleData.json @@ -32,7 +32,8 @@ "fuelRange":true, "turnSignal":true, "electronicParkBrakeStatus":true, - "oemCustomVehicleDataName":true + "oemCustomVehicleDataName":true, + "windowStatus": true } }, "response":{ @@ -170,7 +171,19 @@ "range":10.0 } ], - "oemCustomVehicleDataName":"oemCustomVehicleDataState" + "oemCustomVehicleDataName":"oemCustomVehicleDataState", + "windowStatus": [ + { + "location": { + "row": 2, + "col": 3 + }, + "state": { + "approximatePosition": 2, + "deviation": 3 + } + } + ] } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json b/android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json index e1dfbd39a..a6ec021b0 100644 --- a/android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json +++ b/android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json @@ -32,6 +32,7 @@ "turnSignal":true, "electronicParkBrakeStatus":true, "oemCustomVehicleDataName":true, + "windowStatus": true, "handsOffSteering": true } }, @@ -158,6 +159,10 @@ "oemCustomVehicleDataName":{ "oemCustomDataType":"oemCustomVehicleDataName", "resultCode":"SUCCESS" + }, + "windowStatus":{ + "dataType":"VEHICLEDATA_WINDOWSTATUS", + "resultCode":"SUCCESS" } } } diff --git a/android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json b/android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json index 835fc958d..232e18b4d 100644 --- a/android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json +++ b/android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json @@ -32,7 +32,8 @@ "turnSignal":true, "electronicParkBrakeStatus":true, "handsOffSteering": true, - "oemCustomVehicleDataName":true + "oemCustomVehicleDataName":true, + "windowStatus": true } }, "response":{ @@ -158,6 +159,10 @@ "oemCustomVehicleDataName":{ "oemCustomDataType":"oemCustomVehicleDataName", "resultCode":"SUCCESS" + }, + "windowStatus":{ + "dataType":"VEHICLEDATA_WINDOWSTATUS", + "resultCode":"SUCCESS" } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java index c1c636c50..b33c4f494 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java @@ -1,7 +1,7 @@ package com.smartdevicelink.managers; import android.content.Context; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.livio.taskmaster.Taskmaster; import com.smartdevicelink.managers.lifecycle.LifecycleConfigurationUpdate; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/audio/AudioStreamManagerTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/audio/AudioStreamManagerTest.java index 58d92c6ba..3fd5cd943 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/audio/AudioStreamManagerTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/audio/AudioStreamManagerTest.java @@ -5,7 +5,7 @@ import android.media.AudioFormat; import android.media.MediaFormat;
import android.media.MediaPlayer;
import android.os.Build;
-import android.support.test.InstrumentationRegistry;
+import androidx.test.platform.app.InstrumentationRegistry;
import android.util.Log;
import com.smartdevicelink.SdlConnection.SdlSession;
@@ -53,7 +53,7 @@ public class AudioStreamManagerTest extends TestCase { @Override
public void setUp() throws Exception {
super.setUp();
- mContext = InstrumentationRegistry.getContext();
+ mContext = InstrumentationRegistry.getInstrumentation().getContext();
}
@Override
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java index 89abc76cc..dccd7c10b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.managers.file; import android.content.Context; import android.net.Uri; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.CompletionListener; @@ -33,7 +33,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -58,7 +58,7 @@ public class FileManagerTests { @Before public void setUp() throws Exception{ - mTestContext = getTargetContext(); + mTestContext = getInstrumentation().getTargetContext(); validFile = new SdlFile(); validFile.setName(TestValues.GENERAL_STRING); validFile.setFileData(TestValues.GENERAL_BYTE_ARRAY); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlArtworkTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlArtworkTests.java index 5b179e8ef..5c59f20d7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlArtworkTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlArtworkTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.managers.file; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.managers.file.filetypes.SdlArtwork; import com.smartdevicelink.proxy.rpc.enums.StaticIconName; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java index bdb47aec1..86f328e8a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.file.filetypes; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.test.TestValues; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdateTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdateTest.java index 61edcf87d..02509a96a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdateTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdateTest.java @@ -35,7 +35,7 @@ package com.smartdevicelink.managers.lifecycle; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.test.TestValues; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/RpcConverterTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/RpcConverterTest.java index 1031fc652..744779ef4 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/RpcConverterTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/RpcConverterTest.java @@ -1,6 +1,6 @@ package com.smartdevicelink.managers.lifecycle; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.protocol.ProtocolMessage; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java index f6ae0fe63..8f5db72a4 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.managers.lifecycle; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.SparseArray; import com.livio.taskmaster.Taskmaster; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java index 1c6eb9d34..84a4e52ef 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.managers.lockscreen; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.test.TestValues; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManagerTests.java index 290515d54..38701bd64 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManagerTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.managers.lockscreen; import android.content.Context; import android.content.SharedPreferences; import android.graphics.Bitmap; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.rules.TemporaryFolder; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java index e6e86261b..2509a2298 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java @@ -1,7 +1,7 @@ package com.smartdevicelink.managers.lockscreen; import android.content.Context; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.interfaces.ISdl; @@ -18,7 +18,7 @@ import org.junit.runner.RunWith; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertFalse; import static junit.framework.TestCase.assertNull; @@ -53,7 +53,7 @@ public class LockScreenManagerTests { }; doAnswer(onDDStatusAnswer).when(internalInterface).addOnRPCNotificationListener(eq(FunctionID.ON_DRIVER_DISTRACTION), any(OnRPCNotificationListener.class)); - Context context = getContext(); + Context context = getInstrumentation().getContext(); // create config LockScreenConfig lockScreenConfig = new LockScreenConfig(); lockScreenConfig.setCustomView(TestValues.GENERAL_INT); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/permission/PermissionManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/permission/PermissionManagerTests.java index 81354dd2c..d53287b61 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/permission/PermissionManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/permission/PermissionManagerTests.java @@ -1,7 +1,7 @@ package com.smartdevicelink.managers.permission; -import android.support.annotation.NonNull; -import android.support.test.runner.AndroidJUnit4; +import androidx.annotation.NonNull; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.interfaces.ISdl; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java index a91a68b3e..f1e68e9b3 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java @@ -1,7 +1,7 @@ package com.smartdevicelink.managers.screen; import com.livio.taskmaster.Taskmaster; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.file.FileManager; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java index efea2bf1d..3a680221e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java @@ -1,7 +1,7 @@ package com.smartdevicelink.managers.screen; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.managers.CompletionListener; import com.livio.taskmaster.Taskmaster; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SubscribeButtonManagerTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SubscribeButtonManagerTest.java index b1da6b052..8e16c3ed0 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SubscribeButtonManagerTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SubscribeButtonManagerTest.java @@ -1,6 +1,6 @@ package com.smartdevicelink.managers.screen; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.proxy.RPCMessage; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java index 6d9315348..439b7ebe9 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.managers.screen; import android.content.Context; import android.net.Uri; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.ManagerUtility; @@ -28,7 +28,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertFalse; import static junit.framework.TestCase.assertNotNull; @@ -48,7 +48,7 @@ public class TextAndGraphicManagerTests { @Before public void setUp() throws Exception{ - Context mTestContext = getContext(); + Context mTestContext = getInstrumentation().getContext(); // mock things ISdl internalInterface = mock(ISdl.class); FileManager fileManager = mock(FileManager.class); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/CheckChoiceVROptionalOperationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/CheckChoiceVROptionalOperationTests.java index cba4ee77d..abf868876 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/CheckChoiceVROptionalOperationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/CheckChoiceVROptionalOperationTests.java @@ -35,7 +35,7 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.proxy.interfaces.ISdl; import com.smartdevicelink.proxy.rpc.Choice; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceCellTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceCellTests.java index 8f1c4f5c1..420ab1d72 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceCellTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceCellTests.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.managers.file.filetypes.SdlArtwork; import com.smartdevicelink.proxy.rpc.enums.FileType; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetLayoutTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetLayoutTests.java index 854fc61f7..0ecd3701f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetLayoutTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetLayoutTests.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManagerTests.java index 78dd07cce..4e9ba2e6b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManagerTests.java @@ -35,7 +35,7 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.livio.taskmaster.Taskmaster; import com.smartdevicelink.managers.BaseSubManager; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetTests.java index c7cda00fb..5bd8216d2 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetTests.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.test.TestValues; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/DeleteChoicesOperationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/DeleteChoicesOperationTests.java index e2cdcf7ae..e8a9eeb23 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/DeleteChoicesOperationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/DeleteChoicesOperationTests.java @@ -35,7 +35,7 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.proxy.interfaces.ISdl; import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperationTests.java index b8be6edc5..14144758f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperationTests.java @@ -35,7 +35,7 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.managers.file.FileManager; import com.smartdevicelink.managers.file.filetypes.SdlArtwork; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperationTests.java index 1f4984706..8e91c3a04 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperationTests.java @@ -35,7 +35,7 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.livio.taskmaster.Queue; import com.livio.taskmaster.Task; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperationTests.java index 16992a522..37264b865 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperationTests.java @@ -35,7 +35,7 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.livio.taskmaster.Queue; import com.livio.taskmaster.Task; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java index 0105553fa..518fa451c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen.menu; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.managers.file.SdlArtworkTests; import com.smartdevicelink.proxy.rpc.enums.MenuLayout; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuConfigurationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuConfigurationTests.java index e623d2ee2..2986d496a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuConfigurationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuConfigurationTests.java @@ -35,7 +35,7 @@ package com.smartdevicelink.managers.screen.menu; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.test.TestValues; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuManagerTests.java index 4a68a6b1c..b740d303a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuManagerTests.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen.menu; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.R; import com.smartdevicelink.managers.BaseSubManager; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/RunScoreTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/RunScoreTests.java index 724a53699..e3468b803 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/RunScoreTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/RunScoreTests.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen.menu; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.test.TestValues; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/SubCellCommandListTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/SubCellCommandListTests.java index a6eccbad0..29dd8e7c6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/SubCellCommandListTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/SubCellCommandListTests.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen.menu; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.test.TestValues; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManagerTests.java index 72f52b3d5..a73c28ef2 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManagerTests.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen.menu; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.CompletionListener; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandTests.java index 6be14c367..00e198a91 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandTests.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen.menu; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.test.TestValues; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java index e6cb892bd..1701dcc99 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java @@ -2,8 +2,8 @@ package com.smartdevicelink.managers.video; import android.content.Context; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.test.runner.AndroidJUnit4; +import androidx.annotation.NonNull; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.DisplayMetrics; import android.view.Display; import android.view.MotionEvent; @@ -58,7 +58,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink video streaming manager class : @@ -74,7 +74,7 @@ public class VideoStreamManagerTests { @Before public void setUp() throws Exception{ - mTestContext = getContext(); + mTestContext = getInstrumentation().getContext(); } // TEST CLASSES diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlPacketTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlPacketTests.java index e4a2555d2..514067db9 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlPacketTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlPacketTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.protocol; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.livio.BSON.BsonEncoder; import com.smartdevicelink.protocol.enums.ControlFrameTags; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java index f77d65b9d..e05767aac 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.protocol; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import com.smartdevicelink.protocol.enums.SessionType; @@ -10,7 +10,7 @@ import com.smartdevicelink.test.SampleRpc; import com.smartdevicelink.test.SdlUnitTestContants; import com.smartdevicelink.transport.BaseTransportConfig; import com.smartdevicelink.transport.MultiplexTransportConfig; -import com.smartdevicelink.transport.RouterServiceValidator; +import com.smartdevicelink.util.Version; import junit.framework.Assert; @@ -20,15 +20,13 @@ import org.junit.runner.RunWith; import java.io.ByteArrayOutputStream; import java.lang.reflect.Method; -import java.util.List; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertFalse; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; -import static junit.framework.TestCase.assertTrue; import static org.mockito.Mockito.mock; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; @RunWith(AndroidJUnit4.class) public class SdlProtocolTests { @@ -49,8 +47,7 @@ public class SdlProtocolTests { public boolean didReceive(){ return didReceive; } - @Override - public void onProtocolMessageBytesToSend(SdlPacket packet) {} + @Override public void onProtocolMessageReceived(ProtocolMessage msg) { didReceive = true; @@ -58,42 +55,62 @@ public class SdlProtocolTests { Log.d("DidReceiveListener", "Function Id: " + msg.getFunctionID()); Log.d("DidReceiveListener", "JSON Size: " + msg.getJsonSize()); } + @Override - public void onProtocolSessionStarted(SessionType sessionType,byte sessionID, byte version, String correlationID, int hashID,boolean isEncrypted){} - @Override - public void onProtocolSessionNACKed(SessionType sessionType,byte sessionID, byte version, String correlationID, List<String> rejectedParams) {} - @Override - public void onProtocolSessionEnded(SessionType sessionType,byte sessionID, String correlationID) {} - @Override - public void onProtocolSessionEndedNACKed(SessionType sessionType,byte sessionID, String correlationID) {} - @Override - public void onProtocolHeartbeat(SessionType sessionType, byte sessionID) {} - @Override - public void onProtocolHeartbeatACK(SessionType sessionType,byte sessionID) {} - @Override - public void onProtocolServiceDataACK(SessionType sessionType,int dataSize, byte sessionID) {} - @Override - public void onResetOutgoingHeartbeat(SessionType sessionType,byte sessionID) {} + public void onServiceStarted(SdlPacket packet, SessionType serviceType, int sessionID, Version version, boolean isEncrypted) { + + } + @Override - public void onResetIncomingHeartbeat(SessionType sessionType,byte sessionID) {} + public void onServiceEnded(SdlPacket packet, SessionType serviceType, int sessionID) { + + } + @Override - public void onProtocolError(String info, Exception e) {} + public void onServiceError(SdlPacket packet, SessionType serviceType, int sessionID, String error) { + + } + @Override - public byte getSessionId() {return 0;} + public void onProtocolError(String info, Exception e) { + + } + @Override - public void shutdown(String info) {} + public int getSessionId() { + return 0; + } + @Override - public void onTransportDisconnected(String info, boolean altTransportAvailable, BaseTransportConfig transportConfig) {} + public void shutdown(String info) { + + } + @Override - public SdlSecurityBase getSdlSecurity() {return null;} + public void onTransportDisconnected(String info, boolean altTransportAvailable, BaseTransportConfig transportConfig) { + + } + @Override - public VideoStreamingParameters getDesiredVideoParams() {return null; } + public SdlSecurityBase getSdlSecurity() { + return null; + } + @Override - public void setAcceptedVideoParams(VideoStreamingParameters acceptedVideoParams) {} + public VideoStreamingParameters getDesiredVideoParams() { + return null; + } + @Override - public void stopStream(SessionType serviceType) {} + public void setAcceptedVideoParams(VideoStreamingParameters acceptedVideoParams) { + + } + @Override - public void onAuthTokenReceived(String token){} + public void onAuthTokenReceived(String authToken) { + + } + }; DidReceiveListener onProtocolMessageReceivedListener = new DidReceiveListener(); @@ -101,7 +118,7 @@ public class SdlProtocolTests { @Before public void setUp(){ - config = new MultiplexTransportConfig(getContext(), SdlUnitTestContants.TEST_APP_ID); + config = new MultiplexTransportConfig(getInstrumentation().getContext(), SdlUnitTestContants.TEST_APP_ID); protocol = new SdlProtocol(defaultListener,config); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/BaseRpcTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/BaseRpcTests.java index db9d7f5b2..a8aec30ac 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/BaseRpcTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/BaseRpcTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.RPCRequest; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlConnection/SdlSessionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlConnection/SdlSessionTests.java index 11d2dbb7d..cc5b2f7ab 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlConnection/SdlSessionTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlConnection/SdlSessionTests.java @@ -9,7 +9,7 @@ import com.smartdevicelink.transport.TCPTransportConfig; import junit.framework.TestCase; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static org.mockito.Mockito.mock; /** @@ -19,7 +19,7 @@ import static org.mockito.Mockito.mock; public class SdlSessionTests extends TestCase { public void testServiceListeners(){ - SdlSession session = new SdlSession(new MockInterfaceBroker(), new MultiplexTransportConfig(getTargetContext(),"19216801")); + SdlSession session = new SdlSession(new MockInterfaceBroker(), new MultiplexTransportConfig(getInstrumentation().getTargetContext(),"19216801")); ISdlServiceListener test = new ISdlServiceListener() { @Override public void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted) { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java index 37cae48f4..b76fbade1 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java @@ -109,6 +109,8 @@ import com.smartdevicelink.proxy.rpc.WeatherData; import com.smartdevicelink.proxy.rpc.WeatherServiceData; import com.smartdevicelink.proxy.rpc.WeatherServiceManifest; import com.smartdevicelink.proxy.rpc.WindowCapability; +import com.smartdevicelink.proxy.rpc.WindowState; +import com.smartdevicelink.proxy.rpc.WindowStatus; import com.smartdevicelink.proxy.rpc.WindowTypeCapabilities; import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus; import com.smartdevicelink.proxy.rpc.enums.AppHMIType; @@ -295,6 +297,7 @@ public class TestValues { public static final SoftButtonType GENERAL_SOFTBUTTONTYPE = SoftButtonType.SBT_BOTH; public static final MassageZone GENERAL_MASSAGEZONE = MassageZone.LUMBAR; public static final MassageMode GENERAL_MASSAGEMODE = MassageMode.HIGH; + public static final WindowStatus GENERAL_WINDOW_STATUS = new WindowStatus(); public static final MassageCushion GENERAL_MASSAGECUSHION = MassageCushion.BACK_BOLSTERS; public static final SeatMemoryActionType GENERAL_SEATMEMORYACTIONTYPE = SeatMemoryActionType.SAVE; public static final SupportedSeat GENERAL_SUPPORTEDSEAT = SupportedSeat.DRIVER; @@ -437,6 +440,10 @@ public class TestValues { public static final SeatLocation GENERAL_SEAT_LOCATION = new SeatLocation(); public static final ModuleInfo GENERAL_MODULE_INFO = new ModuleInfo(); public static final WindowType GENERAL_WINDOWTYPE = WindowType.MAIN; + public static final Grid GENERAL_LOCATION_GRID = new Grid(2, 3); + public static final WindowState GENERAL_WINDOW_STATE = new WindowState(2, 3); + public static final Integer GENERAL_APPROX_POSITION = new Integer(3); + public static final Integer GENERAL_DEVIATION = new Integer(2); public static final List<Long> GENERAL_LONG_LIST = Arrays.asList(new Long[]{ 1L, 2L }); public static final List<Turn> GENERAL_TURN_LIST = new ArrayList<Turn>(); public static final List<Choice> GENERAL_CHOICE_LIST = new ArrayList<Choice>(); @@ -1117,6 +1124,8 @@ public class TestValues { GENERAL_MODULE_INFO.setModuleServiceArea(TestValues.GENERAL_GRID); GENERAL_MODULE_INFO.setMultipleAccessAllowance(TestValues.GENERAL_BOOLEAN); + GENERAL_WINDOW_STATUS.setLocation(TestValues.GENERAL_GRID); + GENERAL_WINDOW_STATUS.setState(TestValues.GENERAL_WINDOW_STATE); try { JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_ALLOWED, GENERAL_HMILEVEL_LIST); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java index 69d32c33d..9cf1fdd85 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java @@ -3826,4 +3826,67 @@ public class Validator{ } return validateGrid(cap1.getGrid(), cap2.getGrid()); } + + public static boolean validateWindowStatuses(List<WindowStatus> item1, List<WindowStatus> item2) { + if (item1 == null) { + return ( item2 == null ); + } + if (item2 == null) { + return ( item1 == null ); + } + + if (item1.size() != item2.size()) { + return false; + } + + Iterator<WindowStatus> iterator1 = item1.iterator(); + Iterator<WindowStatus> iterator2 = item2.iterator(); + + while(iterator1.hasNext() && iterator2.hasNext()){ + WindowStatus windowStatus1 = iterator1.next(); + WindowStatus windowStatus2 = iterator2.next(); + + if(!validateWindowStatus(windowStatus1, windowStatus2)){ + return false; + } + } + + return true; + } + + public static boolean validateWindowStatus(WindowStatus item1, WindowStatus item2) { + if (item1 == null) { + return ( item2 == null ); + } + if (item2 == null) { + return ( item1 == null ); + } + + if (!validateWindowStates(item1.getState(), item2.getState())) { + return false; + } + if (!validateGrid(item1.getLocation(), item2.getLocation())) { + return false; + } + + return true; + } + + public static boolean validateWindowStates (WindowState item1, WindowState item2) { + if (item1 == null) { + return ( item2 == null ); + } + if (item2 == null) { + return ( item1 == null ); + } + + Integer approxPosition1 = item1.getApproximatePosition(); + Integer approxPosition2 = item2.getApproximatePosition(); + + Integer deviation1 = item1.getDeviation(); + Integer deviation2 = item2.getDeviation(); + + + return approxPosition1.equals(approxPosition2) && deviation1.equals(deviation2); + } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java index 1ab961d22..f200b46e7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java @@ -10,11 +10,14 @@ import com.smartdevicelink.proxy.rpc.EmergencyEvent; import com.smartdevicelink.proxy.rpc.FuelRange; import com.smartdevicelink.proxy.rpc.GPSData; import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse; +import com.smartdevicelink.proxy.rpc.Grid; import com.smartdevicelink.proxy.rpc.HeadLampStatus; import com.smartdevicelink.proxy.rpc.MyKey; import com.smartdevicelink.proxy.rpc.OnVehicleData; import com.smartdevicelink.proxy.rpc.SingleTireStatus; import com.smartdevicelink.proxy.rpc.TireStatus; +import com.smartdevicelink.proxy.rpc.WindowState; +import com.smartdevicelink.proxy.rpc.WindowStatus; import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus; import com.smartdevicelink.proxy.rpc.enums.CarModeStatus; import com.smartdevicelink.proxy.rpc.enums.CompassDirection; @@ -72,6 +75,8 @@ public class VehicleDataHelper{ public static final AirbagStatus AIRBAG_STATUS = new AirbagStatus(); public static final EmergencyEvent EMERGENCY_EVENT = new EmergencyEvent(); public static final ClusterModeStatus CLUSTER_MODE_STATUS = new ClusterModeStatus(); + public static final WindowStatus WINDOW_STATUS = new WindowStatus(); + public static final List<WindowStatus> WINDOW_STATUS_LIST = new ArrayList<>(1); public static final MyKey MY_KEY = new MyKey(); public static final FuelRange FUEL_RANGE = new FuelRange(); public static final List<FuelRange> FUEL_RANGE_LIST = new ArrayList<FuelRange>(1); @@ -191,6 +196,10 @@ public class VehicleDataHelper{ public static final FuelType FUEL_RANGE_TYPE = FuelType.GASOLINE; public static final Float FUEL_RANGE_RANGE = TestValues.GENERAL_FLOAT; + // WindowStatus + public static final Grid LOCATION_GRID = TestValues.GENERAL_LOCATION_GRID; + public static final WindowState WINDOW_STATE = TestValues.GENERAL_WINDOW_STATE; + public static final JSONArray JSON_FUEL_RANGE = new JSONArray(); //the OnVehicleData which stores all the information above @@ -321,6 +330,10 @@ public class VehicleDataHelper{ FUEL_RANGE.setRange(FUEL_RANGE_RANGE); FUEL_RANGE_LIST.add(FUEL_RANGE); + //WINDOW_STATUS and WINDOW_STATUS_LIST set up + WINDOW_STATUS.setLocation(LOCATION_GRID); + WINDOW_STATUS.setState(WINDOW_STATE); + WINDOW_STATUS_LIST.add(WINDOW_STATUS); // FUEL_RANGE json array set up try { JSON_FUEL_RANGE.put(FUEL_RANGE.serializeJSON()); @@ -358,6 +371,7 @@ public class VehicleDataHelper{ VEHICLE_DATA.setFuelRange(FUEL_RANGE_LIST); VEHICLE_DATA.setTurnSignal(TURN_SIGNAL); VEHICLE_DATA.setElectronicParkBrakeStatus(ELECTRONIC_PARK_BRAKE_STATUS); + VEHICLE_DATA.setWindowStatus(WINDOW_STATUS_LIST); VEHICLE_DATA.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, OEM_CUSTOM_VEHICLE_DATA_STATE); VEHICLE_DATA.setHandsOffSteering(HANDS_OFF_STEERING); //set up the GetVehicleDataResponse object @@ -390,6 +404,7 @@ public class VehicleDataHelper{ VEHICLE_DATA_RESPONSE.setFuelRange(FUEL_RANGE_LIST); VEHICLE_DATA_RESPONSE.setTurnSignal(TURN_SIGNAL); VEHICLE_DATA_RESPONSE.setElectronicParkBrakeStatus(ELECTRONIC_PARK_BRAKE_STATUS); + VEHICLE_DATA_RESPONSE.setWindowStatus(WINDOW_STATUS_LIST); VEHICLE_DATA_RESPONSE.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, OEM_CUSTOM_VEHICLE_DATA_STATE); VEHICLE_DATA_RESPONSE.setHandsOffSteering(HANDS_OFF_STEERING); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/BinaryFrameHeaderTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/BinaryFrameHeaderTests.java index 733192fdd..50f949e3d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/BinaryFrameHeaderTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/BinaryFrameHeaderTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.protocol; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.protocol.BinaryFrameHeader; import com.smartdevicelink.protocol.enums.FunctionID; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestTest.java index bcf319383..5972dc829 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestTest.java @@ -1,7 +1,7 @@ package com.smartdevicelink.test.proxy; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.proxy.RPCRequest; import com.smartdevicelink.proxy.rpc.GetSystemCapability; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java index 385362be8..da8b48d8c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java @@ -1,7 +1,7 @@ package com.smartdevicelink.test.proxy; import android.content.Context; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.telephony.TelephonyManager; import android.util.Log; @@ -46,7 +46,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; @RunWith(AndroidJUnit4.class) public class SdlProxyBaseTests { @@ -60,8 +60,8 @@ public class SdlProxyBaseTests { @Test public void testNullSdlProxyConfigurationResources() { SdlProxyALM proxy = null; - SdlProxyBuilder.Builder builder = new SdlProxyBuilder.Builder(mock(IProxyListenerALM.class), "appId", "appName", true, getTargetContext()); - SdlProxyConfigurationResources config = new SdlProxyConfigurationResources("path", (TelephonyManager) getTargetContext().getSystemService(Context.TELEPHONY_SERVICE)); + SdlProxyBuilder.Builder builder = new SdlProxyBuilder.Builder(mock(IProxyListenerALM.class), "appId", "appName", true, getInstrumentation().getTargetContext()); + SdlProxyConfigurationResources config = new SdlProxyConfigurationResources("path", (TelephonyManager) getInstrumentation().getTargetContext().getSystemService(Context.TELEPHONY_SERVICE)); //Construct with a non-null SdlProxyConfigurationResources builder.setSdlProxyConfigurationResources(config); try { @@ -127,14 +127,14 @@ public class SdlProxyBaseTests { @Test public void testRemoteDisplayStreaming(){ SdlProxyALM proxy = null; - SdlProxyBuilder.Builder builder = new SdlProxyBuilder.Builder(mock(IProxyListenerALM.class), "appId", "appName", true, getTargetContext()); + SdlProxyBuilder.Builder builder = new SdlProxyBuilder.Builder(mock(IProxyListenerALM.class), "appId", "appName", true, getInstrumentation().getTargetContext()); try{ proxy = builder.build(); // public void startRemoteDisplayStream(Context context, final Class<? extends SdlRemoteDisplay> remoteDisplay, final VideoStreamingParameters parameters, final boolean encrypted){ Method m = SdlProxyALM.class.getDeclaredMethod("startRemoteDisplayStream", Context.class, SdlRemoteDisplay.class, VideoStreamingParameters.class, boolean.class); assertNotNull(m); m.setAccessible(true); - m.invoke(proxy,getTargetContext(), SdlRemoteDisplayTest.MockRemoteDisplay.class, (VideoStreamingParameters)null, false); + m.invoke(proxy,getInstrumentation().getTargetContext(), SdlRemoteDisplayTest.MockRemoteDisplay.class, (VideoStreamingParameters)null, false); assert true; }catch (Exception e){ diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java index 20944a117..64f22a673 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java @@ -1,7 +1,7 @@ package com.smartdevicelink.test.rpc; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Before; import org.junit.Test; @@ -21,7 +21,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertTrue; /** @@ -61,7 +61,7 @@ public class RPCConstructorsTests { private Map<String, List<Parameter>> getRPCMandatoryParamsMap(String fileName) { Map<String, List<Parameter>> rpcMandatoryParamsMap = new HashMap<>(); try { - InputStream stream = getTargetContext().getAssets().open(fileName); + InputStream stream = getInstrumentation().getTargetContext().getAssets().open(fileName); XmlPullParserFactory xmlFactoryObject = XmlPullParserFactory.newInstance(); XmlPullParser myParser = xmlFactoryObject.newPullParser(); myParser.setInput(stream, null); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WindowStateTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WindowStateTests.java new file mode 100644 index 000000000..3289f1190 --- /dev/null +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WindowStateTests.java @@ -0,0 +1,52 @@ +package com.smartdevicelink.test.rpc.datatypes; + +import com.smartdevicelink.marshal.JsonRPCMarshaller; +import com.smartdevicelink.proxy.rpc.WindowState; +import com.smartdevicelink.test.TestValues; +import com.smartdevicelink.test.Validator; + +import junit.framework.TestCase; + +import org.json.JSONException; +import org.json.JSONObject; + +public class WindowStateTests extends TestCase { + private WindowState msg; + + @Override + protected void setUp() throws Exception { + msg = new WindowState(); + msg.setApproximatePosition(TestValues.GENERAL_APPROX_POSITION); + msg.setDeviation(TestValues.GENERAL_DEVIATION); + } + + public void testRpcValues() { + Integer approxPosition = msg.getApproximatePosition(); + Integer deviation = msg.getDeviation(); + + // Valid Tests + assertEquals(TestValues.MATCH, TestValues.GENERAL_APPROX_POSITION, approxPosition); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DEVIATION, deviation); + } + + public void testJson() { + JSONObject reference = new JSONObject(); + + try { + reference.put(WindowState.KEY_APPROXIMATE_POSITION, TestValues.GENERAL_APPROX_POSITION); + reference.put(WindowState.KEY_DEVIATION, TestValues.GENERAL_DEVIATION); + + JSONObject underTest = msg.serializeJSON(); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); + + assertTrue(Validator.validateWindowStates( + new WindowState(JsonRPCMarshaller.deserializeJSONObject(reference)), + new WindowState(JsonRPCMarshaller.deserializeJSONObject(underTest))) + ); + + } catch (JSONException e) { + fail(TestValues.JSON_FAIL); + } + } +} + diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WindowStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WindowStatusTests.java new file mode 100644 index 000000000..27fa8102c --- /dev/null +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WindowStatusTests.java @@ -0,0 +1,53 @@ +package com.smartdevicelink.test.rpc.datatypes; + +import com.smartdevicelink.marshal.JsonRPCMarshaller; +import com.smartdevicelink.proxy.rpc.Grid; +import com.smartdevicelink.proxy.rpc.WindowState; +import com.smartdevicelink.proxy.rpc.WindowStatus; +import com.smartdevicelink.test.TestValues; +import com.smartdevicelink.test.Validator; + +import junit.framework.TestCase; + +import org.json.JSONException; +import org.json.JSONObject; + +public class WindowStatusTests extends TestCase { + private WindowStatus msg; + + @Override + protected void setUp() throws Exception { + msg = new WindowStatus(); + msg.setState(TestValues.GENERAL_WINDOW_STATE); + msg.setLocation(TestValues.GENERAL_LOCATION_GRID); + } + + public void testRpcValues() { + WindowState state = msg.getState(); + Grid locationGrid = msg.getLocation(); + + // Valid Tests + assertEquals(TestValues.MATCH, TestValues.GENERAL_WINDOW_STATE, state); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LOCATION_GRID, locationGrid); + } + + public void testJson() { + JSONObject reference = new JSONObject(); + + try { + reference.put(WindowStatus.KEY_STATE, TestValues.GENERAL_WINDOW_STATE); + reference.put(WindowStatus.KEY_LOCATION, TestValues.GENERAL_LOCATION_GRID); + + JSONObject underTest = msg.serializeJSON(); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); + + assertTrue(Validator.validateWindowStatus( + new WindowStatus(JsonRPCMarshaller.deserializeJSONObject(reference)), + new WindowStatus(JsonRPCMarshaller.deserializeJSONObject(underTest))) + ); + + } catch (JSONException e) { + fail(TestValues.JSON_FAIL); + } + } +} diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppHmiTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppHmiTypeTests.java index 85c74e8e4..af0881ad6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppHmiTypeTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppHmiTypeTests.java @@ -42,6 +42,8 @@ public class AppHmiTypeTests extends TestCase { AppHMIType enumSystem = AppHMIType.valueForString(example); example = "REMOTE_CONTROL"; AppHMIType enumRemoteControl = AppHMIType.valueForString(example); + example = "WEB_VIEW"; + AppHMIType enumWebView = AppHMIType.valueForString(example); assertNotNull("DEFAULT returned null", enumDefault); assertNotNull("COMMUNICATION returned null", enumCommunication); @@ -55,6 +57,7 @@ public class AppHmiTypeTests extends TestCase { assertNotNull("TESTING returned null", enumTesting); assertNotNull("SYSTEM returned null", enumSystem); assertNotNull("REMOTE_CONTROL returned null", enumRemoteControl); + assertNotNull("WEB_VIEW returned null", enumWebView); } /** @@ -104,6 +107,7 @@ public class AppHmiTypeTests extends TestCase { enumTestList.add(AppHMIType.TESTING); enumTestList.add(AppHMIType.SYSTEM); enumTestList.add(AppHMIType.REMOTE_CONTROL); + enumTestList.add(AppHMIType.WEB_VIEW); assertTrue("Enum value list does not match enum class list", enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppInterfaceUnregisteredReasonTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppInterfaceUnregisteredReasonTests.java index cc59924d4..bf1d5e65b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppInterfaceUnregisteredReasonTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppInterfaceUnregisteredReasonTests.java @@ -44,6 +44,8 @@ public class AppInterfaceUnregisteredReasonTests extends TestCase { AppInterfaceUnregisteredReason enumProtocolViolation = AppInterfaceUnregisteredReason.valueForString(example); example = "UNSUPPORTED_HMI_RESOURCE"; AppInterfaceUnregisteredReason enumUnsupportedHMIResource = AppInterfaceUnregisteredReason.valueForString(example); + example = "RESOURCE_CONSTRAINT"; + AppInterfaceUnregisteredReason enumResourceConstraint = AppInterfaceUnregisteredReason.valueForString(example); assertNotNull("USER_EXIT returned null", enumUserExit); assertNotNull("IGNITION_OFF returned null", enumIgnitionOff); @@ -58,6 +60,7 @@ public class AppInterfaceUnregisteredReasonTests extends TestCase { assertNotNull("APP_UNAUTHORIZED returned null", enumAppAuthorized); assertNotNull("PROTOCOL_VIOLATION returned null", enumProtocolViolation); assertNotNull("UNSUPPORTED_HMI_RESOURCE returned null", enumUnsupportedHMIResource); + assertNotNull("RESOURCE_CONSTRAINT returned null", enumResourceConstraint); } /** @@ -108,6 +111,7 @@ public class AppInterfaceUnregisteredReasonTests extends TestCase { enumTestList.add(AppInterfaceUnregisteredReason.APP_UNAUTHORIZED); enumTestList.add(AppInterfaceUnregisteredReason.PROTOCOL_VIOLATION); enumTestList.add(AppInterfaceUnregisteredReason.UNSUPPORTED_HMI_RESOURCE); + enumTestList.add(AppInterfaceUnregisteredReason.RESOURCE_CONSTRAINT); assertTrue("Enum value list does not match enum class list", enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PredefinedLayoutTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PredefinedLayoutTests.java index 26b32d08b..4c5526eec 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PredefinedLayoutTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PredefinedLayoutTests.java @@ -58,6 +58,8 @@ public class PredefinedLayoutTests extends TestCase { PredefinedLayout double_graphic_with_softbuttons = PredefinedLayout.valueForString(example); example = "LARGE_GRAPHIC_ONLY"; PredefinedLayout large_graphic_only = PredefinedLayout.valueForString(example); + example = "WEB_VIEW"; + PredefinedLayout web_view = PredefinedLayout.valueForString(example); assertNotNull("DEFAULT returned null", defaultenum); assertNotNull("MEDIA returned null", media); @@ -79,6 +81,7 @@ public class PredefinedLayoutTests extends TestCase { assertNotNull("LARGE_GRAPHIC_WITH_SOFTBUTTONS returned null", large_graphic_with_softbuttons); assertNotNull("DOUBLE_GRAPHIC_WITH_SOFTBUTTONS returned null", double_graphic_with_softbuttons); assertNotNull("LARGE_GRAPHIC_ONLY returned null", large_graphic_only); + assertNotNull("WEB_VIEW returned null", web_view); } /** @@ -137,6 +140,7 @@ public class PredefinedLayoutTests extends TestCase { enumTestList.add(PredefinedLayout.LARGE_GRAPHIC_WITH_SOFTBUTTONS); enumTestList.add(PredefinedLayout.DOUBLE_GRAPHIC_WITH_SOFTBUTTONS); enumTestList.add(PredefinedLayout.LARGE_GRAPHIC_ONLY); + enumTestList.add(PredefinedLayout.WEB_VIEW); assertTrue("Enum value list does not match enum class list", enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java index d4c22354e..3f2ee110d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java @@ -64,7 +64,9 @@ public class SdlDisconnectedReasonTests extends TestCase { SdlDisconnectedReason enumLegacyMode = SdlDisconnectedReason.valueForString(example); example = "RPC_SESSION_ENDED"; SdlDisconnectedReason enumRpcSessionEnded = SdlDisconnectedReason.valueForString(example); - + example = "RESOURCE_CONSTRAINT"; + SdlDisconnectedReason resourceConstraint = SdlDisconnectedReason.valueForString(example); + assertNotNull("USER_EXIT returned null", enumUserExit); assertNotNull("IGNITION_OFF returned null", enumIgnitionOff); assertNotNull("BLUETOOTH_OFF returned null", enumBluetoothOff); @@ -87,6 +89,7 @@ public class SdlDisconnectedReasonTests extends TestCase { assertNotNull("GENERIC_ERROR returned null", enumGenericError); assertNotNull("LEGACY_BLUETOOTH_MODE_ENABLED returned null", enumLegacyMode); assertNotNull("RPC_SESSION_ENDED returned null", enumRpcSessionEnded); + assertNotNull("RESOURCE_CONSTRAINT returned null", resourceConstraint); } /** @@ -149,6 +152,7 @@ public class SdlDisconnectedReasonTests extends TestCase { enumTestList.add(SdlDisconnectedReason.PRIMARY_TRANSPORT_CYCLE_REQUEST); enumTestList.add(SdlDisconnectedReason.MINIMUM_PROTOCOL_VERSION_HIGHER_THAN_SUPPORTED); enumTestList.add(SdlDisconnectedReason.MINIMUM_RPC_VERSION_HIGHER_THAN_SUPPORTED); + enumTestList.add(SdlDisconnectedReason.RESOURCE_CONSTRAINT); assertTrue("Enum value list does not match enum class list", enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); @@ -156,7 +160,7 @@ public class SdlDisconnectedReasonTests extends TestCase { /** * Verifies the valid returns of the conversion method, - * {@link com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason#convertAppInterfaceunregisteredReason(AppInterfaceUnregisteredReason)} + * {@link com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason#convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason)} */ public void testConvertMethod () { assertEquals(TestValues.MATCH, SdlDisconnectedReason.DEFAULT, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.APP_UNAUTHORIZED)); @@ -170,6 +174,7 @@ public class SdlDisconnectedReasonTests extends TestCase { assertEquals(TestValues.MATCH, SdlDisconnectedReason.TOO_MANY_REQUESTS, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.TOO_MANY_REQUESTS)); assertEquals(TestValues.MATCH, SdlDisconnectedReason.USB_DISCONNECTED, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.USB_DISCONNECTED)); assertEquals(TestValues.MATCH, SdlDisconnectedReason.USER_EXIT, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.USER_EXIT)); + assertEquals(TestValues.MATCH, SdlDisconnectedReason.RESOURCE_CONSTRAINT, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.RESOURCE_CONSTRAINT)); assertNull(TestValues.MATCH, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(null)); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java index e11fbe300..6b6b8a144 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java @@ -84,7 +84,10 @@ public class VehicleDataTypeTests extends TestCase { VehicleDataType enumVehicleDataOemVehicleDataType= VehicleDataType.valueForString(example); example = "VEHICLEDATA_HANDSOFFSTEERING"; VehicleDataType enumVehicleDataHandsOffSteeringType= VehicleDataType.valueForString(example); - + + example = "VEHICLEDATA_WINDOWSTATUS"; + VehicleDataType enumVehicleDataTypeWindowStatus= VehicleDataType.valueForString(example); + assertNotNull("VEHICLEDATA_GPS returned null", enumVehicleDataGps); assertNotNull("VEHICLEDATA_SPEED returned null", enumVehicleDataSpeed); assertNotNull("VEHICLEDATA_RPM returned null", enumVehicleDataRpm); @@ -118,6 +121,7 @@ public class VehicleDataTypeTests extends TestCase { assertNotNull("VEHICLEDATA_CLOUDAPPVEHICLEID returned null", enumVehicleCloudAppVehicleId); assertNotNull("VEHICLEDATA_OEM_CUSTOM_DATA returned null", enumVehicleDataOemVehicleDataType); assertNotNull("VEHICLEDATA_HANDSOFFSTEERING returned null", enumVehicleDataHandsOffSteeringType); + assertNotNull("VEHICLEDATA_WINDOWSTATUS returned null", enumVehicleDataTypeWindowStatus); } /** @@ -188,6 +192,7 @@ public class VehicleDataTypeTests extends TestCase { enumTestList.add(VehicleDataType.VEHICLEDATA_CLOUDAPPVEHICLEID); enumTestList.add(VehicleDataType.VEHICLEDATA_OEM_CUSTOM_DATA); enumTestList.add(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING); + enumTestList.add(VehicleDataType.VEHICLEDATA_WINDOWSTATUS); assertTrue("Enum value list does not match enum class list", enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java index 29cf87bc7..45c3b29ee 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java @@ -17,6 +17,7 @@ import com.smartdevicelink.proxy.rpc.MyKey; import com.smartdevicelink.proxy.rpc.OnVehicleData; import com.smartdevicelink.proxy.rpc.SingleTireStatus; import com.smartdevicelink.proxy.rpc.TireStatus; +import com.smartdevicelink.proxy.rpc.WindowStatus; import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus; import com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus; import com.smartdevicelink.proxy.rpc.enums.PRNDL; @@ -100,6 +101,7 @@ public class OnVehicleDataTests extends BaseRpcTests{ result.put(OnVehicleData.KEY_TURN_SIGNAL, VehicleDataHelper.TURN_SIGNAL); result.put(OnVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS); result.put(OnVehicleData.KEY_HANDS_OFF_STEERING, VehicleDataHelper.HANDS_OFF_STEERING); + result.put(OnVehicleData.KEY_WINDOW_STATUS, VehicleDataHelper.WINDOW_STATUS_LIST); result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); } catch(JSONException e) { fail(TestValues.JSON_FAIL); @@ -141,6 +143,7 @@ public class OnVehicleDataTests extends BaseRpcTests{ ClusterModeStatus cluster = ( (OnVehicleData) msg).getClusterModeStatus(); MyKey key = ( (OnVehicleData) msg).getMyKey(); List<FuelRange> fuelRangeList = ( (OnVehicleData) msg).getFuelRange(); + List<WindowStatus> windowStatusList = ( (OnVehicleData) msg).getWindowStatus(); TurnSignal turnSignal = ( (OnVehicleData) msg).getTurnSignal(); ElectronicParkBrakeStatus electronicParkBrakeStatus = ( (OnVehicleData) msg).getElectronicParkBrakeStatus(); Object oemCustomVehicleData = ( (OnVehicleData) msg).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); @@ -173,6 +176,7 @@ public class OnVehicleDataTests extends BaseRpcTests{ assertTrue(TestValues.TRUE, Validator.validateClusterModeStatus(VehicleDataHelper.CLUSTER_MODE_STATUS, cluster)); assertTrue(TestValues.TRUE, Validator.validateMyKey(VehicleDataHelper.MY_KEY, key)); assertTrue(TestValues.TRUE, Validator.validateFuelRange(VehicleDataHelper.FUEL_RANGE_LIST, fuelRangeList)); + assertTrue(TestValues.TRUE, Validator.validateWindowStatuses(VehicleDataHelper.WINDOW_STATUS_LIST, windowStatusList)); assertEquals(TestValues.MATCH, VehicleDataHelper.TURN_SIGNAL, turnSignal); assertEquals(TestValues.MATCH, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus); assertEquals(TestValues.MATCH, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE, oemCustomVehicleData); @@ -212,6 +216,7 @@ public class OnVehicleDataTests extends BaseRpcTests{ assertNull(TestValues.NULL, msg.getTurnSignal()); assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus()); assertNull(TestValues.NULL, msg.getHandsOffSteering()); + assertNull(TestValues.NULL, msg.getWindowStatus()); assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -232,8 +237,10 @@ public class OnVehicleDataTests extends BaseRpcTests{ JSONObject clusterModeStatusObj = new JSONObject(); JSONObject myKeyObj = new JSONObject(); JSONObject fuelRangeObj = new JSONObject(); + JSONObject windowStatusObj = new JSONObject(); JSONArray fuelRangeArrayObj = new JSONArray(); - + JSONArray windowStatusArrayObj = new JSONArray(); + try { //Set up the JSONObject to represent OnVehicleData: @@ -359,6 +366,11 @@ public class OnVehicleDataTests extends BaseRpcTests{ fuelRangeObj.put(FuelRange.KEY_RANGE, VehicleDataHelper.FUEL_RANGE_RANGE); fuelRangeArrayObj.put(fuelRangeObj); + // WINDOW_STATUS + windowStatusObj.put(WindowStatus.KEY_LOCATION, VehicleDataHelper.LOCATION_GRID); + windowStatusObj.put(WindowStatus.KEY_STATE, VehicleDataHelper.WINDOW_STATE); + windowStatusArrayObj.put(windowStatusObj); + reference.put(OnVehicleData.KEY_SPEED, VehicleDataHelper.SPEED); reference.put(OnVehicleData.KEY_RPM, VehicleDataHelper.RPM); reference.put(OnVehicleData.KEY_EXTERNAL_TEMPERATURE, VehicleDataHelper.EXTERNAL_TEMPERATURE); @@ -389,6 +401,7 @@ public class OnVehicleDataTests extends BaseRpcTests{ reference.put(OnVehicleData.KEY_TURN_SIGNAL, VehicleDataHelper.TURN_SIGNAL); reference.put(OnVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS); reference.put(OnVehicleData.KEY_HANDS_OFF_STEERING, VehicleDataHelper.HANDS_OFF_STEERING); + reference.put(OnVehicleData.KEY_WINDOW_STATUS, windowStatusArrayObj); reference.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); JSONObject underTest = msg.serializeJSON(); @@ -508,6 +521,25 @@ public class OnVehicleDataTests extends BaseRpcTests{ assertTrue(TestValues.TRUE, Validator.validateFuelRange( fuelRangeRefereceList, fuelRangeUnderTestList)); + } else if (key.equals(OnVehicleData.KEY_WINDOW_STATUS)) { + JSONArray windowStatusArrayObjReference = JsonUtils.readJsonArrayFromJsonObject(reference, key); + List<WindowStatus> windowStatusReferenceList = new ArrayList<>(); + for (int index = 0; index < windowStatusArrayObjReference.length(); index++) { + WindowStatus windowStatus = new WindowStatus(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)windowStatusArrayObjReference.get(index) )); + windowStatusReferenceList.add(windowStatus); + } + + JSONArray windowStatusArrayObjTest = JsonUtils.readJsonArrayFromJsonObject(underTest, key); + List<WindowStatus> windowStatusUnderTestList = new ArrayList<>(); + for (int index = 0; index < windowStatusArrayObjTest.length(); index++) { + WindowStatus windowStatus = new WindowStatus(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)windowStatusArrayObjTest.get(index) )); + windowStatusUnderTestList.add(windowStatus); + } + + assertTrue("JSON value didn't match expected value for key \"" + key + "\".", + Validator.validateWindowStatuses( + windowStatusReferenceList, + windowStatusUnderTestList)); } else { assertEquals(TestValues.TRUE, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java index d31ff4464..88d22cd8d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java @@ -18,7 +18,7 @@ import org.junit.Test; import java.util.Hashtable; import java.util.List; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertTrue; @@ -108,7 +108,7 @@ public class AddCommandTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java index 1885f8c9b..74efd59e9 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java @@ -23,7 +23,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -113,7 +113,7 @@ public class AddSubmenuTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java index f7c2c3218..2fef7e829 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java @@ -26,7 +26,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -95,7 +95,7 @@ public class AlertManeuverTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java index e9a455ce5..2224191dd 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java @@ -27,7 +27,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -136,7 +136,7 @@ public class AlertTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ButtonPressTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ButtonPressTests.java index 63a411fe6..f593f2325 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ButtonPressTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ButtonPressTests.java @@ -18,7 +18,7 @@ import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -101,7 +101,7 @@ public class ButtonPressTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CancelInteractionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CancelInteractionTests.java index bed52225c..d2e41f85e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CancelInteractionTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CancelInteractionTests.java @@ -53,7 +53,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -120,7 +120,7 @@ public class CancelInteractionTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java index 05c8dddd5..a2e0cadf0 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java @@ -16,7 +16,7 @@ import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -89,7 +89,7 @@ public class ChangeRegistrationTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CloseApplicationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CloseApplicationTests.java index 99428fae2..62a92acfc 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CloseApplicationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CloseApplicationTests.java @@ -52,7 +52,7 @@ import java.util.Hashtable; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -96,7 +96,7 @@ public class CloseApplicationTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java index 0d6ab0e2a..3e8e533e2 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java @@ -24,7 +24,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -96,7 +96,7 @@ public class CreateInteractionChoiceSetTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateWindowTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateWindowTests.java index 3e2ddee64..733932efb 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateWindowTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateWindowTests.java @@ -20,7 +20,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -104,7 +104,7 @@ public class CreateWindowTests extends BaseRpcTests { */ @Test public void testJsonConstructor() { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java index 4e485e8ff..20d5fe591 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java @@ -19,7 +19,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -83,7 +83,7 @@ public class DeleteCommandTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java index c95b85536..5174f9789 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java @@ -19,7 +19,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -83,7 +83,7 @@ public class DeleteFileTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java index c4ac6db5d..0fb31ba25 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java @@ -19,7 +19,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -83,7 +83,7 @@ public class DeleteInteractionChoiceSetTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java index 12e982b94..68adc14fa 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -82,7 +82,7 @@ public class DeleteSubMenuTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteWindowTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteWindowTests.java index 1f1b2ab89..c442395bd 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteWindowTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteWindowTests.java @@ -18,7 +18,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -82,7 +82,7 @@ public class DeleteWindowTests extends BaseRpcTests { */ @Test public void testJsonConstructor() { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java index 41accb797..7b0ecacf9 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java @@ -22,7 +22,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -100,7 +100,7 @@ public class DiagnosticMessageTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DialNumberTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DialNumberTests.java index fc0db6117..88e9fbffd 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DialNumberTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DialNumberTests.java @@ -18,7 +18,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * Created by austinkirk on 6/6/17. @@ -83,7 +83,7 @@ public class DialNumberTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java index 7694da1e6..d97bc0f32 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java @@ -18,7 +18,7 @@ import java.util.Hashtable; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -62,7 +62,7 @@ public class EndAudioPassThruTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetAppServiceDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetAppServiceDataTests.java index 2a9ab6641..f5e7bba89 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetAppServiceDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetAppServiceDataTests.java @@ -19,7 +19,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; public class GetAppServiceDataTests extends BaseRpcTests { @@ -93,7 +93,7 @@ public class GetAppServiceDataTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java index 930debec5..73d15ad6d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java @@ -19,7 +19,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -88,7 +88,7 @@ public class GetDTCsTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetFileTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetFileTests.java index df19fa3de..450dcba1e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetFileTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetFileTests.java @@ -20,7 +20,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; public class GetFileTests extends BaseRpcTests { @@ -113,7 +113,7 @@ public class GetFileTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataConsentTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataConsentTests.java index a6def432b..2aa7dc593 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataConsentTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataConsentTests.java @@ -16,7 +16,7 @@ import org.junit.Test; import java.util.Hashtable; import java.util.List; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -77,7 +77,7 @@ public class GetInteriorVehicleDataConsentTests extends BaseRpcTests { @Test public void testJsonConstructor() { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java index 4ab5f5e6a..4c7f5f461 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java @@ -20,7 +20,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -94,7 +94,7 @@ public class GetInteriorVehicleDataTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java index f65473c3f..533ff8c50 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java @@ -20,7 +20,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; public class GetSystemCapabilityTests extends BaseRpcTests { @@ -85,7 +85,7 @@ public class GetSystemCapabilityTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java index 61bc42f54..67bfb42ec 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java @@ -20,7 +20,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -62,6 +62,7 @@ public class GetVehicleDataTests extends BaseRpcTests { msg.setTurnSignal(TestValues.GENERAL_BOOLEAN); msg.setElectronicParkBrakeStatus(TestValues.GENERAL_BOOLEAN); msg.setHandsOffSteering(TestValues.GENERAL_BOOLEAN); + msg.setWindowStatus(TestValues.GENERAL_BOOLEAN); msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); return msg; @@ -112,6 +113,7 @@ public class GetVehicleDataTests extends BaseRpcTests { result.put(GetVehicleData.KEY_TURN_SIGNAL, TestValues.GENERAL_BOOLEAN); result.put(GetVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_BOOLEAN); result.put(GetVehicleData.KEY_HANDS_OFF_STEERING, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_WINDOW_STATUS, TestValues.GENERAL_BOOLEAN); result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); }catch(JSONException e){ fail(TestValues.JSON_FAIL); @@ -157,6 +159,7 @@ public class GetVehicleDataTests extends BaseRpcTests { assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getTurnSignal()); assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getElectronicParkBrakeStatus()); assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getHandsOffSteering()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getWindowStatus()); assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); // Invalid/Null Tests @@ -194,6 +197,7 @@ public class GetVehicleDataTests extends BaseRpcTests { assertNull(TestValues.NULL, msg.getTurnSignal()); assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus()); assertNull(TestValues.NULL, msg.getHandsOffSteering()); + assertNull(TestValues.NULL, msg.getWindowStatus()); assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -202,7 +206,7 @@ public class GetVehicleDataTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { @@ -247,6 +251,7 @@ public class GetVehicleDataTests extends BaseRpcTests { assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_HANDS_OFF_STEERING), cmd.getHandsOffSteering()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_WINDOW_STATUS), cmd.getWindowStatus()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } catch (JSONException e) { fail(TestValues.JSON_FAIL); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetWayPointsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetWayPointsTests.java index 4037eb53d..a52d1a644 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetWayPointsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetWayPointsTests.java @@ -20,7 +20,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * Created by austinkirk on 6/6/17. @@ -83,7 +83,7 @@ public class GetWayPointsTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java index ac51ca8aa..92e7286e4 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java @@ -18,7 +18,7 @@ import java.util.Hashtable; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -62,7 +62,7 @@ public class ListFilesTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAppServiceInteractionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAppServiceInteractionTests.java index 0085f0f30..9a9b7b375 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAppServiceInteractionTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAppServiceInteractionTests.java @@ -19,7 +19,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; public class PerformAppServiceInteractionTests extends BaseRpcTests { @@ -110,7 +110,7 @@ public class PerformAppServiceInteractionTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java index 65c4b00dd..abbe3d644 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java @@ -28,7 +28,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -129,7 +129,7 @@ public class PerformAudioPassThruTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java index f363e06a2..176cc3ec5 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java @@ -28,7 +28,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -138,7 +138,7 @@ public class PerformInteractionTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PublishAppServiceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PublishAppServiceTests.java index fecad8073..9d0c3ed94 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PublishAppServiceTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PublishAppServiceTests.java @@ -22,7 +22,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; public class PublishAppServiceTests extends BaseRpcTests { @@ -92,7 +92,7 @@ public class PublishAppServiceTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java index d5834414d..b70c83794 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java @@ -21,7 +21,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -130,7 +130,7 @@ public class PutFileTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java index f528e34ce..151f5cc3e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java @@ -22,7 +22,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -91,7 +91,7 @@ public class ReadDidTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java index 74035cb7c..665a3dc80 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java @@ -31,7 +31,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -169,7 +169,7 @@ public class RegisterAppInterfaceTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReleaseInteriorVehicleDataModuleTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReleaseInteriorVehicleDataModuleTests.java index 280e4f11b..e786d1786 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReleaseInteriorVehicleDataModuleTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReleaseInteriorVehicleDataModuleTests.java @@ -20,7 +20,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; public class ReleaseInteriorVehicleDataModuleTests extends BaseRpcTests { @@ -75,7 +75,7 @@ public class ReleaseInteriorVehicleDataModuleTests extends BaseRpcTests { @Test public void testJsonConstructor() { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java index 89cef762e..68448c5a6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java @@ -22,7 +22,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -89,7 +89,7 @@ public class ResetGlobalPropertiesTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java index 632769924..e6d8b146d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java @@ -25,7 +25,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -108,7 +108,7 @@ public class ScrollableMessageTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java index c92eac6ec..99a74dfae 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java @@ -23,7 +23,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -117,7 +117,7 @@ public class SendLocationTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull("Command object is null", commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java index e4df0a44b..5878aad7c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java @@ -19,7 +19,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -83,7 +83,7 @@ public class SetAppIconTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java index 56f0dc0bc..22118bdb1 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java @@ -22,7 +22,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** @@ -97,7 +97,7 @@ public class SetDisplayLayoutTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java index 51adf5c7c..379b1c1ee 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java @@ -29,7 +29,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -128,7 +128,7 @@ public class SetGlobalPropertiesTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetInteriorVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetInteriorVehicleDataTests.java index ecffe1b21..1285acafd 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetInteriorVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetInteriorVehicleDataTests.java @@ -22,7 +22,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -86,7 +86,7 @@ public class SetInteriorVehicleDataTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java index 5e97d8633..a60709dba 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java @@ -24,7 +24,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -169,7 +169,7 @@ public class SetMediaClockTimerTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowAppMenuTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowAppMenuTests.java index eb2526e54..3e486bc6a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowAppMenuTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowAppMenuTests.java @@ -54,7 +54,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -116,7 +116,7 @@ public class ShowAppMenuTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java index 4a3034eee..85c830214 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java @@ -26,7 +26,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -140,7 +140,7 @@ public class ShowConstantTbtTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java index de39d2733..742d23ff4 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java @@ -29,7 +29,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -156,7 +156,7 @@ public class ShowTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(),getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(),getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java index c375d2d4d..32f60d4e5 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java @@ -22,7 +22,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -111,7 +111,7 @@ public class SliderTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java index 4681975fe..f0214c78c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java @@ -25,7 +25,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; public class SpeakTests extends BaseRpcTests { @@ -85,7 +85,7 @@ public class SpeakTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java index 534e65576..19b192b31 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java @@ -15,7 +15,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -83,7 +83,7 @@ public class SubscribeButtonTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java index 09b3d6af7..c7b5b9678 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java @@ -20,7 +20,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -61,6 +61,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { msg.setTurnSignal(TestValues.GENERAL_BOOLEAN); msg.setElectronicParkBrakeStatus(TestValues.GENERAL_BOOLEAN); msg.setHandsOffSteering(TestValues.GENERAL_BOOLEAN); + msg.setWindowStatus(TestValues.GENERAL_BOOLEAN); msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); return msg; @@ -110,6 +111,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { result.put(SubscribeVehicleData.KEY_TURN_SIGNAL, TestValues.GENERAL_BOOLEAN); result.put(SubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_BOOLEAN); result.put(SubscribeVehicleData.KEY_HANDS_OFF_STEERING, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_WINDOW_STATUS, TestValues.GENERAL_BOOLEAN); result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); } catch (JSONException e) { fail(TestValues.JSON_FAIL); @@ -154,6 +156,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getTurnSignal()); assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getElectronicParkBrakeStatus()); assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getHandsOffSteering()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getWindowStatus()); assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); // Invalid/Null Tests @@ -190,6 +193,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { assertNull(TestValues.NULL, msg.getTurnSignal()); assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus()); assertNull(TestValues.NULL, msg.getHandsOffSteering()); + assertNull(TestValues.NULL, msg.getWindowStatus()); assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -198,7 +202,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { @@ -242,6 +246,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_HANDS_OFF_STEERING), cmd.getHandsOffSteering()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_WINDOW_STATUS), cmd.getWindowStatus()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } catch (JSONException e) { fail(TestValues.JSON_FAIL); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeWayPointsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeWayPointsTests.java index 894ef026e..2ce400e55 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeWayPointsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeWayPointsTests.java @@ -18,7 +18,7 @@ import java.util.Hashtable; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * Created by austinkirk on 6/7/17. @@ -61,7 +61,7 @@ public class SubscribeWayPointsTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java index 217e4da58..aeb061dc6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java @@ -23,7 +23,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** @@ -104,7 +104,7 @@ public class SystemRequestTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnpublishAppServiceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnpublishAppServiceTests.java index f038121a7..796fe2a25 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnpublishAppServiceTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnpublishAppServiceTests.java @@ -54,7 +54,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -128,7 +128,7 @@ public class UnpublishAppServiceTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java index e400ff73b..dec7b0376 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java @@ -18,7 +18,7 @@ import java.util.Hashtable; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -62,7 +62,7 @@ public class UnregisterAppInterfaceTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java index 9b786cb7d..97833ce02 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java @@ -20,7 +20,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -85,7 +85,7 @@ public class UnsubscribeButtonTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java index 50c6ff44b..98eaf599c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java @@ -21,7 +21,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** @@ -64,6 +64,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { msg.setElectronicParkBrakeStatus(TestValues.GENERAL_BOOLEAN); msg.setCloudAppVehicleID(TestValues.GENERAL_BOOLEAN); msg.setHandsOffSteering(TestValues.GENERAL_BOOLEAN); + msg.setWindowStatus(TestValues.GENERAL_BOOLEAN); msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); return msg; @@ -114,6 +115,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { result.put(UnsubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_BOOLEAN); result.put(UnsubscribeVehicleData.KEY_CLOUD_APP_VEHICLE_ID, TestValues.GENERAL_BOOLEAN); result.put(UnsubscribeVehicleData.KEY_HANDS_OFF_STEERING, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_WINDOW_STATUS, TestValues.GENERAL_BOOLEAN); result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); } catch (JSONException e) { fail(TestValues.JSON_FAIL); @@ -158,8 +160,8 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getElectronicParkBrakeStatus()); assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getCloudAppVehicleID()); assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getHandsOffSteering()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getWindowStatus()); assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); - // Invalid/Null Tests UnsubscribeVehicleData msg = new UnsubscribeVehicleData(); assertNotNull(TestValues.NOT_NULL, msg); @@ -195,6 +197,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus()); assertNull(TestValues.NULL, msg.getCloudAppVehicleID()); assertNull(TestValues.NULL, msg.getHandsOffSteering()); + assertNull(TestValues.NULL, msg.getWindowStatus()); assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -203,7 +206,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { @@ -248,6 +251,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_CLOUD_APP_VEHICLE_ID), cmd.getCloudAppVehicleID()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_HANDS_OFF_STEERING), cmd.getHandsOffSteering()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_WINDOW_STATUS), cmd.getWindowStatus()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeWayPointsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeWayPointsTests.java index d595b8ec9..5d20c8454 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeWayPointsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeWayPointsTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.fail; @@ -60,7 +60,7 @@ public class UnsubscribeWayPointsTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java index 3f2e37a03..53dc91fc6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java @@ -26,7 +26,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -98,7 +98,7 @@ public class UpdateTurnListTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java index 94346fdb2..e4d69e79f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java @@ -15,7 +15,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -61,7 +61,7 @@ public class AddCommandResponseTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java index ec355539d..861de0d37 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class AddSubmenuResponseTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java index f26a09f4a..01805fce6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class AlertManeuverResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java index ff260f23f..d8f554c53 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java @@ -19,7 +19,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -83,7 +83,7 @@ public class AlertResponseTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java index 25b8140c4..2c4bfc651 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class ButtonPressResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CancelInteractionResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CancelInteractionResponseTests.java index e1fb2746a..a981719e9 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CancelInteractionResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CancelInteractionResponseTests.java @@ -48,7 +48,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -94,7 +94,7 @@ public class CancelInteractionResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java index 60996445c..6888c589d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java @@ -17,7 +17,7 @@ import java.util.Hashtable; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -61,7 +61,7 @@ public class ChangeRegistrationResponseTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CloseApplicationResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CloseApplicationResponseTests.java index 9bf867391..6eb9a09a5 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CloseApplicationResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CloseApplicationResponseTests.java @@ -48,7 +48,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -94,7 +94,7 @@ public class CloseApplicationResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateWindowResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateWindowResponseTest.java index 56e8fc257..a06af985b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateWindowResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateWindowResponseTest.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class CreateWindowResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor() { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java index 2318a4e46..b2e6e27a9 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class DeleteCommandResponseTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java index d5ca5d0c1..0e529dc69 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -82,7 +82,7 @@ public class DeleteFileResponseTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java index 7a313531c..24ce266d1 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class DeleteInteractionChoiceSetResponseTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java index e70402ecd..8392f915b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class DeleteSubMenuResponseTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteWindowResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteWindowResponseTest.java index bfa2df5aa..347db5ea6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteWindowResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteWindowResponseTest.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class DeleteWindowResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor() { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java index d42a1e53e..7bfefbeea 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java @@ -16,7 +16,7 @@ import org.junit.Test; import java.util.Hashtable; import java.util.List; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -91,7 +91,7 @@ public class DiagnosticMessageResponseTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java index 9625cf3d5..ff23c5ad7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class DialNumberResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java index 9d999e1b7..f68a6837b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class EndAudioPassThruResponseTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetAppServiceDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetAppServiceDataResponseTests.java index 243c9ab3b..3e1d1f136 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetAppServiceDataResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetAppServiceDataResponseTests.java @@ -15,7 +15,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -66,7 +66,7 @@ public class GetAppServiceDataResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java index 464efa60c..ea4d48790 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java @@ -22,7 +22,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -90,7 +90,7 @@ public class GetDTCsResponseTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetFileResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetFileResponseTests.java index 6b62d3200..a4abf011d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetFileResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetFileResponseTests.java @@ -20,7 +20,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** @@ -101,7 +101,7 @@ public class GetFileResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataConsentResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataConsentResponseTests.java index 48cea8f69..411691bd0 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataConsentResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataConsentResponseTests.java @@ -16,7 +16,7 @@ import org.junit.Test; import java.util.Hashtable; import java.util.List; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertTrue; @@ -68,7 +68,7 @@ public class GetInteriorVehicleDataConsentResponseTests extends BaseRpcTests { @Test public void testJsonConstructor() { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java index fd3e793f5..80185c05c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java @@ -16,7 +16,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -91,7 +91,7 @@ public class GetInteriorVehicleDataResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java index 80a0a8b8d..ee2b24d1f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java @@ -20,7 +20,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; public class GetSystemCapabilityResponseTests extends BaseRpcTests { @@ -80,7 +80,7 @@ public class GetSystemCapabilityResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java index 990efa920..001bf54f2 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java @@ -17,6 +17,7 @@ import com.smartdevicelink.proxy.rpc.HeadLampStatus; import com.smartdevicelink.proxy.rpc.MyKey; import com.smartdevicelink.proxy.rpc.SingleTireStatus; import com.smartdevicelink.proxy.rpc.TireStatus; +import com.smartdevicelink.proxy.rpc.WindowStatus; import com.smartdevicelink.proxy.rpc.enums.TurnSignal; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; @@ -40,7 +41,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** @@ -98,6 +99,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{ result.put(GetVehicleDataResponse.KEY_FUEL_RANGE, VehicleDataHelper.JSON_FUEL_RANGE); result.put(GetVehicleDataResponse.KEY_TURN_SIGNAL, VehicleDataHelper.TURN_SIGNAL); result.put(GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS); + result.put(GetVehicleDataResponse.KEY_WINDOW_STATUS, VehicleDataHelper.WINDOW_STATUS_LIST); result.put(GetVehicleDataResponse.KEY_HANDS_OFF_STEERING, VehicleDataHelper.HANDS_OFF_STEERING); result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); } catch(JSONException e){ @@ -124,8 +126,10 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{ JSONObject clusterModeStatusObj = new JSONObject(); JSONObject myKeyObj = new JSONObject(); JSONObject fuelRangeObj = new JSONObject(); + JSONObject windowStatusObj = new JSONObject(); JSONArray fuelRangeArrayObj = new JSONArray(); - + JSONArray windowStatusArrayObj = new JSONArray(); + try { //set up the JSONObject to represent GetVehicleDataResponse //TIRE_PRESSURE @@ -250,6 +254,11 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{ fuelRangeObj.put(FuelRange.KEY_RANGE, VehicleDataHelper.FUEL_RANGE_RANGE); fuelRangeArrayObj.put(fuelRangeObj); + // WINDOW_STATUS + windowStatusObj.put(WindowStatus.KEY_LOCATION, VehicleDataHelper.LOCATION_GRID); + windowStatusObj.put(WindowStatus.KEY_STATE, VehicleDataHelper.WINDOW_STATE); + windowStatusArrayObj.put(windowStatusObj); + reference.put(GetVehicleDataResponse.KEY_SPEED, VehicleDataHelper.SPEED); reference.put(GetVehicleDataResponse.KEY_RPM, VehicleDataHelper.RPM); reference.put(GetVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE, VehicleDataHelper.EXTERNAL_TEMPERATURE); @@ -279,8 +288,10 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{ reference.put(GetVehicleDataResponse.KEY_FUEL_RANGE, fuelRangeArrayObj); reference.put(GetVehicleDataResponse.KEY_TURN_SIGNAL, TurnSignal.OFF); reference.put(GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS); + reference.put(GetVehicleDataResponse.KEY_WINDOW_STATUS, windowStatusArrayObj); reference.put(GetVehicleDataResponse.KEY_HANDS_OFF_STEERING, VehicleDataHelper.HANDS_OFF_STEERING); reference.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); + JSONObject underTest = msg.serializeJSON(); //go inside underTest and only return the JSONObject inside the parameters key inside the response key @@ -417,6 +428,26 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{ fuelRangeRefereceList, fuelRangeUnderTestList)); } + else if (key.equals(GetVehicleDataResponse.KEY_WINDOW_STATUS)) { + JSONArray windowStatusArrayObjReference = JsonUtils.readJsonArrayFromJsonObject(reference, key); + List<WindowStatus> windowStatusReferenceList = new ArrayList<>(); + for (int index = 0; index < windowStatusArrayObjReference.length(); index++) { + WindowStatus windowStatus = new WindowStatus(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)windowStatusArrayObjReference.get(index) )); + windowStatusReferenceList.add(windowStatus); + } + + JSONArray windowStatusArrayObjTest = JsonUtils.readJsonArrayFromJsonObject(underTest, key); + List<WindowStatus> windowStatusUnderTestList = new ArrayList<>(); + for (int index = 0; index < windowStatusArrayObjTest.length(); index++) { + WindowStatus windowStatus = new WindowStatus(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)windowStatusArrayObjTest.get(index) )); + windowStatusUnderTestList.add(windowStatus); + } + + assertTrue("JSON value didn't match expected value for key \"" + key + "\".", + Validator.validateWindowStatuses( + windowStatusReferenceList, + windowStatusUnderTestList)); + } else { assertEquals("JSON value didn't match expected value for key \"" + key + "\".", JsonUtils.readObjectFromJsonObject(reference, key), @@ -463,6 +494,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{ assertEquals(TestValues.MATCH, VehicleDataHelper.MY_KEY, ( (GetVehicleDataResponse) msg ).getMyKey()); assertEquals(TestValues.MATCH, VehicleDataHelper.TURN_SIGNAL, ( (GetVehicleDataResponse) msg ).getTurnSignal()); assertEquals(TestValues.MATCH, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS, ( (GetVehicleDataResponse) msg ).getElectronicParkBrakeStatus()); + assertEquals(TestValues.MATCH, VehicleDataHelper.WINDOW_STATUS_LIST, ( (GetVehicleDataResponse) msg ).getWindowStatus()); assertEquals(TestValues.MATCH, VehicleDataHelper.HANDS_OFF_STEERING, ( (GetVehicleDataResponse) msg ).getHandsOffSteering()); assertEquals(TestValues.MATCH, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE, ( (GetVehicleDataResponse) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); @@ -499,6 +531,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{ assertNull(TestValues.NULL, msg.getTurnSignal()); assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus()); assertNull(TestValues.NULL, msg.getHandsOffSteering()); + assertNull(TestValues.NULL, msg.getWindowStatus()); assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -508,7 +541,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { @@ -587,6 +620,15 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{ MyKey myKey = new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObj)); assertTrue(TestValues.TRUE, Validator.validateMyKey(myKey, cmd.getMyKey()) ); + JSONArray windowStatusArray = JsonUtils.readJsonArrayFromJsonObject(parameters, GetVehicleDataResponse.KEY_WINDOW_STATUS); + + List<WindowStatus> windowStatus = new ArrayList<>(); + for (int index = 0; index < windowStatusArray.length(); index++) { + WindowStatus status = new WindowStatus(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)windowStatusArray.get(index)) ); + windowStatus.add(status); + } + assertTrue(TestValues.TRUE, Validator.validateWindowStatuses(windowStatus, cmd.getWindowStatus()) ); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_TURN_SIGNAL), cmd.getTurnSignal().toString()); assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus().toString()); assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java index f133e2bed..fb123bef4 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java @@ -18,7 +18,7 @@ import org.junit.Test; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -98,7 +98,7 @@ public class GetWayPointsResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java index 432562631..7b7bd20ec 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java @@ -22,7 +22,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** @@ -93,7 +93,7 @@ public class ListFilesResponseTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAppServiceInteractionResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAppServiceInteractionResponseTests.java index 58663a888..4280902e2 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAppServiceInteractionResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAppServiceInteractionResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -84,7 +84,7 @@ public class PerformAppServiceInteractionResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java index 3fb489fca..7cff8e766 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class PerformAudioPassThruResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java index dd81627b4..32c42c16c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java @@ -15,7 +15,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -93,7 +93,7 @@ public class PerformInteractionResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PublishAppServiceResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PublishAppServiceResponseTests.java index 9659c992b..5bb6f923a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PublishAppServiceResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PublishAppServiceResponseTests.java @@ -22,7 +22,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -87,7 +87,7 @@ public class PublishAppServiceResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java index 90faa7291..e95285db8 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -82,7 +82,7 @@ public class PutFileResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java index 5948eb3f5..aec63227d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java @@ -19,7 +19,7 @@ import org.junit.Test; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -89,7 +89,7 @@ public class ReadDIDResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java index 4a12bc5b3..862ed5342 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java @@ -36,7 +36,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -176,7 +176,7 @@ public class RegisterAppInterfaceResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReleaseInteriorVehicleDataModuleResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReleaseInteriorVehicleDataModuleResponseTests.java index 760623916..965980a0d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReleaseInteriorVehicleDataModuleResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReleaseInteriorVehicleDataModuleResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.fail; @@ -44,7 +44,7 @@ public class ReleaseInteriorVehicleDataModuleResponseTests extends BaseRpcTests @Test public void testJsonConstructor() { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java index eb8ab1ae2..e8d3576e6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class ResetGlobalPropertiesResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java index e7ec116d4..4e12cb78c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class ScrollableMessageResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java index bf9461328..7208eeff4 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -61,7 +61,7 @@ public class SendLocationResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java index dd850f46b..e6f0bf140 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class SetAppIconResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java index b6e7be537..63d63dab9 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java @@ -28,7 +28,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -113,7 +113,7 @@ public class SetDisplayLayoutResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java index 04e099304..9765dcfba 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -61,7 +61,7 @@ public class SetGlobalPropertiesResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java index cdb59146c..7abcdcecc 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java @@ -22,7 +22,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -87,7 +87,7 @@ public class SetInteriorVehicleDataResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java index 981f4e3f0..d8f699b5a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java @@ -17,7 +17,7 @@ import java.util.Hashtable; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -61,7 +61,7 @@ public class SetMediaClockTimerResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowAppMenuResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowAppMenuResponseTests.java index a4b1dda0b..1cfafd319 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowAppMenuResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowAppMenuResponseTests.java @@ -49,7 +49,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -91,7 +91,7 @@ public class ShowAppMenuResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java index 06bb43dba..aa44a190b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -61,7 +61,7 @@ public class ShowConstantTbtResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java index 6e6140068..ebd5f41b6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java @@ -17,7 +17,7 @@ import java.util.Hashtable; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** @@ -62,7 +62,7 @@ public class ShowResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java index 8d288c73b..f454af9eb 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -81,7 +81,7 @@ public class SliderResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java index 196c06f21..f2880d3eb 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class SpeakResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/StreamRPCResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/StreamRPCResponseTests.java index 252a34aab..2dcfb0509 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/StreamRPCResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/StreamRPCResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -72,7 +72,7 @@ public class StreamRPCResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java index 023fd8869..1c58b13bc 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java @@ -17,7 +17,7 @@ import java.util.Hashtable; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** @@ -62,7 +62,7 @@ public class SubscribeButtonResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java index 2277434b9..def395e1e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java @@ -22,7 +22,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.fail; /** @@ -66,6 +66,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { msg.setTurnSignal(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal())); msg.setElectronicParkBrakeStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal())); msg.setHandsOffSteering(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING.ordinal())); + msg.setWindowStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WINDOWSTATUS.ordinal())); msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA); return msg; @@ -118,6 +119,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { result.put(SubscribeVehicleDataResponse.KEY_MY_KEY, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal()).serializeJSON()); result.put(SubscribeVehicleDataResponse.KEY_FUEL_RANGE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal()).serializeJSON()); result.put(SubscribeVehicleDataResponse.KEY_TURN_SIGNAL, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_WINDOW_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WINDOWSTATUS.ordinal()).serializeJSON()); result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON()); result.put(SubscribeVehicleDataResponse.KEY_HANDS_OFF_STEERING, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING.ordinal()).serializeJSON()); result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA.serializeJSON()); @@ -163,6 +165,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { VehicleDataResult testTurnSignal = ( (SubscribeVehicleDataResponse) msg ).getTurnSignal(); VehicleDataResult testEBrakeStatus = ( (SubscribeVehicleDataResponse) msg ).getElectronicParkBrakeStatus(); VehicleDataResult testHOffSteering = ( (SubscribeVehicleDataResponse) msg ).getHandsOffSteering(); + VehicleDataResult testWindowStatus = ( (SubscribeVehicleDataResponse) msg ).getWindowStatus(); VehicleDataResult testOEMCustomVehicleData = ( (SubscribeVehicleDataResponse) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); // Valid Tests @@ -195,6 +198,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { assertTrue(TestValues.TRUE, testTurnSignal.getDataType().equals(VehicleDataType.VEHICLEDATA_TURNSIGNAL)); assertTrue(TestValues.TRUE, testEBrakeStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS)); assertTrue(TestValues.TRUE, testHOffSteering.getDataType().equals(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING)); + assertTrue(TestValues.TRUE, testWindowStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_WINDOWSTATUS)); assertTrue(TestValues.TRUE, testOEMCustomVehicleData.getOEMCustomVehicleDataType().equals(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); // Invalid/Null Tests @@ -231,6 +235,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { assertNull(TestValues.NULL, msg.getTurnSignal()); assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus()); assertNull(TestValues.NULL, msg.getHandsOffSteering()); + assertNull(TestValues.NULL, msg.getWindowStatus()); assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -239,7 +244,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { @@ -371,6 +376,10 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { VehicleDataResult referenceHandsOffSteering = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(handsOffSteering)); assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceHandsOffSteering, cmd.getHandsOffSteering())); + JSONObject windowStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_WINDOW_STATUS); + VehicleDataResult referenceWindowStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(windowStatus)); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceWindowStatus, cmd.getWindowStatus())); + JSONObject oemCustomVehicleDataName = JsonUtils.readJsonObjectFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); VehicleDataResult referenceOemCustomData = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(oemCustomVehicleDataName)); assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceOemCustomData, cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME))); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java index 817414ae1..239702805 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -59,7 +59,7 @@ public class SubscribeWaypointsResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java index 3ccae2288..9f4e464f4 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class SystemRequestResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnpublishAppServiceResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnpublishAppServiceResponseTests.java index 62264a884..7536dd2a7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnpublishAppServiceResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnpublishAppServiceResponseTests.java @@ -49,7 +49,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -95,7 +95,7 @@ public class UnpublishAppServiceResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java index cb461a563..01aad979c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class UnregisterAppInterfaceResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java index afdedbdd0..3cf7d6491 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java @@ -17,7 +17,7 @@ import java.util.Hashtable; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** @@ -62,7 +62,7 @@ public class UnsubscribeButtonResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java index a317fdc83..b79ddc4cf 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java @@ -25,7 +25,7 @@ import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -67,6 +67,7 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { msg.setFuelRange(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal())); msg.setTurnSignal(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal())); msg.setElectronicParkBrakeStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal())); + msg.setWindowStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WINDOWSTATUS.ordinal())); msg.setHandsOffSteering(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING.ordinal())); msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA); @@ -122,6 +123,7 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { result.put(SubscribeVehicleDataResponse.KEY_TURN_SIGNAL, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()).serializeJSON()); result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON()); result.put(SubscribeVehicleDataResponse.KEY_HANDS_OFF_STEERING, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_WINDOW_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WINDOWSTATUS.ordinal()).serializeJSON()); result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA.serializeJSON()); } catch (JSONException e) { fail(TestValues.JSON_FAIL); @@ -165,6 +167,7 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { VehicleDataResult testTurnSignal = ( (UnsubscribeVehicleDataResponse) msg ).getTurnSignal(); VehicleDataResult testEBrakeStatus = ( (UnsubscribeVehicleDataResponse) msg ).getElectronicParkBrakeStatus(); VehicleDataResult testHOffSteering = ( (UnsubscribeVehicleDataResponse) msg ).getHandsOffSteering(); + VehicleDataResult testWindowStatus = ( (UnsubscribeVehicleDataResponse) msg ).getWindowStatus(); VehicleDataResult testOemCustomData = ( (UnsubscribeVehicleDataResponse) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); // Valid Tests @@ -197,6 +200,7 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { assertTrue(TestValues.TRUE, testTurnSignal.getDataType().equals(VehicleDataType.VEHICLEDATA_TURNSIGNAL)); assertTrue(TestValues.TRUE, testEBrakeStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS)); assertTrue(TestValues.TRUE, testHOffSteering.getDataType().equals(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING)); + assertTrue(TestValues.TRUE, testWindowStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_WINDOWSTATUS)); assertTrue(TestValues.TRUE, testOemCustomData.getOEMCustomVehicleDataType().equals(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); // Invalid/Null Tests @@ -233,6 +237,7 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { assertNull(TestValues.NULL, msg.getTurnSignal()); assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus()); assertNull(TestValues.NULL, msg.getHandsOffSteering()); + assertNull(TestValues.NULL, msg.getWindowStatus()); assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -241,7 +246,7 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { @@ -373,6 +378,10 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { VehicleDataResult referenceHandsOffSteering = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(handsOffSteering)); assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceHandsOffSteering, cmd.getHandsOffSteering())); + JSONObject windowStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_WINDOW_STATUS); + VehicleDataResult referenceWindowStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(windowStatus)); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceWindowStatus, cmd.getWindowStatus())); + JSONObject oemCustomData = JsonUtils.readJsonObjectFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); VehicleDataResult referenceOemCustomData = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(oemCustomData)); assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceOemCustomData, cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME))); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java index 49017109a..5360c023c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -59,7 +59,7 @@ public class UnsubscribeWayPointsResponseTests extends BaseRpcTests{ */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java index 603565803..47951d34c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java @@ -14,7 +14,7 @@ import org.json.JSONObject; import org.junit.Test; import java.util.Hashtable; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -60,7 +60,7 @@ public class UpdateTurnListResponseTests extends BaseRpcTests { */ @Test public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getTargetContext(), getCommandType(), getMessageType()); + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getTargetContext(), getCommandType(), getMessageType()); assertNotNull(TestValues.NOT_NULL, commandJson); try { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java index 685b8cbf5..aeb73e3de 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java @@ -1,17 +1,13 @@ package com.smartdevicelink.test.security; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; -import com.smartdevicelink.SdlConnection.ISdlConnectionListener; import com.smartdevicelink.SdlConnection.SdlSession; -import com.smartdevicelink.protocol.ProtocolMessage; import com.smartdevicelink.protocol.enums.SessionType; import com.smartdevicelink.security.SdlSecurityBase; import com.smartdevicelink.test.TestValues; -import com.smartdevicelink.transport.BTTransportConfig; -import com.smartdevicelink.transport.BaseTransportConfig; +import com.smartdevicelink.test.streaming.MockInterfaceBroker; import com.smartdevicelink.transport.MultiplexTransportConfig; -import com.smartdevicelink.transport.TCPTransportConfig; import org.junit.Test; import org.junit.runner.RunWith; @@ -19,7 +15,7 @@ import org.junit.runner.RunWith; import java.util.ArrayList; import java.util.List; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; @@ -61,65 +57,6 @@ public class SdlSecurityBaseTest { startServiceList = list; } } - - class MockInterfaceBroker implements ISdlConnectionListener { - public MockInterfaceBroker () { } - @Override - public void onTransportDisconnected(String info) { - - } - - @Override - public void onTransportDisconnected(String info, boolean availablePrimary, BaseTransportConfig transportConfig) { - - } - - @Override - public void onTransportError(String info, Exception e) { - - } - @Override - public void onProtocolMessageReceived(ProtocolMessage msg) { - - } - @Override - public void onProtocolSessionStartedNACKed(SessionType sessionType, - byte sessionID, byte version, String correlationID, List<String> rejectedParams) { - - } - @Override - public void onProtocolSessionStarted(SessionType sessionType, - byte sessionID, byte version, String correlationID, int hashID, - boolean isEncrypted) { - - } - @Override - public void onProtocolSessionEnded(SessionType sessionType, byte sessionID, - String correlationID) { - - } - @Override - public void onProtocolSessionEndedNACKed(SessionType sessionType, - byte sessionID, String correlationID) { - - } - @Override - public void onProtocolError(String info, Exception e) { - - } - @Override - public void onHeartbeatTimedOut(byte sessionID) { - - } - @Override - public void onProtocolServiceDataACK(SessionType sessionType, int dataSize, - byte sessionID) { - - } - @Override - public void onAuthTokenReceived(String token, byte bytes){} - - } @Test public void testMakeListSetAndGet(){ @@ -142,7 +79,7 @@ public class SdlSecurityBaseTest { byte testWiproVersion = (byte) 0x0B; boolean testInitResult = true; MockInterfaceBroker interfaceBroker = new MockInterfaceBroker(); - MultiplexTransportConfig transportConfig = new MultiplexTransportConfig(getTargetContext(),"19216801"); + MultiplexTransportConfig transportConfig = new MultiplexTransportConfig(getInstrumentation().getTargetContext(),"19216801"); MockSdlSecurityBase mockSdlSecurityBase = new MockSdlSecurityBase(); SdlSession testSdlSession = new SdlSession(interfaceBroker, transportConfig); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java index f487ac927..e5e47f3a5 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java @@ -17,7 +17,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -46,7 +46,7 @@ public class AbstractPacketizerTests extends TestCase { try { testInputStream = new BufferedInputStream(new ByteArrayInputStream("sdl streaming test".getBytes())); MockInterfaceBroker interfaceBroker = new MockInterfaceBroker(); - MultiplexTransportConfig transportConfig = new MultiplexTransportConfig(getTargetContext(),"19216801"); + MultiplexTransportConfig transportConfig = new MultiplexTransportConfig(getInstrumentation().getTargetContext(),"19216801"); testSdlSession = new SdlSession(interfaceBroker, transportConfig); testPacketizer1 = new MockPacketizer(testListener, testInputStream, testSessionType, testSessionId, testSdlSession); testPacketizer2 = new MockPacketizer(null, null, null, testSessionId, testSdlSession); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockInterfaceBroker.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockInterfaceBroker.java index f3bcc38ee..1c7005012 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockInterfaceBroker.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockInterfaceBroker.java @@ -1,22 +1,16 @@ package com.smartdevicelink.test.streaming; -import com.smartdevicelink.SdlConnection.ISdlConnectionListener; -import com.smartdevicelink.protocol.ProtocolMessage; -import com.smartdevicelink.protocol.enums.SessionType; +import com.smartdevicelink.SdlConnection.ISdlSessionListener; +import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.transport.BaseTransportConfig; - -import java.util.List; +import com.smartdevicelink.util.Version; /** * This is a mock class for testing the following : * {@link com.smartdevicelink.streaming.AbstractPacketizer} */ -public class MockInterfaceBroker implements ISdlConnectionListener { +public class MockInterfaceBroker implements ISdlSessionListener { public MockInterfaceBroker () { } - @Override - public void onTransportDisconnected(String info) { - - } @Override public void onTransportDisconnected(String info, boolean availablePrimary, BaseTransportConfig transportConfig) { @@ -24,47 +18,22 @@ public class MockInterfaceBroker implements ISdlConnectionListener { } @Override - public void onTransportError(String info, Exception e) { + public void onRPCMessageReceived(RPCMessage rpcMessage) { } - @Override - public void onProtocolMessageReceived(ProtocolMessage msg) { - } @Override - public void onProtocolSessionStartedNACKed(SessionType sessionType, - byte sessionID, byte version, String correlationID, List<String> rejectedParams) { + public void onSessionStarted(int sessionID, Version version) { } - @Override - public void onProtocolSessionStarted(SessionType sessionType, - byte sessionID, byte version, String correlationID, int hashID, - boolean isEncrypted) { - } @Override - public void onProtocolSessionEnded(SessionType sessionType, byte sessionID, - String correlationID) { + public void onSessionEnded(int sessionID) { } - @Override - public void onProtocolSessionEndedNACKed(SessionType sessionType, - byte sessionID, String correlationID) { - } - @Override - public void onProtocolError(String info, Exception e) { - - } @Override - public void onHeartbeatTimedOut(byte sessionID) { + public void onAuthTokenReceived(String authToken, int sessionID) { } - @Override - public void onProtocolServiceDataACK(SessionType sessionType, int dataSize, - byte sessionID) { - - } - @Override - public void onAuthTokenReceived(String token, byte bytes){} } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java index fdfcce8cf..736798d67 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java @@ -21,7 +21,7 @@ import java.io.InputStream; import java.nio.ByteBuffer; import java.util.Arrays; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -131,7 +131,7 @@ public class StreamPacketizerTests extends TestCase { byte testWiproVersion = (byte) 0x0B; IStreamListener testListener = new MockStreamListener(); MockInterfaceBroker interfaceBroker = new MockInterfaceBroker(); - MultiplexTransportConfig transportConfig = new MultiplexTransportConfig(getTargetContext(),"19216801"); + MultiplexTransportConfig transportConfig = new MultiplexTransportConfig(getInstrumentation().getTargetContext(),"19216801"); SdlSession testSdlSession = new SdlSession(interfaceBroker, transportConfig); try { testInputStream = new BufferedInputStream(new ByteArrayInputStream("sdl streaming test".getBytes())); @@ -414,7 +414,7 @@ public class StreamPacketizerTests extends TestCase { private SdlSession createTestSession() { - return new SdlSession(new MockInterfaceBroker(), new MultiplexTransportConfig(getTargetContext(),"19216801")); + return new SdlSession(new MockInterfaceBroker(), new MultiplexTransportConfig(getInstrumentation().getTargetContext(),"19216801")); } private class StreamReceiver implements IStreamListener { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java index 638d3f636..561cc1ef7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java @@ -18,7 +18,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This is a unit test class for the SmartDeviceLink library project class : @@ -41,7 +41,7 @@ public class StreamRPCPacketizerTests extends TestCase { IStreamListener testListener = new MockStreamListener(); MockInterfaceBroker interfaceBroker = new MockInterfaceBroker(); - MultiplexTransportConfig transportConfig = new MultiplexTransportConfig(getTargetContext(),"19216801"); + MultiplexTransportConfig transportConfig = new MultiplexTransportConfig(getInstrumentation().getTargetContext(),"19216801"); SdlSession testSdlSession = new SdlSession(interfaceBroker, transportConfig); try { testInputStream = new BufferedInputStream(new ByteArrayInputStream("sdl streaming test".getBytes())); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/RTPH264PacketizerTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/RTPH264PacketizerTest.java index b2b863490..60fa6fb80 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/RTPH264PacketizerTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/RTPH264PacketizerTest.java @@ -31,7 +31,7 @@ package com.smartdevicelink.test.streaming.video; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.SdlConnection.SdlSession; import com.smartdevicelink.protocol.ProtocolMessage; @@ -52,7 +52,7 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; /** * This class includes a unit test for {@link RTPH264Packetizer}. @@ -551,7 +551,7 @@ public class RTPH264PacketizerTest extends TestCase { } private SdlSession createTestSession() { - return new SdlSession(new MockInterfaceBroker(), new MultiplexTransportConfig(getTargetContext(), "41146")); + return new SdlSession(new MockInterfaceBroker(), new MultiplexTransportConfig(getInstrumentation().getTargetContext(), "41146")); } private class StreamVerifier implements IStreamListener { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/SdlRemoteDisplayTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/SdlRemoteDisplayTest.java index 453239bca..e5b07930e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/SdlRemoteDisplayTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/SdlRemoteDisplayTest.java @@ -4,7 +4,7 @@ import android.annotation.TargetApi; import android.content.Context; import android.os.Bundle; import android.os.Looper; -import android.support.test.InstrumentationRegistry; +import androidx.test.platform.app.InstrumentationRegistry; import android.view.Display; import android.view.MotionEvent; import android.widget.RelativeLayout; @@ -37,7 +37,7 @@ public class SdlRemoteDisplayTest extends TestCase { assertNotNull(encoder); - SdlRemoteDisplay.Creator creator = new SdlRemoteDisplay.Creator(InstrumentationRegistry.getContext(), encoder.getVirtualDisplay(), null, MockRemoteDisplay.class, rdCallback); + SdlRemoteDisplay.Creator creator = new SdlRemoteDisplay.Creator(InstrumentationRegistry.getInstrumentation().getContext(), encoder.getVirtualDisplay(), null, MockRemoteDisplay.class, rdCallback); assertNotNull(creator); FutureTask<Boolean> fTask = new FutureTask<Boolean>(creator); Thread showPresentation = new Thread(fTask); @@ -48,7 +48,7 @@ public class SdlRemoteDisplayTest extends TestCase { public void testConstructor(){ VirtualDisplayEncoder encoder = createVDE(); assertNotNull(encoder); - MockRemoteDisplay remoteDisplay = new MockRemoteDisplay(InstrumentationRegistry.getContext(), encoder.getVirtualDisplay()); + MockRemoteDisplay remoteDisplay = new MockRemoteDisplay(InstrumentationRegistry.getInstrumentation().getContext(), encoder.getVirtualDisplay()); assertNotNull(remoteDisplay); encoder.shutDown(); @@ -59,7 +59,7 @@ public class SdlRemoteDisplayTest extends TestCase { public void testTouchEvents(){ VirtualDisplayEncoder encoder = createVDE(); assertNotNull(encoder); - MockRemoteDisplay remoteDisplay = new MockRemoteDisplay(InstrumentationRegistry.getContext(), encoder.getVirtualDisplay()); + MockRemoteDisplay remoteDisplay = new MockRemoteDisplay(InstrumentationRegistry.getInstrumentation().getContext(), encoder.getVirtualDisplay()); assertNotNull(remoteDisplay); remoteDisplay.show(); @@ -79,7 +79,7 @@ public class SdlRemoteDisplayTest extends TestCase { public VirtualDisplayEncoder createVDE(){ try{ VirtualDisplayEncoder displayEncoder = new VirtualDisplayEncoder(); - displayEncoder.init(InstrumentationRegistry.getContext(), new MockVideoStreamListener(), new VideoStreamingParameters()); + displayEncoder.init(InstrumentationRegistry.getInstrumentation().getContext(), new MockVideoStreamListener(), new VideoStreamingParameters()); displayEncoder.start(); return displayEncoder; }catch (Exception e ){ diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/VideoStreamingParametersTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/VideoStreamingParametersTest.java index 8aa8ac5e8..5867fee7f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/VideoStreamingParametersTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/VideoStreamingParametersTest.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.streaming.video; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.proxy.rpc.ImageResolution; import com.smartdevicelink.proxy.rpc.VideoStreamingCapability; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexTransportConfigTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexTransportConfigTests.java index 8fae50a8b..53fe30114 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexTransportConfigTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexTransportConfigTests.java @@ -1,13 +1,13 @@ package com.smartdevicelink.test.transport; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.transport.MultiplexTransportConfig; import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; @RunWith(AndroidJUnit4.class) @@ -15,16 +15,16 @@ public class MultiplexTransportConfigTests { @Test public void testDefaultSecurity(){ - MultiplexTransportConfig config = new MultiplexTransportConfig(getTargetContext(), "2341"); + MultiplexTransportConfig config = new MultiplexTransportConfig(getInstrumentation().getTargetContext(), "2341"); assertEquals(config.getSecurityLevel(), MultiplexTransportConfig.FLAG_MULTI_SECURITY_MED); } @Test public void testSettingSecurity(){ - MultiplexTransportConfig config = new MultiplexTransportConfig(getTargetContext(), "2341", MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH); + MultiplexTransportConfig config = new MultiplexTransportConfig(getInstrumentation().getTargetContext(), "2341", MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH); assertEquals(config.getSecurityLevel(), MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH); - config = new MultiplexTransportConfig(getTargetContext(), "2341"); + config = new MultiplexTransportConfig(getInstrumentation().getTargetContext(), "2341"); config.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH); assertEquals(config.getSecurityLevel(), MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/CompareUtilsTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/CompareUtilsTest.java index 17929e909..044d22f2d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/CompareUtilsTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/CompareUtilsTest.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.util; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.test.TestValues; import com.smartdevicelink.util.CompareUtils; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlAppInfoTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlAppInfoTests.java index c1cf90e8c..35ad87cce 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlAppInfoTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlAppInfoTests.java @@ -38,7 +38,7 @@ import android.content.pm.PackageInfo; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.os.Bundle; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.R; import com.smartdevicelink.util.SdlAppInfo; @@ -50,7 +50,7 @@ import org.junit.runner.RunWith; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertFalse; import static junit.framework.TestCase.assertNotNull; @@ -70,7 +70,7 @@ public class SdlAppInfoTests { @Before public void setUp() throws Exception { - context = getContext(); + context = getInstrumentation().getContext(); defaultResolveInfo = createResolveInfo(context.getResources().getInteger(R.integer.sdl_router_service_version_value), "com.smartdevicelink.test", "com.smartdevicelink.test.SdlRouterService",false); defaultServiceInfo = defaultResolveInfo.serviceInfo; defaultBundle = defaultServiceInfo.metaData; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/VersionTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/VersionTest.java index 9f462e3f4..2dab00ccd 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/VersionTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/VersionTest.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.util; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.util.Version; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AndroidToolsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AndroidToolsTests.java index 8b0389dbb..601895b1c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AndroidToolsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AndroidToolsTests.java @@ -1,7 +1,7 @@ package com.smartdevicelink.test.utl; import android.content.ComponentName; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.util.AndroidTools; @@ -10,7 +10,7 @@ import junit.framework.Assert; import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; @RunWith(AndroidJUnit4.class) public class AndroidToolsTests { @@ -19,7 +19,7 @@ public class AndroidToolsTests { public void testIsServiceExportedNormal(){ try{ - AndroidTools.isServiceExported(getTargetContext(), new ComponentName(getTargetContext(), "test")); + AndroidTools.isServiceExported(getInstrumentation().getTargetContext(), new ComponentName(getInstrumentation().getTargetContext(), "test")); }catch(Exception e){ Assert.fail("Exception during normal test: " + e.getMessage()); } @@ -29,7 +29,7 @@ public class AndroidToolsTests { public void testIsServiceExportedNull(){ try{ - AndroidTools.isServiceExported(getTargetContext(), null); + AndroidTools.isServiceExported(getInstrumentation().getTargetContext(), null); Assert.fail("Proccessed null data"); }catch(Exception e){ diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java index e6b3d4341..e3070cd70 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java @@ -3,12 +3,12 @@ package com.smartdevicelink.transport; import android.content.ComponentName; import android.content.Intent; import android.os.Parcel; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -26,7 +26,7 @@ public class LocalRouterServiceTests { p.writeInt(4); p.writeLong(System.currentTimeMillis()); p.writeParcelable(new Intent(), 0); - p.writeParcelable(new ComponentName(getContext(), "test"), 0); + p.writeParcelable(new ComponentName(getInstrumentation().getContext(), "test"), 0); p.setDataPosition(0); SdlRouterService.LocalRouterService local = new SdlRouterService.LocalRouterService(p); @@ -43,7 +43,7 @@ public class LocalRouterServiceTests { p.writeInt(4); p.writeLong(System.currentTimeMillis()); p.writeParcelable(new Intent(), 0); - p.writeParcelable(new ComponentName(getContext(), "test"), 0); + p.writeParcelable(new ComponentName(getInstrumentation().getContext(), "test"), 0); p.setDataPosition(0); SdlRouterService.LocalRouterService local = SdlRouterService.LocalRouterService.CREATOR.createFromParcel(p); @@ -66,7 +66,7 @@ public class LocalRouterServiceTests { Parcel p = Parcel.obtain(); p.writeInt(4); p.writeLong(System.currentTimeMillis()); - p.writeParcelable(new ComponentName(getContext(), "test"), 0); + p.writeParcelable(new ComponentName(getInstrumentation().getContext(), "test"), 0); p.writeParcelable(new Intent(), 0); p.setDataPosition(0); @@ -117,7 +117,7 @@ public class LocalRouterServiceTests { p.writeLong(System.currentTimeMillis()); int space = p.dataSize(); p.writeParcelable(new Intent(), 0); - p.writeParcelable(new ComponentName(getContext(), "test"), 0); + p.writeParcelable(new ComponentName(getInstrumentation().getContext(), "test"), 0); p.setDataPosition(0); byte[] raw = p.marshall(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java index a67e9dff7..6f4f0231b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java @@ -4,7 +4,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.protocol.SdlPacket; @@ -12,7 +12,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertTrue; @@ -26,7 +26,7 @@ public class MultiplexTransportTest { @Before public void setUp() throws Exception { - rsvp = new RouterServiceValidator(getTargetContext()); + rsvp = new RouterServiceValidator(getInstrumentation().getTargetContext()); rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_NONE); rsvp.validate(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java index 8302ec53c..91aea6432 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java @@ -5,7 +5,7 @@ import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.os.ConditionVariable; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import com.smartdevicelink.transport.RouterServiceValidator.TrustedAppStore; @@ -26,7 +26,7 @@ import java.lang.reflect.Method; import java.util.List; import java.util.concurrent.Semaphore; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertFalse; import static junit.framework.TestCase.assertNotNull; @@ -52,7 +52,7 @@ public class RSVTestCase { @Before public void setUp() throws Exception { - rsvp = new RouterServiceValidator(getTargetContext()); + rsvp = new RouterServiceValidator(getInstrumentation().getTargetContext()); } @@ -125,7 +125,7 @@ public class RSVTestCase { @Test public void testSecuritySetting(){ - RouterServiceValidator rsvp = new RouterServiceValidator(getTargetContext()); //Use a locally scoped instance + RouterServiceValidator rsvp = new RouterServiceValidator(getInstrumentation().getTargetContext()); //Use a locally scoped instance rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH); try{ @@ -137,14 +137,14 @@ public class RSVTestCase { }catch( IllegalAccessException e2){ fail(e2.getMessage()); } - assertEquals(RouterServiceValidator.getSecurityLevel(getTargetContext()), MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH); + assertEquals(RouterServiceValidator.getSecurityLevel(getInstrumentation().getTargetContext()), MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH); } @Test public void testHighSecurity(){ requestTListLock(); - RouterServiceValidator rsvp = new RouterServiceValidator(getTargetContext()); //Use a locally scoped instance + RouterServiceValidator rsvp = new RouterServiceValidator(getInstrumentation().getTargetContext()); //Use a locally scoped instance rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH); rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK); @@ -152,7 +152,7 @@ public class RSVTestCase { assertEquals(RouterServiceValidator.getRefreshRate(), REFRESH_TRUSTED_APP_LIST_TIME_WEEK); - assertTrue(RouterServiceValidator.createTrustedListRequest(getTargetContext(), true, null, trustedListCallback)); + assertTrue(RouterServiceValidator.createTrustedListRequest(getInstrumentation().getTargetContext(), true, null, trustedListCallback)); } @@ -160,7 +160,7 @@ public class RSVTestCase { public void testMediumSecurity(){ requestTListLock(); - RouterServiceValidator rsvp = new RouterServiceValidator(getTargetContext()); //Use a locally scoped instance + RouterServiceValidator rsvp = new RouterServiceValidator(getInstrumentation().getTargetContext()); //Use a locally scoped instance rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_MED); rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK); @@ -168,7 +168,7 @@ public class RSVTestCase { assertEquals(RouterServiceValidator.getRefreshRate(), REFRESH_TRUSTED_APP_LIST_TIME_WEEK); - assertTrue(RouterServiceValidator.createTrustedListRequest(getTargetContext(), true, null, trustedListCallback)); + assertTrue(RouterServiceValidator.createTrustedListRequest(getInstrumentation().getTargetContext(), true, null, trustedListCallback)); } @@ -176,7 +176,7 @@ public class RSVTestCase { public void testLowSecurity(){ requestTListLock(); - RouterServiceValidator rsvp = new RouterServiceValidator(getTargetContext()); //Use a locally scoped instance + RouterServiceValidator rsvp = new RouterServiceValidator(getInstrumentation().getTargetContext()); //Use a locally scoped instance rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_LOW); rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK); @@ -184,7 +184,7 @@ public class RSVTestCase { assertEquals(RouterServiceValidator.getRefreshRate(), REFRESH_TRUSTED_APP_LIST_TIME_MONTH); - assertTrue(RouterServiceValidator.createTrustedListRequest(getTargetContext(), true, null, trustedListCallback)); + assertTrue(RouterServiceValidator.createTrustedListRequest(getInstrumentation().getTargetContext(), true, null, trustedListCallback)); } @@ -192,7 +192,7 @@ public class RSVTestCase { public void testNoSecurity(){ requestTListLock(); - RouterServiceValidator rsvp = new RouterServiceValidator(getTargetContext()); //Use a locally scoped instance + RouterServiceValidator rsvp = new RouterServiceValidator(getInstrumentation().getTargetContext()); //Use a locally scoped instance rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF); rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK); @@ -200,7 +200,7 @@ public class RSVTestCase { assertEquals(RouterServiceValidator.getRefreshRate(), REFRESH_TRUSTED_APP_LIST_TIME_WEEK); - assertFalse(RouterServiceValidator.createTrustedListRequest(getTargetContext(), true, null, trustedListCallback)); + assertFalse(RouterServiceValidator.createTrustedListRequest(getInstrumentation().getTargetContext(), true, null, trustedListCallback)); //This should always return true assertTrue(rsvp.validate()); @@ -237,7 +237,7 @@ public class RSVTestCase { requestTListLock(); assertFalse(RouterServiceValidator.invalidateList(null)); - assertTrue(RouterServiceValidator.invalidateList(getTargetContext())); + assertTrue(RouterServiceValidator.invalidateList(getInstrumentation().getTargetContext())); releaseTListLock(); } @@ -247,7 +247,7 @@ public class RSVTestCase { requestTListLock(); assertNull(RouterServiceValidator.getTrustedList(null)); - assertNotNull(RouterServiceValidator.getTrustedList(getTargetContext())); + assertNotNull(RouterServiceValidator.getTrustedList(getInstrumentation().getTargetContext())); releaseTListLock(); } @@ -257,16 +257,16 @@ public class RSVTestCase { requestTListLock(); assertFalse(RouterServiceValidator.setTrustedList(null,null)); - assertFalse(RouterServiceValidator.setTrustedList(getTargetContext(),null)); + assertFalse(RouterServiceValidator.setTrustedList(getInstrumentation().getTargetContext(),null)); assertFalse(RouterServiceValidator.setTrustedList(null,"test")); - assertTrue(RouterServiceValidator.setTrustedList(getTargetContext(),"test")); - assertTrue(RouterServiceValidator.setTrustedList(getTargetContext(),TEST)); - assertTrue(RouterServiceValidator.setTrustedList(getTargetContext(),TEST+TEST+TEST+TEST+TEST)); + assertTrue(RouterServiceValidator.setTrustedList(getInstrumentation().getTargetContext(),"test")); + assertTrue(RouterServiceValidator.setTrustedList(getInstrumentation().getTargetContext(),TEST)); + assertTrue(RouterServiceValidator.setTrustedList(getInstrumentation().getTargetContext(),TEST+TEST+TEST+TEST+TEST)); StringBuilder builder = new StringBuilder(); for(int i = 0; i<1000; i++){ builder.append(TEST); } - assertTrue(RouterServiceValidator.setTrustedList(getTargetContext(),builder.toString())); + assertTrue(RouterServiceValidator.setTrustedList(getInstrumentation().getTargetContext(),builder.toString())); releaseTListLock(); } @@ -275,8 +275,8 @@ public class RSVTestCase { public void testTrustedListSetAndGet(){ requestTListLock(); - assertTrue(RouterServiceValidator.setTrustedList(getTargetContext(),TEST)); - String retVal = RouterServiceValidator.getTrustedList(getTargetContext()); + assertTrue(RouterServiceValidator.setTrustedList(getInstrumentation().getTargetContext(),TEST)); + String retVal = RouterServiceValidator.getTrustedList(getInstrumentation().getTargetContext()); assertNotNull(retVal); assertTrue(TEST.equals(retVal)); @@ -284,8 +284,8 @@ public class RSVTestCase { for(int i = 0; i<1000; i++){ builder.append(TEST); } - assertTrue(RouterServiceValidator.setTrustedList(getTargetContext(),builder.toString())); - retVal = RouterServiceValidator.getTrustedList(getTargetContext()); + assertTrue(RouterServiceValidator.setTrustedList(getInstrumentation().getTargetContext(),builder.toString())); + retVal = RouterServiceValidator.getTrustedList(getInstrumentation().getTargetContext()); assertNotNull(retVal); assertTrue(builder.toString().equals(retVal)); @@ -296,8 +296,8 @@ public class RSVTestCase { public void testInvalidationSequence(){ requestTListLock(); - assertTrue(RouterServiceValidator.invalidateList(getTargetContext())); - assertTrue(RouterServiceValidator.createTrustedListRequest(getTargetContext(), false, null, trustedListCallback)); + assertTrue(RouterServiceValidator.invalidateList(getInstrumentation().getTargetContext())); + assertTrue(RouterServiceValidator.createTrustedListRequest(getInstrumentation().getTargetContext(), false, null, trustedListCallback)); } @Test @@ -307,11 +307,11 @@ public class RSVTestCase { assertFalse(TrustedAppStore.isTrustedStore("test")); assertFalse(TrustedAppStore.isTrustedStore(null)); - rsvp = new RouterServiceValidator(getTargetContext()); + rsvp = new RouterServiceValidator(getInstrumentation().getTargetContext()); rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK); rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH); - PackageManager packageManager = getTargetContext().getPackageManager(); + PackageManager packageManager = getInstrumentation().getTargetContext().getPackageManager(); List<PackageInfo> packages = packageManager.getInstalledPackages(0); String appStore; for(PackageInfo info: packages){ @@ -326,7 +326,7 @@ public class RSVTestCase { @Test public void testVersionBlackList(){ - rsvp = new RouterServiceValidator(getTargetContext()); + rsvp = new RouterServiceValidator(getInstrumentation().getTargetContext()); JSONArray array = new JSONArray(); for(int i=0; i<25; i++){ if(i%3 == 0){ @@ -371,7 +371,7 @@ public class RSVTestCase { } }; - assertTrue(RouterServiceValidator.createTrustedListRequest(getTargetContext(),true, cb)); + assertTrue(RouterServiceValidator.createTrustedListRequest(getInstrumentation().getTargetContext(),true, cb)); //Now wait for call to finish synchronized(REQUEST_LOCK){ try { @@ -392,8 +392,8 @@ public class RSVTestCase { public void testRequestChange(){ requestTListLock(); - RouterServiceValidator.setLastRequest(getTargetContext(), null); - assertNull(RouterServiceValidator.getLastRequest(getTargetContext())); + RouterServiceValidator.setLastRequest(getInstrumentation().getTargetContext(), null); + assertNull(RouterServiceValidator.getLastRequest(getInstrumentation().getTargetContext())); JSONObject object = null; try { @@ -402,11 +402,11 @@ public class RSVTestCase { e.printStackTrace(); } assertNotNull(object); - assertFalse(object.equals(RouterServiceValidator.getLastRequest(getTargetContext()))); + assertFalse(object.equals(RouterServiceValidator.getLastRequest(getInstrumentation().getTargetContext()))); - assertTrue(RouterServiceValidator.setLastRequest(getTargetContext(), object.toString())); + assertTrue(RouterServiceValidator.setLastRequest(getInstrumentation().getTargetContext(), object.toString())); - String oldRequest = RouterServiceValidator.getLastRequest(getTargetContext()); + String oldRequest = RouterServiceValidator.getLastRequest(getInstrumentation().getTargetContext()); assertNotNull(oldRequest); assertTrue(object.toString().equals(oldRequest)); @@ -419,9 +419,9 @@ public class RSVTestCase { e.printStackTrace(); } assertNotNull(object); - assertFalse(object.equals(RouterServiceValidator.getLastRequest(getTargetContext()))); + assertFalse(object.equals(RouterServiceValidator.getLastRequest(getInstrumentation().getTargetContext()))); //Clear it for next test - RouterServiceValidator.setLastRequest(getTargetContext(), null); + RouterServiceValidator.setLastRequest(getInstrumentation().getTargetContext(), null); releaseTListLock(); } @@ -449,12 +449,12 @@ public class RSVTestCase { } // Fail, different package name for context and service and app security setting is not OFF and app is not on trusted list - RouterServiceValidatorTest rsvpFail = new RouterServiceValidatorTest(getTargetContext(), new ComponentName("anything", getTargetContext().getClass().getSimpleName())); + RouterServiceValidatorTest rsvpFail = new RouterServiceValidatorTest(getInstrumentation().getTargetContext(), new ComponentName("anything", getInstrumentation().getTargetContext().getClass().getSimpleName())); rsvpFail.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH); assertFalse(rsvpFail.validate()); // Success, same package name for context and service - RouterServiceValidatorTest rsvpPass = new RouterServiceValidatorTest(getTargetContext(), new ComponentName(getTargetContext().getPackageName(), getTargetContext().getClass().getSimpleName())); + RouterServiceValidatorTest rsvpPass = new RouterServiceValidatorTest(getInstrumentation().getTargetContext(), new ComponentName(getInstrumentation().getTargetContext().getPackageName(), getInstrumentation().getTargetContext().getClass().getSimpleName())); rsvpPass.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH); assertTrue(rsvpPass.validate()); } @@ -464,7 +464,7 @@ public class RSVTestCase { */ @Test public void testValidateAsync() { - final MultiplexTransportConfig config = new MultiplexTransportConfig(getTargetContext(), APP_ID, MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH); + final MultiplexTransportConfig config = new MultiplexTransportConfig(getInstrumentation().getTargetContext(), APP_ID, MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH); final RouterServiceValidator validator = new RouterServiceValidator(config); final ConditionVariable cond = new ConditionVariable(); validator.validateAsync(new RouterServiceValidator.ValidationStatusCallback() { @@ -478,7 +478,7 @@ public class RSVTestCase { cond.block(); // next, test for FLAG_MULTI_SECURITY_OFF - final MultiplexTransportConfig config2 = new MultiplexTransportConfig(getTargetContext(), APP_ID, MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF); + final MultiplexTransportConfig config2 = new MultiplexTransportConfig(getInstrumentation().getTargetContext(), APP_ID, MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF); final RouterServiceValidator validator2 = new RouterServiceValidator(config2); cond.close(); validator2.validateAsync(new RouterServiceValidator.ValidationStatusCallback() { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java index 2cf70d1be..f2164e498 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.transport; import android.os.Looper; import android.os.Messenger; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java index 5995b457f..5815911e7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java @@ -5,7 +5,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import android.util.Log; import android.util.SparseArray; import android.util.SparseIntArray; @@ -38,7 +38,7 @@ import java.util.HashMap; import java.util.List; import java.util.Vector; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; @@ -64,7 +64,7 @@ public class SdlRouterServiceTests { */ @Test public void testVersionCorrectness(){ - int resourceVersion = getContext().getResources().getInteger(com.smartdevicelink.test.R.integer.sdl_router_service_version_value); + int resourceVersion = getInstrumentation().getContext().getResources().getInteger(com.smartdevicelink.test.R.integer.sdl_router_service_version_value); assertEquals(resourceVersion, SdlRouterService.ROUTER_SERVICE_VERSION_NUMBER); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java index 332f3eda4..22837f77d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java @@ -5,7 +5,7 @@ import android.os.Handler; import android.os.Looper; import android.os.Message; import android.os.Messenger; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.test.SdlUnitTestContants; import com.smartdevicelink.test.util.DeviceUtil; @@ -14,7 +14,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertFalse; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertTrue; @@ -26,7 +26,7 @@ public class TransportBrokerTest { //FIXME this test class needs to be fixed. At @Before public void setUp() throws Exception { - rsvp = new RouterServiceValidator(getTargetContext()); + rsvp = new RouterServiceValidator(getInstrumentation().getTargetContext()); rsvp.validate(); } @@ -42,7 +42,7 @@ public class TransportBrokerTest { //FIXME this test class needs to be fixed. At if (Looper.myLooper() == null) { Looper.prepare(); } - TransportBroker broker = new TransportBroker(getTargetContext(), SdlUnitTestContants.TEST_APP_ID,rsvp.getService()); + TransportBroker broker = new TransportBroker(getInstrumentation().getTargetContext(), SdlUnitTestContants.TEST_APP_ID,rsvp.getService()); if(!DeviceUtil.isEmulator()){ // Cannot perform MBT operations in emulator assertTrue(broker.start()); } @@ -56,7 +56,7 @@ public class TransportBrokerTest { //FIXME this test class needs to be fixed. At Looper.prepare(); } - TransportBroker broker = new TransportBroker(getTargetContext(), SdlUnitTestContants.TEST_APP_ID,rsvp.getService()); + TransportBroker broker = new TransportBroker(getInstrumentation().getTargetContext(), SdlUnitTestContants.TEST_APP_ID,rsvp.getService()); if(!DeviceUtil.isEmulator()){ // Cannot perform MBT operations in emulator assertTrue(broker.start()); @@ -90,7 +90,7 @@ public class TransportBrokerTest { //FIXME this test class needs to be fixed. At if (Looper.myLooper() == null) { Looper.prepare(); } - TransportBroker broker = new TransportBroker(getTargetContext(), SdlUnitTestContants.TEST_APP_ID, rsvp.getService()); + TransportBroker broker = new TransportBroker(getInstrumentation().getTargetContext(), SdlUnitTestContants.TEST_APP_ID, rsvp.getService()); if(!DeviceUtil.isEmulator()){ // Cannot perform MBT operations in emulator assertTrue(broker.start()); } @@ -103,7 +103,7 @@ public class TransportBrokerTest { //FIXME this test class needs to be fixed. At Looper.prepare(); } - TransportBroker broker = new TransportBroker(getTargetContext(), SdlUnitTestContants.TEST_APP_ID, rsvp.getService()); + TransportBroker broker = new TransportBroker(getInstrumentation().getTargetContext(), SdlUnitTestContants.TEST_APP_ID, rsvp.getService()); Handler handler = new Handler(); Message message = new Message(); broker.routerServiceMessenger = null; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java index 454a32633..b1d3263b2 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.transport; import android.content.ComponentName; import android.os.Looper; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.protocol.SdlPacket; import com.smartdevicelink.protocol.SdlPacketFactory; @@ -18,7 +18,7 @@ import org.junit.runner.RunWith; import java.util.Collections; import java.util.List; -import static android.support.test.InstrumentationRegistry.getContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertFalse; import static junit.framework.TestCase.assertNotNull; @@ -50,7 +50,7 @@ public class TransportManagerTests { @Before public void setUp() throws Exception { - config = new MultiplexTransportConfig(getContext(), SdlUnitTestContants.TEST_APP_ID); + config = new MultiplexTransportConfig(getInstrumentation().getContext(), SdlUnitTestContants.TEST_APP_ID); config.setService(routerServiceComponentName); if (Looper.myLooper() == null) { Looper.prepare(); @@ -66,7 +66,7 @@ public class TransportManagerTests { assertNull(manager.legacyBluetoothHandler); manager.exitLegacyMode("Test"); - manager.transport = manager.new TransportBrokerImpl(getContext(), config.appId, routerServiceComponentName); + manager.transport = manager.new TransportBrokerImpl(getInstrumentation().getContext(), config.appId, routerServiceComponentName); manager.start(); assert true; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/util/MediaStreamingStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/util/MediaStreamingStatusTests.java index 9a204df9b..5f7f06f59 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/util/MediaStreamingStatusTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/util/MediaStreamingStatusTests.java @@ -4,7 +4,7 @@ import android.content.Context; import android.media.AudioDeviceInfo; import android.media.AudioManager; import android.os.Build; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.managers.SdlManager; import com.smartdevicelink.managers.SdlManagerListener; @@ -21,7 +21,7 @@ import org.mockito.stubbing.Answer; import java.util.Vector; -import static android.support.test.InstrumentationRegistry.getTargetContext; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static junit.framework.TestCase.assertFalse; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNull; @@ -106,11 +106,11 @@ public class MediaStreamingStatusTests { @Test public void testSdlManagerMedia(){ - SdlManager.Builder builder = new SdlManager.Builder(getTargetContext(), TestValues.GENERAL_FULL_APP_ID, TestValues.GENERAL_STRING, mock(SdlManagerListener.class)); + SdlManager.Builder builder = new SdlManager.Builder(getInstrumentation().getTargetContext(), TestValues.GENERAL_FULL_APP_ID, TestValues.GENERAL_STRING, mock(SdlManagerListener.class)); Vector<AppHMIType> appType = new Vector<>(); appType.add(AppHMIType.MEDIA); builder.setAppTypes(appType); - MultiplexTransportConfig multiplexTransportConfig = new MultiplexTransportConfig(getTargetContext(), TestValues.GENERAL_FULL_APP_ID); + MultiplexTransportConfig multiplexTransportConfig = new MultiplexTransportConfig(getInstrumentation().getTargetContext(), TestValues.GENERAL_FULL_APP_ID); assertNull(multiplexTransportConfig.requiresAudioSupport()); builder.setTransportType(multiplexTransportConfig); @@ -124,11 +124,11 @@ public class MediaStreamingStatusTests { @Test public void testSdlManagerNonMedia(){ - SdlManager.Builder builder = new SdlManager.Builder(getTargetContext(), TestValues.GENERAL_FULL_APP_ID, TestValues.GENERAL_STRING, mock(SdlManagerListener.class)); + SdlManager.Builder builder = new SdlManager.Builder(getInstrumentation().getTargetContext(), TestValues.GENERAL_FULL_APP_ID, TestValues.GENERAL_STRING, mock(SdlManagerListener.class)); Vector<AppHMIType> appType = new Vector<>(); appType.add(AppHMIType.DEFAULT); builder.setAppTypes(appType); - MultiplexTransportConfig multiplexTransportConfig = new MultiplexTransportConfig(getTargetContext(), TestValues.GENERAL_FULL_APP_ID); + MultiplexTransportConfig multiplexTransportConfig = new MultiplexTransportConfig(getInstrumentation().getTargetContext(), TestValues.GENERAL_FULL_APP_ID); assertNull(multiplexTransportConfig.requiresAudioSupport()); builder.setTransportType(multiplexTransportConfig); @@ -142,7 +142,7 @@ public class MediaStreamingStatusTests { @Test public void testAcceptedBTDevices(){ - MediaStreamingStatus mediaStreamingStatus = spy(new MediaStreamingStatus(getTargetContext(), mock(MediaStreamingStatus.Callback.class))); + MediaStreamingStatus mediaStreamingStatus = spy(new MediaStreamingStatus(getInstrumentation().getTargetContext(), mock(MediaStreamingStatus.Callback.class))); doAnswer(new Answer() { @Override @@ -157,7 +157,7 @@ public class MediaStreamingStatusTests { @Test public void testAcceptedUSBDevices(){ - MediaStreamingStatus mediaStreamingStatus = spy(new MediaStreamingStatus(getTargetContext(), mock(MediaStreamingStatus.Callback.class))); + MediaStreamingStatus mediaStreamingStatus = spy(new MediaStreamingStatus(getInstrumentation().getTargetContext(), mock(MediaStreamingStatus.Callback.class))); doAnswer(new Answer() { @Override diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java b/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java index 3c5c063c7..f4bdb7136 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java @@ -59,7 +59,6 @@ import com.smartdevicelink.util.Version; import java.io.IOException; import java.lang.ref.WeakReference; -import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; public class SdlSession extends BaseSdlSession { @@ -69,9 +68,8 @@ public class SdlSession extends BaseSdlSession { MediaStreamingStatus mediaStreamingStatus; boolean requiresAudioSupport = false; - public SdlSession(ISdlConnectionListener listener, MultiplexTransportConfig config) { + public SdlSession(ISdlSessionListener listener, MultiplexTransportConfig config) { super(listener, config); - this.transportConfig = config; if (config != null) { contextWeakReference = new WeakReference<>(config.getContext()); this.requiresAudioSupport = Boolean.TRUE.equals(config.requiresAudioSupport()); //handle null case @@ -81,9 +79,8 @@ public class SdlSession extends BaseSdlSession { } - public SdlSession(ISdlConnectionListener listener, TCPTransportConfig config) { + public SdlSession(ISdlSessionListener listener, TCPTransportConfig config) { super(listener, config); - this.transportConfig = config; this.sessionListener = listener; } @@ -155,88 +152,68 @@ public class SdlSession extends BaseSdlSession { /* *********************************************************************************************************************************************************************** - * ***************************************************************** IProtocol Listener ******************************************************************************** + * ***************************************************************** ISdlProtocol Listener ******************************************************************************** *************************************************************************************************************************************************************************/ @Override - public void onProtocolMessageBytesToSend(SdlPacket packet) { - sdlProtocol.sendPacket(packet); - } - - @Override - public void onProtocolSessionStarted(SessionType sessionType, - byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) { + public void onServiceStarted(SdlPacket packet, SessionType serviceType, int sessionID, Version version, boolean isEncrypted) { + DebugTool.logInfo(TAG, serviceType.getName() + " service started"); - DebugTool.logInfo(TAG, "Protocol session started"); - - this.sessionId = sessionID; - if (sessionType.eq(SessionType.RPC)) { - sessionHashId = hashID; + if (serviceType != null && serviceType.eq(SessionType.RPC) && this.sessionId == -1) { + this.sessionId = sessionID; + this.sessionListener.onSessionStarted(sessionID, version); } if (isEncrypted) { - encryptedServices.addIfAbsent(sessionType); + encryptedServices.addIfAbsent(serviceType); } - this.sessionListener.onProtocolSessionStarted(sessionType, sessionID, version, correlationID, hashID, isEncrypted); - if (serviceListeners != null && serviceListeners.containsKey(sessionType)) { - CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType); + if (serviceListeners != null && serviceListeners.containsKey(serviceType)) { + CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(serviceType); for (ISdlServiceListener listener : listeners) { - listener.onServiceStarted(this, sessionType, isEncrypted); + listener.onServiceStarted(this, serviceType, isEncrypted); } } - - } - - public void onProtocolSessionStartedNACKed(SessionType sessionType, byte sessionID, byte version, String correlationID, List<String> rejectedParams) { - onProtocolSessionNACKed(sessionType, sessionID, version, correlationID, rejectedParams); } @Override - public void onProtocolSessionNACKed(SessionType sessionType, byte sessionID, byte version, String correlationID, List<String> rejectedParams) { - this.sessionListener.onProtocolSessionStartedNACKed(sessionType, - sessionID, version, correlationID, rejectedParams); - if (serviceListeners != null && serviceListeners.containsKey(sessionType)) { - CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType); - if (listeners != null) { - for (ISdlServiceListener listener : listeners) { - listener.onServiceError(this, sessionType, "Start " + sessionType.toString() + " Service NAKed"); - } - } + public void onServiceEnded(SdlPacket packet, SessionType serviceType, int sessionID) { + + if (SessionType.RPC.equals(serviceType)) { + this.sessionListener.onSessionEnded(sessionID); + } else if (SessionType.NAV.equals(serviceType)) { + stopVideoStream(); + } else if (SessionType.PCM.equals(serviceType)) { + stopAudioStream(); } - } - @Override - public void onProtocolSessionEnded(SessionType sessionType, byte sessionID, - String correlationID) { - this.sessionListener.onProtocolSessionEnded(sessionType, sessionID, correlationID); - if (serviceListeners != null && serviceListeners.containsKey(sessionType)) { - CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType); + if (serviceListeners != null && serviceListeners.containsKey(serviceType)) { + CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(serviceType); for (ISdlServiceListener listener : listeners) { - listener.onServiceEnded(this, sessionType); + listener.onServiceEnded(this, serviceType); } } - encryptedServices.remove(sessionType); + encryptedServices.remove(serviceType); } @Override - public void onProtocolSessionEndedNACKed(SessionType sessionType, - byte sessionID, String correlationID) { - this.sessionListener.onProtocolSessionEndedNACKed(sessionType, sessionID, correlationID); - if (serviceListeners != null && serviceListeners.containsKey(sessionType)) { - CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType); + public void onServiceError(SdlPacket packet, SessionType serviceType, int sessionID, String error) { + if (SessionType.NAV.equals(serviceType)) { + stopVideoStream(); + } else if (SessionType.PCM.equals(serviceType)) { + stopAudioStream(); + } + + if (serviceListeners != null && serviceListeners.containsKey(serviceType)) { + CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(serviceType); for (ISdlServiceListener listener : listeners) { - listener.onServiceError(this, sessionType, "End " + sessionType.toString() + " Service NACK'ed"); + listener.onServiceError(this, serviceType, "End " + serviceType.toString() + " Service NACK'ed"); } } } - /* Not supported methods from IProtocolListener */ @Override - public void onHeartbeatTimedOut(byte sessionId) { /* Not supported */} - - @Override - public void onAuthTokenReceived(String authToken, byte sessionID) {/* Do nothing */ } + public void onAuthTokenReceived(String authToken) {/* Do nothing */ } /* *********************************************************************************************************************************************************************** * ***************************************************************** Fix after initial refactor ********************************************************************************* @@ -273,13 +250,13 @@ public class SdlSession extends BaseSdlSession { try { switch (protocol) { case RAW: { - videoPacketizer = new StreamPacketizer(streamListener, null, SessionType.NAV, this.sessionId, this); + videoPacketizer = new StreamPacketizer(streamListener, null, SessionType.NAV, (byte) this.sessionId, this); videoPacketizer.start(); return (IVideoStreamListener) videoPacketizer; } case RTP: { //FIXME why is this not an extension of StreamPacketizer? - videoPacketizer = new RTPH264Packetizer(streamListener, SessionType.NAV, this.sessionId, this); + videoPacketizer = new RTPH264Packetizer(streamListener, SessionType.NAV, (byte) this.sessionId, this); videoPacketizer.start(); return (IVideoStreamListener) videoPacketizer; } @@ -294,7 +271,7 @@ public class SdlSession extends BaseSdlSession { public IAudioStreamListener startAudioStream() { try { - audioPacketizer = new StreamPacketizer(streamListener, null, SessionType.PCM, this.sessionId, this); + audioPacketizer = new StreamPacketizer(streamListener, null, SessionType.PCM, (byte) this.sessionId, this); audioPacketizer.start(); return audioPacketizer; } catch (IOException e) { @@ -303,24 +280,6 @@ public class SdlSession extends BaseSdlSession { } - @Override - public void stopStream(SessionType serviceType) { - if (SessionType.NAV.equals(serviceType)) { - stopVideoStream(); - } else if (SessionType.PCM.equals(serviceType)) { - stopAudioStream(); - } - // Notify any listeners of the service being ended - if (serviceListeners != null && serviceListeners.containsKey(serviceType)) { - CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(serviceType); - if (listeners != null && listeners.size() > 0) { - for (ISdlServiceListener listener : listeners) { - listener.onServiceEnded(this, serviceType); - } - } - } - } - public boolean stopVideoStream() { if (videoPacketizer != null) { diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java index 2b0b25931..42dc6a165 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java @@ -36,8 +36,8 @@ import android.annotation.SuppressLint; import android.content.Context; import android.os.Handler; import android.os.Looper; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.smartdevicelink.managers.audio.AudioStreamManager; import com.smartdevicelink.managers.file.FileManager; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoder.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoder.java index cba0d212b..04fe41c97 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoder.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoder.java @@ -36,8 +36,8 @@ import android.media.MediaCodec; import android.media.MediaFormat;
import android.net.Uri;
import android.os.Build;
-import android.support.annotation.NonNull;
-import android.support.annotation.RequiresApi;
+import androidx.annotation.NonNull;
+import androidx.annotation.RequiresApi;
import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
import com.smartdevicelink.util.DebugTool;
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderCompat.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderCompat.java index fb5298a5c..ce2d3c49e 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderCompat.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderCompat.java @@ -35,7 +35,7 @@ import android.content.Context; import android.media.MediaCodec; import android.media.MediaFormat; import android.net.Uri; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType; import com.smartdevicelink.util.DebugTool; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java index 3e8c55772..2656b4b58 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java @@ -38,8 +38,8 @@ import android.net.Uri; import android.os.Build;
import android.os.Handler;
import android.os.Looper;
-import android.support.annotation.IntDef;
-import android.support.annotation.NonNull;
+import androidx.annotation.IntDef;
+import androidx.annotation.NonNull;
import com.smartdevicelink.SdlConnection.SdlSession;
import com.smartdevicelink.managers.CompletionListener;
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/BaseAudioDecoder.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/BaseAudioDecoder.java index 3831257a6..53e3d64f0 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/BaseAudioDecoder.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/BaseAudioDecoder.java @@ -38,7 +38,7 @@ import android.media.MediaExtractor; import android.media.MediaFormat;
import android.net.Uri;
import android.os.Build;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java index a29ce1536..bdd21ba45 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java @@ -35,7 +35,7 @@ package com.smartdevicelink.managers.file; import android.content.Context; import android.content.res.Resources; import android.net.Uri; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.file.filetypes.SdlFile; import com.smartdevicelink.proxy.interfaces.ISdl; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java index 5f14cb2ed..d0e46f7e5 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java @@ -33,7 +33,7 @@ package com.smartdevicelink.managers.file.filetypes; import android.net.Uri; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.proxy.rpc.enums.FileType; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java index 5d7e73f5c..ac8942dcb 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java @@ -33,7 +33,7 @@ package com.smartdevicelink.managers.file.filetypes; import android.net.Uri; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.rpc.enums.FileType; import com.smartdevicelink.proxy.rpc.enums.StaticIconName; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java index 99723b456..ae7a0886e 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.lifecycle; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.ServiceEncryptionListener; import com.smartdevicelink.protocol.enums.SessionType; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java index 49e25b242..73757292b 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java @@ -34,7 +34,7 @@ package com.smartdevicelink.managers.lifecycle; import android.app.Service; import android.content.Context; -import android.support.annotation.RestrictTo; +import androidx.annotation.RestrictTo; import com.smartdevicelink.SdlConnection.SdlSession; import com.smartdevicelink.exception.SdlException; @@ -93,9 +93,9 @@ public class LifecycleManager extends BaseLifecycleManager { } if (_transportConfig != null && _transportConfig.getTransportType().equals(TransportType.MULTIPLEX)) { - this.session = new SdlSession(sdlConnectionListener, (MultiplexTransportConfig) _transportConfig); + this.session = new SdlSession(sdlSessionListener, (MultiplexTransportConfig) _transportConfig); } else if (_transportConfig != null && _transportConfig.getTransportType().equals(TransportType.TCP)) { - this.session = new SdlSession(sdlConnectionListener, (TCPTransportConfig) _transportConfig); + this.session = new SdlSession(sdlSessionListener, (TCPTransportConfig) _transportConfig); } else { DebugTool.logError(TAG,"Unable to create session for transport type"); } @@ -141,15 +141,6 @@ public class LifecycleManager extends BaseLifecycleManager { } @Override - void onServiceStarted(SessionType sessionType) { - super.onServiceStarted(sessionType); - if (sessionType.eq(SessionType.NAV)) { - videoServiceStartResponseReceived = true; - videoServiceStartResponse = true; - } - } - - @Override void onTransportDisconnected(String info, boolean availablePrimary, BaseTransportConfig transportConfig) { super.onTransportDisconnected(info, availablePrimary, transportConfig); if (availablePrimary) { @@ -161,15 +152,6 @@ public class LifecycleManager extends BaseLifecycleManager { } } - @Override - void onStartServiceNACKed(SessionType sessionType) { - super.onStartServiceNACKed(sessionType); - if (sessionType.eq(SessionType.NAV)) { - videoServiceStartResponseReceived = true; - videoServiceStartResponse = false; - } - } - /** * This method will try to start the video service with the requested parameters. * When it returns it will attempt to store the accepted parameters if available. @@ -226,7 +208,7 @@ public class LifecycleManager extends BaseLifecycleManager { videoServiceStartResponse = false; addVideoServiceListener(); - session.startService(SessionType.NAV, session.getSessionId(), isEncrypted); + session.startService(SessionType.NAV, isEncrypted); } } @@ -289,7 +271,7 @@ public class LifecycleManager extends BaseLifecycleManager { DebugTool.logWarning(TAG, "Connection is not available."); return; } - session.startService(SessionType.PCM, session.getSessionId(), isEncrypted); + session.startService(SessionType.PCM, isEncrypted); } /** diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java index 6769db0fc..8fe3286ba 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.lockscreen; -import android.support.annotation.IntDef; +import androidx.annotation.IntDef; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java index 399165586..c5d567e56 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java @@ -73,7 +73,7 @@ public class LockScreenManager extends BaseSubManager { private String deviceIconUrl; boolean driverDistStatus, mIsLockscreenDismissible, enableDismissGesture, lockScreenEnabled, deviceLogoEnabled; private volatile boolean isApplicationForegrounded; - private android.arch.lifecycle.LifecycleObserver lifecycleObserver; + private androidx.lifecycle.LifecycleObserver lifecycleObserver; int lockScreenIcon, lockScreenColor, customView, displayMode; Bitmap deviceLogo; private boolean mLockScreenHasBeenDismissed, lockscreenDismissReceiverRegistered, receivedFirstDDNotification; @@ -138,8 +138,8 @@ public class LockScreenManager extends BaseSubManager { deviceIconUrl = null; try { - if (android.arch.lifecycle.ProcessLifecycleOwner.get() != null && lifecycleObserver != null) { - android.arch.lifecycle.ProcessLifecycleOwner.get().getLifecycle().removeObserver(lifecycleObserver); + if (androidx.lifecycle.ProcessLifecycleOwner.get() != null && lifecycleObserver != null) { + androidx.lifecycle.ProcessLifecycleOwner.get().getLifecycle().removeObserver(lifecycleObserver); } } catch (Exception e) { e.printStackTrace(); @@ -239,21 +239,21 @@ public class LockScreenManager extends BaseSubManager { // Set up listener for Application Foreground / Background events try { - lifecycleObserver = new android.arch.lifecycle.LifecycleObserver() { - @android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_START) + lifecycleObserver = new androidx.lifecycle.LifecycleObserver() { + @androidx.lifecycle.OnLifecycleEvent(androidx.lifecycle.Lifecycle.Event.ON_START) public void onMoveToForeground() { isApplicationForegrounded = true; launchLockScreenActivity(); } - @android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_STOP) + @androidx.lifecycle.OnLifecycleEvent(androidx.lifecycle.Lifecycle.Event.ON_STOP) public void onMoveToBackground() { isApplicationForegrounded = false; } }; - if (android.arch.lifecycle.ProcessLifecycleOwner.get() != null) { - android.arch.lifecycle.ProcessLifecycleOwner.get().getLifecycle().addObserver(lifecycleObserver); + if (androidx.lifecycle.ProcessLifecycleOwner.get() != null) { + androidx.lifecycle.ProcessLifecycleOwner.get().getLifecycle().addObserver(lifecycleObserver); } } catch (Exception e) { e.printStackTrace(); diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java index 7efa183b7..e3a85bb1b 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.permission; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.interfaces.ISdl; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java index 7975bb5f2..5065294a9 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.file.FileManager; import com.smartdevicelink.proxy.interfaces.ISdl; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java index 146343677..b7a2e2958 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.file.FileManager; import com.smartdevicelink.proxy.interfaces.ISdl; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java index f38cf79d0..b5dafa5fd 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java @@ -1,6 +1,6 @@ package com.smartdevicelink.managers.screen; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.interfaces.ISdl; /** diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java index d3d594b76..82e9a5e01 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.R; import com.smartdevicelink.managers.file.FileManager; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java index f470b8a68..32ff8c0eb 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.file.FileManager; import com.smartdevicelink.proxy.interfaces.ISdl; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java index c443abfc6..9825900e9 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java @@ -32,7 +32,7 @@ package com.smartdevicelink.protocol; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.SessionType; import com.smartdevicelink.transport.MultiplexTransportConfig; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java index 7c9915456..daf203b5f 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java @@ -40,8 +40,7 @@ import android.os.Build; import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
-import android.os.TransactionTooLargeException;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.util.SparseArray;
@@ -54,7 +53,7 @@ import com.livio.taskmaster.Taskmaster; import com.smartdevicelink.BuildConfig;
import com.smartdevicelink.Dispatcher.IDispatchingStrategy;
import com.smartdevicelink.Dispatcher.ProxyMessageDispatcher;
-import com.smartdevicelink.SdlConnection.ISdlConnectionListener;
+import com.smartdevicelink.SdlConnection.ISdlSessionListener;
import com.smartdevicelink.SdlConnection.SdlSession;
import com.smartdevicelink.encoder.VirtualDisplayEncoder;
import com.smartdevicelink.exception.SdlException;
@@ -148,7 +147,6 @@ import java.net.HttpURLConnection; import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
-import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@@ -357,7 +355,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> public void startVideoService(VideoStreamingParameters parameters, boolean encrypted) {
if(isConnected()){
sdlSession.setDesiredVideoParams(parameters);
- sdlSession.startService(SessionType.NAV,sdlSession.getSessionId(),encrypted);
+ sdlSession.startService(SessionType.NAV,encrypted);
addNavListener();
}
}
@@ -365,13 +363,13 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> @Override
public void stopVideoService() {
if(isConnected()){
- sdlSession.endService(SessionType.NAV,sdlSession.getSessionId());
+ sdlSession.endService(SessionType.NAV);
}
}
@Override public void stopAudioService() {
if(isConnected()){
- sdlSession.endService(SessionType.PCM,sdlSession.getSessionId());
+ sdlSession.endService(SessionType.PCM);
}
}
@@ -520,7 +518,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> @Override
public void startAudioService(boolean encrypted) {
if(isConnected()){
- sdlSession.startService(SessionType.PCM,sdlSession.getSessionId(),encrypted);
+ sdlSession.startService(SessionType.PCM,encrypted);
}
}
@@ -582,21 +580,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> }
// Private Class to Interface with SdlConnection
- private class SdlInterfaceBroker implements ISdlConnectionListener {
-
- @Override
- public void onTransportDisconnected(String info) {
- // proxyOnTransportDisconnect is called to alert the proxy that a requested
- // disconnect has completed
- notifyPutFileStreamError(null, info);
-
- //if (!_advancedLifecycleManagementEnabled) {
- // If original model, notify app the proxy is closed so it will delete and reinstanciate
- DebugTool.logInfo(TAG, "notifying proxy of closed");
- notifyProxyClosed(info, new SdlException("Transport disconnected.", SdlExceptionCause.SDL_UNAVAILABLE), SdlDisconnectedReason.TRANSPORT_DISCONNECT);
- //}// else If ALM, nothing is required to be done here
-
- }
+ private class SdlInterfaceBroker implements ISdlSessionListener {
@Override
public void onTransportDisconnected(String info, boolean altTransportAvailable, BaseTransportConfig transportConfig) {
@@ -612,198 +596,27 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> }
}
- @Override
- public void onTransportError(String info, Exception e) {
- DebugTool.logError(TAG, "Transport failure: " + info, e);
-
- notifyPutFileStreamError(e, info);
-
- if (_advancedLifecycleManagementEnabled) {
- // Cycle the proxy
- if(false){ //FIXME
- cycleProxy(SdlDisconnectedReason.LEGACY_BLUETOOTH_MODE_ENABLED);
-
- }else{
- cycleProxy(SdlDisconnectedReason.TRANSPORT_ERROR);
- }
- } else {
- notifyProxyClosed(info, e, SdlDisconnectedReason.TRANSPORT_ERROR);
- }
- }
@Override
- public void onProtocolMessageReceived(ProtocolMessage msg) {
+ public void onRPCMessageReceived(RPCMessage rpcMessage) {
- // AudioPathThrough is coming WITH BulkData but WITHOUT JSON Data
- // Policy Snapshot is coming WITH BulkData and WITH JSON Data
- if ((msg.getData() != null && msg.getData().length > 0) ||
- (msg.getBulkData() != null && msg.getBulkData().length > 0)) {
- queueIncomingMessage(msg);
- }
}
@Override
- public void onProtocolSessionStarted(SessionType sessionType,
- byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) {
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionStarted");
- updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
- updateBroadcastIntent(sendIntent, "COMMENT2", " ServiceType: " + sessionType.getName());
- updateBroadcastIntent(sendIntent, "COMMENT3", " Encrypted: " + isEncrypted);
- sendBroadcastIntent(sendIntent);
-
- if(sdlSession!= null){
- setProtocolVersion(sdlSession.getProtocolVersion());
- }else{
- setProtocolVersion(new com.smartdevicelink.util.Version(version,0,0));
- }
-
-
- if (minimumProtocolVersion != null && minimumProtocolVersion.isNewerThan(getProtocolVersion()) == 1){
- DebugTool.logWarning(TAG, String.format("Disconnecting from head unit, the configured minimum protocol version %s is greater than the supported protocol version %s", minimumProtocolVersion, getProtocolVersion()));
- try {
- disposeInternal(SdlDisconnectedReason.MINIMUM_PROTOCOL_VERSION_HIGHER_THAN_SUPPORTED);
- } catch (SdlException e) {
- e.printStackTrace();
- }
- return;
- }
-
-
- if (sessionType.eq(SessionType.RPC)) {
-
- if (!isEncrypted)
- {
- if ( (_transportConfig.getHeartBeatTimeout() != Integer.MAX_VALUE) && (version > 2))
- {
- HeartbeatMonitor outgoingHeartbeatMonitor = new HeartbeatMonitor();
- outgoingHeartbeatMonitor.setInterval(_transportConfig.getHeartBeatTimeout());
- //sdlSession.setOutgoingHeartbeatMonitor(outgoingHeartbeatMonitor);
-
- HeartbeatMonitor incomingHeartbeatMonitor = new HeartbeatMonitor();
- incomingHeartbeatMonitor.setInterval(_transportConfig.getHeartBeatTimeout());
- //sdlSession.setIncomingHeartbeatMonitor(incomingHeartbeatMonitor);
- }
-
- startRPCProtocolSession();
- }
- else
- {
- RPCProtectedServiceStarted();
- }
- } else if (sessionType.eq(SessionType.NAV)) {
- NavServiceStarted();
- } else if (sessionType.eq(SessionType.PCM)) {
- AudioServiceStarted();
- } else if (sessionType.eq(SessionType.RPC)){
- cycleProxy(SdlDisconnectedReason.RPC_SESSION_ENDED);
- }
- else if (protocolVersion!= null && protocolVersion.getMajor() > 1) {
- //If version is 2 or above then don't need to specify a Session Type
- startRPCProtocolSession();
- } //else{} Handle other protocol session types here
+ public void onSessionStarted(int sessionID, Version version) {
}
@Override
- public void onProtocolSessionStartedNACKed(SessionType sessionType,
- byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
- OnServiceNACKed message = new OnServiceNACKed(sessionType);
- queueInternalMessage(message);
-
- if (sessionType.eq(SessionType.NAV)) {
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionStartedNACKed");
- updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
- updateBroadcastIntent(sendIntent, "COMMENT2", " NACK ServiceType: " + sessionType.getName());
- sendBroadcastIntent(sendIntent);
-
- NavServiceStartedNACK(rejectedParams);
- }
- else if (sessionType.eq(SessionType.PCM)) {
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionStartedNACKed");
- updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
- updateBroadcastIntent(sendIntent, "COMMENT2", " NACK ServiceType: " + sessionType.getName());
- sendBroadcastIntent(sendIntent);
-
- AudioServiceStartedNACK(rejectedParams);
- }
- }
+ public void onSessionEnded(int sessionID) {
- @Override
- public void onProtocolSessionEnded(SessionType sessionType,
- byte sessionID, String correlationID) {
- OnServiceEnded message = new OnServiceEnded(sessionType);
- queueInternalMessage(message);
-
- if (sessionType.eq(SessionType.NAV)) {
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionEnded");
- updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
- updateBroadcastIntent(sendIntent, "COMMENT2", " End ServiceType: " + sessionType.getName());
- sendBroadcastIntent(sendIntent);
-
- NavServiceEnded();
- }
- else if (sessionType.eq(SessionType.PCM)) {
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionEnded");
- updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
- updateBroadcastIntent(sendIntent, "COMMENT2", " End ServiceType: " + sessionType.getName());
- sendBroadcastIntent(sendIntent);
-
- AudioServiceEnded();
- }
}
@Override
- public void onProtocolError(String info, Exception e) {
- notifyPutFileStreamError(e, info);
- passErrorToProxyListener(info, e);
- }
+ public void onAuthTokenReceived(String authToken, int sessionID) {
- @Override
- public void onHeartbeatTimedOut(byte sessionID) {
- final String msg = "Heartbeat timeout";
- DebugTool.logInfo(TAG, msg);
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onHeartbeatTimedOut");
- updateBroadcastIntent(sendIntent, "COMMENT1", "Heartbeat timeout for SessionID: " + sessionID);
- sendBroadcastIntent(sendIntent);
-
- notifyProxyClosed(msg, new SdlException(msg, SdlExceptionCause.HEARTBEAT_PAST_DUE), SdlDisconnectedReason.HB_TIMEOUT);
-
}
- @Override
- public void onProtocolSessionEndedNACKed(SessionType sessionType,
- byte sessionID, String correlationID) {
- if (sessionType.eq(SessionType.NAV)) {
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionEndedNACKed");
- updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
- updateBroadcastIntent(sendIntent, "COMMENT2", " End NACK ServiceType: " + sessionType.getName());
- sendBroadcastIntent(sendIntent);
-
- NavServiceEndedNACK();
- }
- else if (sessionType.eq(SessionType.PCM)) {
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionEndedNACKed");
- updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
- updateBroadcastIntent(sendIntent, "COMMENT2", " End NACK ServiceType: " + sessionType.getName());
- sendBroadcastIntent(sendIntent);
-
- AudioServiceEndedNACK();
- }
-
- }
public void onProtocolServiceDataACK(SessionType sessionType, final int dataSize,
byte sessionID) {
@@ -820,10 +633,6 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> }
}
- @Override
- public void onAuthTokenReceived(String authToken, byte sessionID) {
- SdlProxyBase.this.authToken = authToken;
- }
}
protected SdlProxyBase(){}
@@ -2343,7 +2152,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> }
if (sdlSession != null) {
- pm.setSessionID(sdlSession.getSessionId());
+ pm.setSessionID((byte)sdlSession.getSessionId());
}
if (message.getBulkData() != null) {
@@ -5050,13 +4859,13 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> private RPCStreamController startPutFileStream(String sPath, PutFile msg) {
if (sdlSession == null) return null;
- return startRPCStream(sPath, msg, SessionType.RPC, sdlSession.getSessionId(), protocolVersion);
+ return startRPCStream(sPath, msg, SessionType.RPC, (byte)sdlSession.getSessionId(), protocolVersion);
}
private RPCStreamController startPutFileStream(InputStream is, PutFile msg) {
if (sdlSession == null) return null;
if (is == null) return null;
- return startRPCStream(is, msg, SessionType.RPC, sdlSession.getSessionId(), protocolVersion);
+ return startRPCStream(is, msg, SessionType.RPC, (byte)sdlSession.getSessionId(), protocolVersion);
}
@SuppressWarnings("UnusedReturnValue")
@@ -5104,12 +4913,12 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> @SuppressWarnings("unused")
public void startService(SessionType serviceType, boolean isEncrypted){
- sdlSession.startService(serviceType, sdlSession.getSessionId(), isEncrypted);
+ sdlSession.startService(serviceType, isEncrypted);
}
@SuppressWarnings("unused")
public void endService(SessionType serviceType){
- sdlSession.endService(serviceType, sdlSession.getSessionId());
+ sdlSession.endService(serviceType);
}
@@ -5140,7 +4949,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> emptyParam.setFormat(null);
sdlSession.setDesiredVideoParams(emptyParam);
- sdlSession.startService(SessionType.NAV, sdlSession.getSessionId(), isEncrypted);
+ sdlSession.startService(SessionType.NAV, isEncrypted);
addNavListener();
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
ScheduledExecutorService scheduler = createScheduler();
@@ -5188,7 +4997,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> emptyParam.setFormat(null);
sdlSession.setDesiredVideoParams(emptyParam);
- sdlSession.startService(SessionType.NAV, sdlSession.getSessionId(), isEncrypted);
+ sdlSession.startService(SessionType.NAV, isEncrypted);
addNavListener();
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
ScheduledExecutorService scheduler = createScheduler();
@@ -5270,7 +5079,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> pcmServiceStartResponseReceived = false;
pcmServiceStartResponse = false;
- sdlSession.startService(SessionType.PCM, sdlSession.getSessionId(), isEncrypted);
+ sdlSession.startService(SessionType.PCM, isEncrypted);
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
ScheduledExecutorService scheduler = createScheduler();
@@ -5303,7 +5112,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> pcmServiceStartResponseReceived = false;
pcmServiceStartResponse = false;
- sdlSession.startService(SessionType.PCM, sdlSession.getSessionId(), isEncrypted);
+ sdlSession.startService(SessionType.PCM, isEncrypted);
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
ScheduledExecutorService scheduler = createScheduler();
@@ -5584,7 +5393,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> navServiceStartResponse = false;
navServiceStartRejectedParams = null;
- sdlSession.startService(SessionType.NAV, sdlSession.getSessionId(), isEncrypted);
+ sdlSession.startService(SessionType.NAV, isEncrypted);
addNavListener();
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
ScheduledExecutorService scheduler = createScheduler();
@@ -5716,7 +5525,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> pcmServiceStartResponseReceived = false;
pcmServiceStartResponse = false;
- sdlSession.startService(SessionType.PCM, sdlSession.getSessionId(), isEncrypted);
+ sdlSession.startService(SessionType.PCM, isEncrypted);
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
ScheduledExecutorService scheduler = createScheduler();
@@ -5848,7 +5657,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> public boolean startProtectedRPCService() {
rpcProtectedResponseReceived = false;
rpcProtectedStartResponse = false;
- sdlSession.startService(SessionType.RPC, sdlSession.getSessionId(), true);
+ sdlSession.startService(SessionType.RPC, true);
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
ScheduledExecutorService scheduler = createScheduler();
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java b/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java index db02be687..accb59948 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java @@ -183,7 +183,7 @@ public class StreamPacketizer extends AbstractPacketizer implements IVideoStream }
finally
{
- _session.endService(_serviceType, _rpcSessionID);
+ _session.endService(_serviceType);
}
}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/trace/SdlTrace.java b/android/sdl_android/src/main/java/com/smartdevicelink/trace/SdlTrace.java index e3bedd6a2..956985128 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/trace/SdlTrace.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/trace/SdlTrace.java @@ -35,22 +35,6 @@ import android.annotation.SuppressLint; import android.bluetooth.BluetoothDevice;
import android.os.Build;
import android.os.Debug;
-import android.os.Process;
-
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
-import com.smartdevicelink.protocol.enums.FrameType;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.trace.enums.DetailLevel;
-import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
-import com.smartdevicelink.trace.enums.Mod;
-import com.smartdevicelink.transport.SiphonServer;
-import com.smartdevicelink.util.BitConverter;
-import com.smartdevicelink.util.DebugTool;
-import com.smartdevicelink.util.NativeLogTool;
import java.sql.Timestamp;
@@ -63,291 +47,12 @@ import java.sql.Timestamp; */
@SuppressLint("DefaultLocale")
-public class SdlTrace {
- private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
-
- public static final String SYSTEM_LOG_TAG = "SdlTrace";
-
- private static long baseTics = java.lang.System.currentTimeMillis();
- private static boolean acceptAPITraceAdjustments = true;
-
- protected static ISTListener m_appTraceListener = null;
-
- ///
- /// The PUBLIC interface to SdlTrace starts here
- ///
-
-
- public static void setAcceptAPITraceAdjustments(Boolean APITraceAdjustmentsAccepted) {
- if (APITraceAdjustmentsAccepted != null) {
- acceptAPITraceAdjustments = APITraceAdjustmentsAccepted;
- }
- }
-
- public static boolean getAcceptAPITraceAdjustments() {
- return acceptAPITraceAdjustments;
- }
-
- public static void setAppTraceListener(ISTListener listener) {
- m_appTraceListener = listener;
- } // end-method
-
- public static void setAppTraceLevel(DetailLevel dt) {
- if ( dt != null && acceptAPITraceAdjustments)
- DiagLevel.setLevel(Mod.app, dt);
- } // end-method
-
- public static void setProxyTraceLevel(DetailLevel dt) {
- if (dt != null && acceptAPITraceAdjustments)
- DiagLevel.setLevel(Mod.proxy, dt);
- } // end-method
-
- public static void setRpcTraceLevel(DetailLevel dt) {
- if (dt != null && acceptAPITraceAdjustments)
- DiagLevel.setLevel(Mod.rpc, dt);
- } // end-method
-
- public static void setMarshallingTraceLevel(DetailLevel dt) {
- if (dt != null && acceptAPITraceAdjustments)
- DiagLevel.setLevel(Mod.mar, dt);
- } // end-method
-
- public static void setProtocolTraceLevel(DetailLevel dt) {
- if (dt != null && acceptAPITraceAdjustments)
- DiagLevel.setLevel(Mod.proto, dt);
- } // end-method
-
- public static void setTransportTraceLevel(DetailLevel dt) {
- if (dt != null && acceptAPITraceAdjustments)
- DiagLevel.setLevel(Mod.tran, dt);
- } // end-method
-
- private static String encodeTraceMessage(long timestamp, Mod module, InterfaceActivityDirection msgDirection, String msgBodyXml) {
- StringBuilder sb = new StringBuilder("<msg><dms>");
- sb.append(timestamp);
- sb.append("</dms><pid>");
- sb.append(Process.myPid());
- sb.append("</pid><tid>");
- sb.append(Thread.currentThread().getId());
- sb.append("</tid><mod>");
- sb.append(module.toString());
- sb.append("</mod>");
- if (msgDirection != InterfaceActivityDirection.None) {
- sb.append("<dir>");
- sb.append(interfaceActivityDirectionToString(msgDirection));
- sb.append("</dir>");
- } // end-if
- sb.append(msgBodyXml);
- sb.append("</msg>");
-
- return sb.toString();
- } // end-method
-
- private static String interfaceActivityDirectionToString(InterfaceActivityDirection iaDirection) {
- String str = "";
- switch (iaDirection) {
- case Receive:
- str = "rx";
- break;
- case Transmit:
- str = "tx";
- break;
- default:
- break;
- } // end-switch
- return str;
- } // end-method
-
- static String B64EncodeForXML(String data) {
- return Mime.base64Encode(data);
- // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: return Base64.encodeToString(data.getBytes(), Base64.DEFAULT);
- } // end-method
-
- public static boolean logProxyEvent(String eventText, String token) {
- if (DiagLevel.getLevel(Mod.proxy) == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
- return false;
- }
-
- String msg = SdlTrace.B64EncodeForXML(eventText);
- String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.proxy, InterfaceActivityDirection.None, "<d>" + msg + "</d>");
- return writeXmlTraceMessage(xml);
+public class SdlTrace extends SdlTraceBase {
+ private static String getPid(){
+ return String.valueOf(android.os.Process.myPid());
}
- public static boolean logAppEvent(String eventText) {
- if (DiagLevel.getLevel(Mod.app) == DetailLevel.OFF) {
- return false;
- }
-
- long timestamp = SdlTrace.getBaseTicsDelta();
- String msg = SdlTrace.B64EncodeForXML(eventText);
- String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.app, InterfaceActivityDirection.None, "<d>" + msg + "</d>");
- return writeXmlTraceMessage(xml);
- }
-
- public static boolean logRPCEvent(InterfaceActivityDirection msgDirection, RPCMessage rpcMsg, String token) {
- DetailLevel dl = DiagLevel.getLevel(Mod.rpc);
- if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
- return false;
- }
-
- long timestamp = SdlTrace.getBaseTicsDelta();
- String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.rpc, msgDirection, rpc2Xml(dl, rpcMsg));
- return writeXmlTraceMessage(xml);
- }
-
- private static String rpc2Xml(DetailLevel dl, RPCMessage rpcMsg) {
- StringBuilder rpcAsXml = new StringBuilder();
- rpcAsXml.append("<op>");
- rpcAsXml.append(rpcMsg.getFunctionName());
- rpcAsXml.append("</op>");
- boolean hasCorrelationID = false;
- Integer correlationID = -1;
- if (rpcMsg instanceof RPCRequest) {
- hasCorrelationID = true;
- correlationID = ((RPCRequest)rpcMsg).getCorrelationID();
- } else if (rpcMsg instanceof RPCResponse) {
- hasCorrelationID = true;
- correlationID = ((RPCResponse)rpcMsg).getCorrelationID();
- } // end-if
- if (hasCorrelationID) {
- rpcAsXml.append("<cid>");
- rpcAsXml.append(correlationID);
- rpcAsXml.append("</cid>");
- } // end-if
- rpcAsXml.append("<type>");
- rpcAsXml.append(rpcMsg.getMessageType());
- rpcAsXml.append("</type>");
- //rpcAsXml.append(newline);
-
- if (dl == DetailLevel.VERBOSE) {
- OpenRPCMessage orpcmsg = new OpenRPCMessage(rpcMsg);
- String rpcParamList = orpcmsg.msgDump();
- String msg = SdlTrace.B64EncodeForXML(rpcParamList);
- rpcAsXml.append("<d>");
- rpcAsXml.append(msg);
- rpcAsXml.append("</d>");
- } // end-if
- return rpcAsXml.toString();
- } // end-method
-
- public static boolean logMarshallingEvent(InterfaceActivityDirection msgDirection, byte[] marshalledMessage, String token) {
- DetailLevel dl = DiagLevel.getLevel(Mod.mar);
- if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
- return false;
- }
-
- long timestamp = SdlTrace.getBaseTicsDelta();
- StringBuilder msg = new StringBuilder();
- msg.append("<sz>");
- msg.append(marshalledMessage.length);
- msg.append("</sz>");
- if (dl == DetailLevel.VERBOSE) {
- msg.append("<d>");
- msg.append(Mime.base64Encode(marshalledMessage));
- // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: msg.append(Base64.encodeToString(marshalledMessage, Base64.DEFAULT));
- msg.append("</d>");
- }
- String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.mar, msgDirection, msg.toString());
- return writeXmlTraceMessage(xml);
- }
-
- public static boolean logProtocolEvent(InterfaceActivityDirection frameDirection, SdlPacket packet, int frameDataOffset, int frameDataLength, String token) {
- DetailLevel dl = DiagLevel.getLevel(Mod.proto);
- if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
- return false;
- }
-
- StringBuffer protoMsg = new StringBuffer();
- protoMsg.append("<frame>");
- protoMsg.append(SdlTrace.getProtocolFrameHeaderInfo(packet));
- if (dl == DetailLevel.VERBOSE) {
- if (packet.getPayload() != null && frameDataLength > 0) {
- protoMsg.append("<d>");
- String bytesInfo = "";
- bytesInfo = Mime.base64Encode(packet.getPayload(), frameDataOffset, frameDataLength);
- // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: bytesInfo = Base64.encodeToString(frameData, frameDataOffset, frameDataLength, Base64.DEFAULT);
- protoMsg.append(bytesInfo);
- protoMsg.append("</d>");
- }
- }
- protoMsg.append("</frame>");
- String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.proto, frameDirection, protoMsg.toString());
- return writeXmlTraceMessage(xml);
- }
-
- private static String getProtocolFrameType(FrameType f) {
- if (f == FrameType.Control)
- return "Control";
- else if (f == FrameType.Consecutive)
- return "Consecutive";
- else if (f == FrameType.First)
- return "First";
- else if (f == FrameType.Single)
- return "Single";
-
- return "Unknown";
- } // end-method
-
- private static String getProtocolSessionType(SessionType serviceType) {
- String s;
- if (serviceType == SessionType.RPC )
- s = "rpc";
- else if (serviceType == SessionType.BULK_DATA)
- s = "bulk";
- else
- s = "Unknown";
- return s;
- } // end-method
-
- private static String getProtocolFrameHeaderInfo(SdlPacket hdr) {
- StringBuilder sb = new StringBuilder();
- sb.append("<hdr>");
- sb.append("<ver>");
- sb.append(hdr.getVersion());
- sb.append("</ver><cmp>");
- sb.append(hdr.isEncrypted());
- sb.append("</cmp><ft>");
- sb.append(getProtocolFrameType(hdr.getFrameType()));
- sb.append("</ft><st>");
- sb.append(getProtocolSessionType(SessionType.valueOf((byte)hdr.getServiceType())));
- sb.append("</st><sid>");
- sb.append(hdr.getSessionId());
- sb.append("</sid><sz>");
- sb.append(hdr.getDataSize());
- sb.append("</sz>");
-
- int frameData = hdr.getFrameInfo();
- if (hdr.getFrameType() == FrameType.Control) {
- sb.append("<ca>");
- if (frameData == FrameDataControlFrameType.StartSession.getValue())
- sb.append("StartSession");
- else if (frameData == FrameDataControlFrameType.StartSessionACK.getValue())
- sb.append("StartSessionACK");
- else if (frameData == FrameDataControlFrameType.StartSessionNACK.getValue())
- sb.append("StartSessionNACK");
- else if (frameData == FrameDataControlFrameType.EndSession.getValue())
- sb.append("EndSession");
- sb.append("</ca>");
- } else if (hdr.getFrameType() == FrameType.Consecutive ) {
- sb.append("<fsn>");
- if (frameData == 0 )
- sb.append("lastFrame");
- else
- sb.append(String.format("%02X",frameData));
- sb.append("</fsn>");
- } else if (hdr.getFrameType() == FrameType.First ) {
- int totalSize = BitConverter.intFromByteArray(hdr.getPayload(), 0);
- int numFrames = BitConverter.intFromByteArray(hdr.getPayload(), 4);
- sb.append("<total>").append(totalSize).append("</total><numframes>").append(numFrames).append("</numframes>");
- } else if (hdr.getFrameType() == FrameType.Single ) {
- sb.append("<single/>");
- }
-
- sb.append("</hdr>");
-
- return sb.toString();
- } // end-method
-
+ @SuppressLint("MissingPermission")
public static String getBTDeviceInfo(BluetoothDevice btDevice) {
StringBuilder sb = new StringBuilder();
sb.append("<btp>");
@@ -361,92 +66,9 @@ public class SdlTrace { return sb.toString();
} // end-method
- public static boolean logTransportEvent(String preamble, String transportSpecificInfoXml, InterfaceActivityDirection msgDirection, byte buf[], int byteLength, String token) {
- return logTransportEvent(preamble, transportSpecificInfoXml, msgDirection, buf, 0, byteLength, token);
- }
-
- private static void checkB64(String x, byte[] buf, int offset, int byteLength) {
- if ((x.length() % 4) != 0) {
- NativeLogTool.logWarning(SdlTrace.SYSTEM_LOG_TAG, "b64 string length (" + x.length() + ") isn't multiple of 4: buf.length=" + buf.length + ", offset=" + offset + ", len=" + byteLength);
- } // end-if
- } // end-method
-
- public static boolean logTransportEvent(String preamble, String transportSpecificInfoXml, InterfaceActivityDirection msgDirection, byte buf[], int offset, int byteLength, String token) {
- if (DiagLevel.getLevel(Mod.tran) == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
- return false;
- }
-
- StringBuilder msg = new StringBuilder();
- if (transportSpecificInfoXml != null && transportSpecificInfoXml.length() > 0) {
- msg.append(transportSpecificInfoXml);
- }
- if (preamble != null && preamble.length() > 0) {
- msg.append("<desc>");
- msg.append(preamble);
- msg.append("</desc>");
- }
- if (buf != null) {
- msg.append("<sz>");
- msg.append(byteLength);
- msg.append("</sz>");
- DetailLevel dl = DiagLevel.getLevel(Mod.tran);
- if (dl == DetailLevel.VERBOSE) {
- if (buf != null && byteLength > 0) {
- msg.append("<d>");
- String bytesInfo = Mime.base64Encode(buf, offset, byteLength);
- checkB64(bytesInfo, buf, offset, byteLength);
- msg.append(bytesInfo);
- msg.append("</d>");
- }
- }
- }
- String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.tran, msgDirection, msg.toString());
- return writeXmlTraceMessage(xml);
- }
-
- // Package-scoped
- static long getBaseTicsDelta() {
- return java.lang.System.currentTimeMillis() - getBaseTics();
- }
-
- // Package-scoped
- static long getBaseTics() {
- return baseTics;
- } // end-method
-
- public static Boolean writeMessageToSiphonServer(String info) {
- return SiphonServer.sendFormattedTraceMessage(info);
- }
-
- private static boolean writeXmlTraceMessage(String msg) {
- try {
- // Attempt to write formatted message to the Siphon
- if (false == writeMessageToSiphonServer(msg)) {
- // If writing to the Siphon fails, write to the native log
- NativeLogTool.logInfo(SdlTrace.SYSTEM_LOG_TAG, msg);
- return false;
- }
-
- ISTListener localTraceListener = m_appTraceListener;
-
- if (localTraceListener != null) {
- try {
- localTraceListener.logXmlMsg(msg, SDL_LIB_TRACE_KEY);
- } catch (Exception ex) {
- DebugTool.logError(SYSTEM_LOG_TAG, "Failure calling ISTListener: " + ex.toString(), ex);
- return false;
- }
- }
- } catch (Exception ex) {
- NativeLogTool.logError(SdlTrace.SYSTEM_LOG_TAG, "Failure writing XML trace message: " + ex.toString());
- return false;
- }
- return true;
- }
-
// Package-scoped
@SuppressWarnings("deprecation")
- public static String getLogHeader(String dumpReason, int seqNo) {
+ public static String getLogHeader(String dumpReason, int seqNo) {
final String Sep = "-";
StringBuilder write = new StringBuilder("<?xml version=\"1.0\"?>" + "<logs>");
write.append("<info>");
@@ -461,7 +83,7 @@ public class SdlTrace { long heapAllocated = Debug.getNativeHeapAllocatedSize() / 1024;
infoBlock.append("<mem><hf>").append(heapSize).append("KB</hf><ha>").append(heapAllocated).append("KB</ha></mem>");
infoBlock.append("<np>").append(Runtime.getRuntime().availableProcessors()).append("</np>");
- infoBlock.append("<pid>").append(Process.myPid()).append("</pid>");
+ infoBlock.append("<pid>").append(getPid()).append("</pid>");
infoBlock.append("<tid>").append(Thread.currentThread().getId()).append("</tid>");
// String dateStamp = (String)
@@ -480,21 +102,5 @@ public class SdlTrace { write.append("</info>" + "<msgs>");
return write.toString();
} // end-method
-
- private static String getSmartDeviceLinkTraceRoot(String dumpReason, int seqNo) {
- StringBuilder write = new StringBuilder("<SmartDeviceLinktraceroot>" + "<sequencenum>" + seqNo
- + "</sequencenum>" + "<dumpreason>" + dumpReason
- + "</dumpreason><tracelevel>");
-
- write.append("<tran>").append(DiagLevel.getLevel(Mod.tran)).append("</tran>");
- write.append("<proto>").append(DiagLevel.getLevel(Mod.proto)).append("</proto>");
- write.append("<mar>").append(DiagLevel.getLevel(Mod.mar)).append("</mar>");
- write.append("<rpc>").append(DiagLevel.getLevel(Mod.rpc)).append("</rpc>");
- write.append("<proxy>").append(DiagLevel.getLevel(Mod.proxy)).append("</proxy>");
- write.append("<app>").append(DiagLevel.getLevel(Mod.app)).append("</app>");
- write.append("</tracelevel>");
- write.append("</SmartDeviceLinktraceroot>");
- return write.toString();
- } // end-method
} // end-class
\ No newline at end of file diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java index 5b67fa444..01251f61f 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java @@ -29,7 +29,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; -import android.support.annotation.RequiresPermission; +import androidx.annotation.RequiresPermission; import com.smartdevicelink.protocol.SdlPacket; import com.smartdevicelink.transport.enums.TransportType; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java index a9aca1ff4..f86caa699 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java @@ -47,7 +47,7 @@ import android.os.AsyncTask; import android.os.Build; import android.os.Handler; import android.os.Looper; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.util.AndroidTools; import com.smartdevicelink.util.DebugTool; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java index a15969d58..4ed1b85f4 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java @@ -41,10 +41,12 @@ import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.hardware.usb.UsbManager; import android.os.Build; +import android.os.Debug; import android.os.Looper; import android.os.Parcelable; import android.util.AndroidRuntimeException; @@ -55,6 +57,7 @@ import com.smartdevicelink.transport.enums.TransportType; import com.smartdevicelink.transport.utl.SdlDeviceListener; import com.smartdevicelink.util.AndroidTools; import com.smartdevicelink.util.DebugTool; +import com.smartdevicelink.util.IntegrationValidator; import com.smartdevicelink.util.SdlAppInfo; import com.smartdevicelink.util.ServiceFinder; @@ -132,30 +135,10 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{ if (localRouterClass == null){ localRouterClass = defineLocalSdlRouterClass(); // we need to check this again because for USB apps, the returned class can still be null - if (localRouterClass != null) { - - // Check if the service declaration in AndroidManifest has the intent-filter action specified correctly - boolean serviceFilterHasAction = false; - String className = localRouterClass.getName(); - List<SdlAppInfo> services = AndroidTools.querySdlAppInfo(context, null); - for (SdlAppInfo sdlAppInfo : services) { - if(sdlAppInfo != null && sdlAppInfo.getRouterServiceComponentName() != null && className.equals((sdlAppInfo.getRouterServiceComponentName().getClassName()))){ - serviceFilterHasAction = true; - break; - } - } - if (!serviceFilterHasAction){ - DebugTool.logError(TAG, "WARNING: This application has not specified its intent-filter for the SdlRouterService. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!"); - } - - // Check if the service declaration in AndroidManifest has the router service version metadata specified correctly - ResolveInfo info = context.getPackageManager().resolveService(new Intent(context, localRouterClass), PackageManager.GET_META_DATA); - if (info != null) { - if (info.serviceInfo.metaData == null || !info.serviceInfo.metaData.containsKey(context.getString(R.string.sdl_router_service_version_name))) { - DebugTool.logError(TAG, "WARNING: This application has not specified its metadata tags for the SdlRouterService. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!"); - } - } else { - DebugTool.logError(TAG, "WARNING: This application has not specified its SdlRouterService correctly in the manifest. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!"); + if (AndroidTools.isDebugMode(context)) { + IntegrationValidator.ValidationResult result = IntegrationValidator.validate(context, localRouterClass, 0); + if(!result.isSuccessful()){ + throw new RuntimeException(result.getResultText()); } } } @@ -448,6 +431,17 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{ * @param context */ public static void queryForConnectedService(final Context context){ + if (AndroidTools.isDebugMode(context)) { + int flag = 0; + if(localRouterClass == null) { + flag = IntegrationValidator.FLAG_SKIP_ROUTER_SERVICE_CHECK; + } + + IntegrationValidator.ValidationResult result = IntegrationValidator.validate(context, localRouterClass, flag); + if(!result.isSuccessful()){ + throw new RuntimeException(result.getResultText()); + } + } //Leverage existing call. Include ping bit if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ ServiceFinder finder = new ServiceFinder(context, context.getPackageName(), new ServiceFinder.ServiceFinderCallback() { diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java index 24d5ec850..2fde0e817 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java @@ -70,8 +70,8 @@ import android.os.Parcel; import android.os.ParcelFileDescriptor; import android.os.Parcelable; import android.os.RemoteException; -import android.support.annotation.NonNull; -import android.support.v4.app.NotificationCompat; +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; import android.util.AndroidRuntimeException; import android.util.SparseArray; import android.util.SparseIntArray; @@ -95,6 +95,7 @@ import com.smartdevicelink.transport.utl.TransportRecord; import com.smartdevicelink.util.AndroidTools; import com.smartdevicelink.util.BitConverter; import com.smartdevicelink.util.DebugTool; +import com.smartdevicelink.util.IntegrationValidator; import com.smartdevicelink.util.SdlAppInfo; import org.json.JSONException; @@ -1104,6 +1105,12 @@ public class SdlRouterService extends Service{ @Override public void onCreate() { super.onCreate(); + if (AndroidTools.isDebugMode(getApplicationContext())) { + IntegrationValidator.ValidationResult result = IntegrationValidator.validate(getApplicationContext(), this.getClass(), 0); + if(!result.isSuccessful()) { + throw new RuntimeException(result.getResultText()); + } + } //Add this first to avoid the runtime exceptions for the entire lifecycle of the service setRouterServiceExceptionHandler(); //This must be done regardless of if this service shuts down or not diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/SdlDeviceListener.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/SdlDeviceListener.java index 488a117b4..b9bd8bb12 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/SdlDeviceListener.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/SdlDeviceListener.java @@ -39,7 +39,7 @@ import android.content.SharedPreferences; import android.os.Handler; import android.os.Looper; import android.os.Message; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.transport.MultiplexBaseTransport; import com.smartdevicelink.transport.MultiplexBluetoothTransport; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java b/android/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java index bedc38028..0e75acd77 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java @@ -36,6 +36,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; @@ -191,4 +192,11 @@ public class AndroidTools { bis.close(); return result; } + + public static boolean isDebugMode(Context context){ + if(context != null && context.getApplicationInfo() != null){ + return 0 != ( context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE ); + } + return false; + } } diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/util/IntegrationValidator.java b/android/sdl_android/src/main/java/com/smartdevicelink/util/IntegrationValidator.java new file mode 100644 index 000000000..6553da286 --- /dev/null +++ b/android/sdl_android/src/main/java/com/smartdevicelink/util/IntegrationValidator.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2020 Livio, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Livio Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +package com.smartdevicelink.util; + +import android.Manifest; +import android.content.Context; +import android.content.Intent; +import android.content.pm.ActivityInfo; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; +import android.os.Build; + +import com.smartdevicelink.R; +import com.smartdevicelink.transport.TransportConstants; + +import java.util.ArrayList; +import java.util.List; + +public class IntegrationValidator { + + private static final char CHECK_MARK = 0x2713; + private static final char FAIL_MARK = 0x2715; + + public static final int FLAG_SKIP_ROUTER_SERVICE_CHECK = 0x01; + + + public static ValidationResult validate(Context context, Class localRouterClass, int flags) { + StringBuilder builder = new StringBuilder(); + builder.append("\n-----------------------------------"); + builder.append("\n Integration Validator Results: \n"); + builder.append("-----------------------------------\n"); + List<ValidationResult> results = new ArrayList<>(); + + results.add(checkPermissions(context)); + + if ((flags & FLAG_SKIP_ROUTER_SERVICE_CHECK) == FLAG_SKIP_ROUTER_SERVICE_CHECK) { + results.add(new ValidationResult(true, "SdlRouterService checks were not performed yet due to supplied flags")); + } else { + if (localRouterClass != null) { + results.add(checkRoutServiceMetadata(context, localRouterClass)); + results.add(checkRouterServiceIntent(context, localRouterClass)); + } else { + results.add(new ValidationResult(false, "SdlRouterService is not defined in SdlBroadcastReceiver and therefore some checks were not completed")); + } + } + + results.add(checkBroadcastReceiver(context)); + + boolean success = true; + for (ValidationResult result : results) { + if (result.successful) { + builder.append(CHECK_MARK + " "); + } else { + success = false; + builder.append(FAIL_MARK + " "); + } + builder.append(result.resultText); + builder.append("\n\n"); + + + } + + if (!success) { + builder.append("Please see the guides for how to fix these issues at www.smartdevicelink.com"); + } + + return new ValidationResult(success, builder.toString()); + } + + private static ValidationResult checkPermissions(Context context) { + ValidationResult retVal = new ValidationResult(true, "Permission check passed"); + List<String> permissionList = new ArrayList<>(); + permissionList.add(Manifest.permission.BLUETOOTH); + permissionList.add(Manifest.permission.INTERNET); + permissionList.add(Manifest.permission.ACCESS_NETWORK_STATE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + permissionList.add(Manifest.permission.FOREGROUND_SERVICE); + } + try { + PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getApplicationContext().getPackageName(), PackageManager.GET_PERMISSIONS); + String[] permissionInfos = packageInfo.requestedPermissions; + + if (permissionInfos != null && permissionInfos.length > 0) { + String permissionInfo; + for (int i = 0; i < permissionInfos.length; i++) { + permissionInfo = permissionInfos[i]; + permissionList.remove(permissionInfo); + } + } + } catch (Exception e) { + } + + if (!permissionList.isEmpty()) { + StringBuilder builder = new StringBuilder(); + builder.append("This application is missing permissions: \n"); + for (String permission : permissionList) { + builder.append(" - "); + builder.append(permission); + builder.append("\n"); + } + retVal.successful = false; + retVal.resultText = builder.toString(); + } + + return retVal; + } + + public static ValidationResult checkBroadcastReceiver(Context context) { + ValidationResult retVal = new ValidationResult(true, "SdlBroadcastReceiver check passed"); + try { + Intent intent = new Intent(); + intent.setAction(TransportConstants.START_ROUTER_SERVICE_ACTION); + List<ResolveInfo> sdlReceivers = context.getPackageManager().queryBroadcastReceivers(intent, 0); + PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_RECEIVERS); + ActivityInfo[] receivers = packageInfo.receivers; + + if (receivers != null && receivers.length > 0) { + ActivityInfo receiver; + for (int i = 0; i < receivers.length; i++) { + + receiver = receivers[i]; + if (receiver != null) { + int j = 0; + for (ResolveInfo sdlReceiver : sdlReceivers) { + if (receiver.name.equals(sdlReceiver.activityInfo.name)) { + return retVal; + } + } + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + retVal.successful = false; + retVal.resultText = "This application has not specified its SDL Receiver properly."; + return retVal; + } + + // Check if the service declaration in AndroidManifest has the router service version metadata specified correctly + private static ValidationResult checkRoutServiceMetadata(Context context, Class localRouterClass) { + ValidationResult retVal = new ValidationResult(true, "SdlRouterService entry and metadata checks passed"); + + ResolveInfo info = context.getPackageManager().resolveService(new Intent(context, localRouterClass), PackageManager.GET_META_DATA); + if (info != null) { + if (info.serviceInfo.metaData == null || !info.serviceInfo.metaData.containsKey(context.getString(R.string.sdl_router_service_version_name))) { + retVal.successful = false; + retVal.resultText = "This application has not specified its metadata tags for the SdlRouterService."; + } + } else { + retVal.successful = false; + retVal.resultText = "This application has not specified its SdlRouterService correctly in the manifest."; + } + return retVal; + } + + // Check if the service declaration in AndroidManifest has the intent-filter action specified correctly + private static ValidationResult checkRouterServiceIntent(Context context, Class localRouterClass) { + ValidationResult retVal = new ValidationResult(true, "SdlRouterService intent filter check passed"); + + boolean serviceFilterHasAction = false; + String className = localRouterClass.getName(); + List<SdlAppInfo> services = AndroidTools.querySdlAppInfo(context, null); + for (SdlAppInfo sdlAppInfo : services) { + if (sdlAppInfo != null && sdlAppInfo.getRouterServiceComponentName() != null + && className.equals((sdlAppInfo.getRouterServiceComponentName().getClassName()))) { + serviceFilterHasAction = true; + break; + } + } + if (!serviceFilterHasAction) { + retVal.successful = false; + retVal.resultText = "This application has not specified its intent-filter for the SdlRouterService."; + } + + return retVal; + } + + /** + * Results from a validation check. + * Includes if the check was successful and a human readable string to describe the results. + */ + public static final class ValidationResult { + boolean successful; + String resultText; + + ValidationResult(boolean successful, String resultText) { + this.successful = successful; + this.resultText = resultText; + } + + public boolean isSuccessful() { + return successful; + } + + public String getResultText() { + return resultText; + } + } +} diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/util/MediaStreamingStatus.java b/android/sdl_android/src/main/java/com/smartdevicelink/util/MediaStreamingStatus.java index 3e8a37661..84c21f761 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/util/MediaStreamingStatus.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/util/MediaStreamingStatus.java @@ -43,7 +43,7 @@ import android.content.IntentFilter; import android.media.AudioDeviceInfo; import android.media.AudioManager; import android.os.Build; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.lang.ref.WeakReference; import java.util.ArrayList; diff --git a/base/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java b/base/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java index 7bd7edb01..c3e6158dd 100644 --- a/base/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java +++ b/base/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java @@ -33,11 +33,13 @@ package com.smartdevicelink.SdlConnection; import com.smartdevicelink.exception.SdlException; +import com.smartdevicelink.managers.lifecycle.RpcConverter; import com.smartdevicelink.protocol.ISdlProtocol; import com.smartdevicelink.protocol.ProtocolMessage; import com.smartdevicelink.protocol.SdlPacket; import com.smartdevicelink.protocol.SdlProtocolBase; import com.smartdevicelink.protocol.enums.SessionType; +import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.interfaces.ISdlServiceListener; import com.smartdevicelink.proxy.rpc.VideoStreamingFormat; import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol; @@ -54,26 +56,25 @@ import java.util.List; import java.util.ListIterator; import java.util.concurrent.CopyOnWriteArrayList; -public abstract class BaseSdlSession implements ISdlProtocol, ISdlConnectionListener, ISecurityInitializedListener { +public abstract class BaseSdlSession implements ISdlProtocol, ISecurityInitializedListener { private static final String TAG = "SdlSession"; final protected SdlProtocolBase sdlProtocol; protected BaseTransportConfig transportConfig; - protected ISdlConnectionListener sessionListener; + protected ISdlSessionListener sessionListener; protected SdlSecurityBase sdlSecurity = null; protected VideoStreamingParameters desiredVideoParams = null; protected VideoStreamingParameters acceptedVideoParams = null; - protected byte sessionId; - protected int sessionHashId = 0; + protected int sessionId = -1; protected HashMap<SessionType, CopyOnWriteArrayList<ISdlServiceListener>> serviceListeners; protected CopyOnWriteArrayList<SessionType> encryptedServices = new CopyOnWriteArrayList<SessionType>(); boolean sdlSecurityInitializing = false; - public BaseSdlSession(ISdlConnectionListener listener, BaseTransportConfig config){ + public BaseSdlSession(ISdlSessionListener listener, BaseTransportConfig config){ this.transportConfig = config; this.sessionListener = listener; this.sdlProtocol = getSdlProtocolImplementation(); @@ -105,12 +106,12 @@ public abstract class BaseSdlSession implements ISdlProtocol, ISdlConnectionList sdlSecurity.shutDown(); } if(sdlProtocol != null){ - sdlProtocol.endSession(sessionId, sessionHashId); + sdlProtocol.endSession((byte)sessionId); } } - public void startService (SessionType serviceType, byte sessionID, boolean isEncrypted) { + public void startService (SessionType serviceType, boolean isEncrypted) { if (isEncrypted){ if (sdlSecurity != null){ List<SessionType> serviceList = sdlSecurity.getServiceList(); @@ -125,14 +126,14 @@ public abstract class BaseSdlSession implements ISdlProtocol, ISdlConnectionList } } } - sdlProtocol.startService(serviceType, sessionID, isEncrypted); + sdlProtocol.startService(serviceType, (byte)this.sessionId, isEncrypted); } - public void endService (SessionType serviceType, byte sessionID) { + public void endService (SessionType serviceType) { if (sdlProtocol == null) { return; } - sdlProtocol.endService(serviceType,sessionID); + sdlProtocol.endService(serviceType, (byte)this.sessionId); } @@ -156,18 +157,6 @@ public abstract class BaseSdlSession implements ISdlProtocol, ISdlConnectionList return sdlProtocol != null && sdlProtocol.isConnected(); } - - public void shutdown(String info){ - DebugTool.logInfo(TAG, "Shutdown - " + info); - this.sessionListener.onTransportDisconnected(info); - - } - - @Override - public void onTransportDisconnected(String info, boolean altTransportAvailable, BaseTransportConfig transportConfig) { - this.sessionListener.onTransportDisconnected(info, altTransportAvailable, this.transportConfig); - } - /** * Get the current protocol version used by this session * @return Version that represents the Protocol version being used @@ -184,22 +173,10 @@ public abstract class BaseSdlSession implements ISdlProtocol, ISdlConnectionList return this.transportConfig; } - public int getSessionHashId() { - return this.sessionHashId; - } - - public byte getSessionId() { - return this.sessionId; - } - public void setSdlSecurity(SdlSecurityBase sec) { sdlSecurity = sec; } - public SdlSecurityBase getSdlSecurity() { - return sdlSecurity; - } - protected void processControlService(ProtocolMessage msg) { if (sdlSecurity == null) @@ -222,7 +199,7 @@ public abstract class BaseSdlSession implements ISdlProtocol, ISdlConnectionList protocolMessage.setData(returnBytes); protocolMessage.setFunctionID(0x01); protocolMessage.setVersion((byte)sdlProtocol.getProtocolVersion().getMajor()); - protocolMessage.setSessionID(getSessionId()); + protocolMessage.setSessionID((byte)this.sessionId); //sdlSecurity.hs(); @@ -234,53 +211,6 @@ public abstract class BaseSdlSession implements ISdlProtocol, ISdlConnectionList return encryptedServices.contains(sType); } - @Override - public void onTransportDisconnected(String info) { - this.sessionListener.onTransportDisconnected(info); - } - - - @Override - public void onTransportError(String info, Exception e) { - this.sessionListener.onTransportError(info, e); - } - - @Override - public void onProtocolMessageReceived(ProtocolMessage msg) { - if (msg.getSessionType().equals(SessionType.CONTROL)) { - processControlService(msg); - return; - } - - this.sessionListener.onProtocolMessageReceived(msg); - } - - @Override - public void onHeartbeatTimedOut(byte sessionID) { - this.sessionListener.onHeartbeatTimedOut(sessionID); - - } - - @Override - public void onProtocolError(String info, Exception e) { - this.sessionListener.onProtocolError(info, e); - DebugTool.logError(TAG,"on protocol error", e); - } - - @Override - public void onProtocolServiceDataACK(SessionType sessionType, int dataSize, byte sessionID) { - this.sessionListener.onProtocolServiceDataACK(sessionType, dataSize, sessionID); - } - - - - @Override - public void onAuthTokenReceived(String token, byte sessionID) { - //This is not used in the base library. Will only be used in the Android library while it has the SdlConnection class - //See onAuthTokenReceived(String token) in this class instead - - } - public void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener){ if(serviceListeners == null){ serviceListeners = new HashMap<>(); @@ -309,22 +239,6 @@ public abstract class BaseSdlSession implements ISdlProtocol, ISdlConnectionList this.desiredVideoParams = params; } - /** - * Returns the currently set desired video streaming parameters. If there haven't been any set, - * the default options will be returned and set for this instance. - * @return the desired video streaming parameters - */ - public VideoStreamingParameters getDesiredVideoParams(){ - if(desiredVideoParams == null){ - desiredVideoParams = new VideoStreamingParameters(); - } - return desiredVideoParams; - } - - public void setAcceptedVideoParams(VideoStreamingParameters params){ - this.acceptedVideoParams = params; - } - public VideoStreamingParameters getAcceptedVideoParams(){ return acceptedVideoParams; } @@ -347,17 +261,72 @@ public abstract class BaseSdlSession implements ISdlProtocol, ISdlConnectionList /* *********************************************************************************************************************************************************************** - * ***************************************************************** IProtocol Listener ******************************************************************************** + * ***************************************************************** ISdlProtocol Listener ******************************************************************************** *************************************************************************************************************************************************************************/ - public void onProtocolMessageBytesToSend(SdlPacket packet) { - //DebugTool.logInfo(TAG, "onProtocolMessageBytesToSend - " + packet.getTransportType()); - sdlProtocol.sendPacket(packet); + @Override + public void onProtocolMessageReceived(ProtocolMessage msg) { + if (msg.getSessionType().equals(SessionType.CONTROL)) { + processControlService(msg); + } else if (SessionType.RPC.equals(msg.getSessionType()) + || SessionType.BULK_DATA.equals(msg.getSessionType())) { + RPCMessage rpc = RpcConverter.extractRpc(msg, this.sdlProtocol.getProtocolVersion()); + this.sessionListener.onRPCMessageReceived(rpc); + } + + } + //To be implemented by child class + @Override + public abstract void onServiceStarted(SdlPacket packet, SessionType sessionType, int sessionID, Version version, boolean isEncrypted); + @Override + public abstract void onServiceEnded(SdlPacket packet, SessionType sessionType, int sessionID); + @Override + public abstract void onServiceError(SdlPacket packet, SessionType sessionType, int sessionID, String error); + + + @Override + public void onProtocolError(String info, Exception e) { + //TODO is there anything to pass forward here? + DebugTool.logError(TAG,"on protocol error", e); } + @Override + public int getSessionId() { + return this.sessionId; + } - public void onProtocolSessionStartedNACKed(SessionType sessionType, byte sessionID, byte version, String correlationID, List<String> rejectedParams){ - onProtocolSessionNACKed(sessionType,sessionID,version,correlationID,rejectedParams); + @Override + public void shutdown(String info) { + DebugTool.logInfo(TAG, "Shutdown - " + info); + this.sessionListener.onTransportDisconnected(info, false, this.transportConfig); + } + + @Override + public void onTransportDisconnected(String info, boolean altTransportAvailable, BaseTransportConfig transportConfig) { + this.sessionListener.onTransportDisconnected(info, altTransportAvailable, this.transportConfig); + } + + @Override + public SdlSecurityBase getSdlSecurity() { + return sdlSecurity; + } + + /** + * Returns the currently set desired video streaming parameters. If there haven't been any set, + * the default options will be returned and set for this instance. + * @return the desired video streaming parameters + */ + @Override + public VideoStreamingParameters getDesiredVideoParams() { + if (desiredVideoParams == null) { + desiredVideoParams = new VideoStreamingParameters(); + } + return desiredVideoParams; + } + + @Override + public void setAcceptedVideoParams(VideoStreamingParameters params) { + this.acceptedVideoParams = params; } @Override @@ -365,12 +334,6 @@ public abstract class BaseSdlSession implements ISdlProtocol, ISdlConnectionList this.sessionListener.onAuthTokenReceived(authToken, sessionId); } - /* Not supported methods from IProtocolListener */ - public void onProtocolHeartbeat(SessionType sessionType, byte sessionID) { /* Not supported */} - public void onProtocolHeartbeatACK(SessionType sessionType, byte sessionID) {/* Not supported */} - public void onResetOutgoingHeartbeat(SessionType sessionType, byte sessionID) {/* Not supported */} - public void onResetIncomingHeartbeat(SessionType sessionType, byte sessionID) {/* Not supported */} - /* *********************************************************************************************************************************************************************** * ***************************************************************** Security Listener ********************************************************************************* *************************************************************************************************************************************************************************/ @@ -390,17 +353,13 @@ public abstract class BaseSdlSession implements ISdlProtocol, ISdlConnectionList service = iter.next(); if (service != null) - sdlProtocol.startService(service, getSessionId(), true); + sdlProtocol.startService(service, (byte)this.sessionId, true); iter.remove(); } } } - @Override - public void stopStream(SessionType serviceType) { - //Currently does nothing as streaming is not available. Also should only be managed through managers - } /** diff --git a/base/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java b/base/src/main/java/com/smartdevicelink/SdlConnection/ISdlSessionListener.java index 87fd35122..3cd6c23c9 100644 --- a/base/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java +++ b/base/src/main/java/com/smartdevicelink/SdlConnection/ISdlSessionListener.java @@ -29,44 +29,53 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package com.smartdevicelink.SdlConnection;
-
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.transport.BaseTransportConfig;
-
-import java.util.List;
-
-
-public interface ISdlConnectionListener {
- @Deprecated
- void onTransportDisconnected(String info);
-
- void onTransportDisconnected(String info, boolean availablePrimary, BaseTransportConfig transportConfig);
-
-
- void onTransportError(String info, Exception e);
-
- void onProtocolMessageReceived(ProtocolMessage msg);
-
- void onProtocolSessionStartedNACKed(SessionType sessionType,
- byte sessionID, byte version, String correlationID, List<String> rejectedParams);
-
- void onProtocolSessionStarted(SessionType sessionType,
- byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted);
-
- void onProtocolSessionEnded(SessionType sessionType,
- byte sessionID, String correlationID);
-
- void onProtocolSessionEndedNACKed(SessionType sessionType,
- byte sessionID, String correlationID);
-
- void onProtocolError(String info, Exception e);
-
- @Deprecated
- void onHeartbeatTimedOut(byte sessionID);
-
- void onProtocolServiceDataACK(SessionType sessionType, int dataSize, byte sessionID);
-
- void onAuthTokenReceived(String authToken, byte sessionID);
-}
+package com.smartdevicelink.SdlConnection; + +import androidx.annotation.RestrictTo; + +import com.smartdevicelink.protocol.enums.SessionType; +import com.smartdevicelink.proxy.RPCMessage; +import com.smartdevicelink.transport.BaseTransportConfig; +import com.smartdevicelink.util.Version; + +@RestrictTo(RestrictTo.Scope.LIBRARY) +public interface ISdlSessionListener { + + /** + * Called when a transport disconnects + * @param info a human readable string including information on the disconnected transport + * @param availablePrimary a boolean flag indicating if there is another transport that can + * be used to connect with the SDL enabled device. + * @param transportConfig the previously supplied transport config + */ + void onTransportDisconnected(String info, boolean availablePrimary, BaseTransportConfig transportConfig); + + /** + * Called when an RPC message has been received from the connected SDL device + * @param rpcMessage the RPC message that was received + */ + void onRPCMessageReceived(RPCMessage rpcMessage); + + /** + * Called to indicate that a session has started with the connected SDL device. This means the + * RPC and Bulk service types have also been started. + * @param sessionID session ID associated with the session that was established + * @param version the protocol version that has been negotiated for this session + */ + void onSessionStarted(int sessionID, Version version); + + /** + * Called to indicate that the session that was previously established has now ended. This means + * that all services previously started on this session are also closed. + * @param sessionID the session ID that was assigned to this now closed session + */ + void onSessionEnded( int sessionID); + + /** + * Called when an auth token has been received. This should always happen after the session + * has been created. + * @param authToken the actual auth token that has been stringified + * @param sessionID the session ID that this auth token is associated with + */ + void onAuthTokenReceived(String authToken, int sessionID); +}
\ No newline at end of file diff --git a/base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java b/base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java index cac7d0923..5dc9a3e75 100644 --- a/base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.file.FileManager; import com.smartdevicelink.managers.file.FileManagerConfig; diff --git a/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java b/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java index 10477d31a..74aebda5a 100644 --- a/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.interfaces.ISdl; import com.smartdevicelink.transport.utl.TransportRecord; diff --git a/base/src/main/java/com/smartdevicelink/managers/ServiceEncryptionListener.java b/base/src/main/java/com/smartdevicelink/managers/ServiceEncryptionListener.java index fedefdec2..36883a23c 100644 --- a/base/src/main/java/com/smartdevicelink/managers/ServiceEncryptionListener.java +++ b/base/src/main/java/com/smartdevicelink/managers/ServiceEncryptionListener.java @@ -1,7 +1,7 @@ package com.smartdevicelink.managers; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.smartdevicelink.protocol.enums.SessionType; diff --git a/base/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java b/base/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java index 6025167f5..f828ff58e 100644 --- a/base/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java +++ b/base/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers; -import android.support.annotation.IntDef; +import androidx.annotation.IntDef; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/base/src/main/java/com/smartdevicelink/managers/audio/BaseAudioStreamManager.java b/base/src/main/java/com/smartdevicelink/managers/audio/BaseAudioStreamManager.java index e3e4d325c..e4c191308 100644 --- a/base/src/main/java/com/smartdevicelink/managers/audio/BaseAudioStreamManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/audio/BaseAudioStreamManager.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.audio; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.proxy.interfaces.ISdl; diff --git a/base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java b/base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java index 30a9f92bc..c08cb17e0 100644 --- a/base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java @@ -33,7 +33,7 @@ package com.smartdevicelink.managers.file; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.CompletionListener; diff --git a/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseEncryptionLifecycleManager.java b/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseEncryptionLifecycleManager.java index 33bb0a67a..a458ae048 100644 --- a/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseEncryptionLifecycleManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseEncryptionLifecycleManager.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.lifecycle; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.SdlConnection.SdlSession; import com.smartdevicelink.managers.ServiceEncryptionListener; import com.smartdevicelink.protocol.enums.FunctionID; diff --git a/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java b/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java index 765944492..75469a69d 100644 --- a/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java @@ -32,11 +32,11 @@ package com.smartdevicelink.managers.lifecycle; -import android.support.annotation.NonNull; -import android.support.annotation.RestrictTo; +import androidx.annotation.NonNull; +import androidx.annotation.RestrictTo; import com.livio.taskmaster.Taskmaster; -import com.smartdevicelink.SdlConnection.ISdlConnectionListener; +import com.smartdevicelink.SdlConnection.ISdlSessionListener; import com.smartdevicelink.SdlConnection.SdlSession; import com.smartdevicelink.exception.SdlException; import com.smartdevicelink.managers.SdlManager; @@ -158,7 +158,7 @@ abstract class BaseLifecycleManager { */ public void startRPCEncryption() { if (session != null) { - session.startService(SessionType.RPC, session.getSessionId(), true); + session.startService(SessionType.RPC, true); } } @@ -785,7 +785,7 @@ abstract class BaseLifecycleManager { final ProtocolMessage pm = new ProtocolMessage(); pm.setData(msgBytes); if (session != null) { - pm.setSessionID(session.getSessionId()); + pm.setSessionID((byte)session.getSessionId()); } pm.setMessageType(MessageType.RPC); @@ -855,106 +855,98 @@ abstract class BaseLifecycleManager { } /* ******************************************************************************************************* - *************************************** ISdlConnectionListener START ************************************ + **************************************** ISdlSessionListener START ************************************** *********************************************************************************************************/ - final ISdlConnectionListener sdlConnectionListener = new ISdlConnectionListener() { - @Override - public void onTransportDisconnected(String info) { - onClose(info, null, null); - - } + final ISdlSessionListener sdlSessionListener = new ISdlSessionListener() { @Override public void onTransportDisconnected(String info, boolean availablePrimary, BaseTransportConfig transportConfig) { BaseLifecycleManager.this.onTransportDisconnected(info, availablePrimary, transportConfig); - - } - - @Override - public void onTransportError(String info, Exception e) { - onClose(info, e, null); - } @Override - public void onProtocolMessageReceived(ProtocolMessage msg) { + public void onRPCMessageReceived(RPCMessage rpc) { //Incoming message - if (SessionType.RPC.equals(msg.getSessionType()) - || SessionType.BULK_DATA.equals(msg.getSessionType())) { - - RPCMessage rpc = RpcConverter.extractRpc(msg, session.getProtocolVersion()); - if (rpc != null) { - String messageType = rpc.getMessageType(); - DebugTool.logInfo(TAG, "RPC received - " + messageType); + if (rpc != null) { + String messageType = rpc.getMessageType(); + DebugTool.logInfo(TAG, "RPC received - " + messageType); - rpc.format(rpcSpecVersion, true); + rpc.format(rpcSpecVersion, true); - onRPCReceived(rpc); + BaseLifecycleManager.this.onRPCReceived(rpc); - if (RPCMessage.KEY_RESPONSE.equals(messageType)) { + if (RPCMessage.KEY_RESPONSE.equals(messageType)) { - onRPCResponseReceived((RPCResponse) rpc); + onRPCResponseReceived((RPCResponse) rpc); - } else if (RPCMessage.KEY_NOTIFICATION.equals(messageType)) { - FunctionID functionID = rpc.getFunctionID(); - if (functionID != null && (functionID.equals(FunctionID.ON_BUTTON_PRESS)) || functionID.equals(FunctionID.ON_BUTTON_EVENT)) { - RPCNotification notificationCompat = handleButtonNotificationFormatting(rpc); - if (notificationCompat != null) { - onRPCNotificationReceived((notificationCompat)); - } + } else if (RPCMessage.KEY_NOTIFICATION.equals(messageType)) { + FunctionID functionID = rpc.getFunctionID(); + if (functionID != null && (functionID.equals(FunctionID.ON_BUTTON_PRESS)) || functionID.equals(FunctionID.ON_BUTTON_EVENT)) { + RPCNotification notificationCompat = handleButtonNotificationFormatting(rpc); + if (notificationCompat != null) { + onRPCNotificationReceived((notificationCompat)); } + } - onRPCNotificationReceived((RPCNotification) rpc); + onRPCNotificationReceived((RPCNotification) rpc); - } else if (RPCMessage.KEY_REQUEST.equals(messageType)) { + } else if (RPCMessage.KEY_REQUEST.equals(messageType)) { - onRPCRequestReceived((RPCRequest) rpc); + onRPCRequestReceived((RPCRequest) rpc); - } - } else { - DebugTool.logWarning(TAG, "Shouldn't be here"); } + } else { + DebugTool.logWarning(TAG, "Shouldn't be here"); } - } - @Override - public void onProtocolSessionStartedNACKed(SessionType sessionType, byte sessionID, byte version, String correlationID, List<String> rejectedParams) { - DebugTool.logWarning(TAG, sessionType.getName() + " onProtocolSessionStartedNACKed " + sessionID + " RejectedParams: " + rejectedParams); - BaseLifecycleManager.this.onStartServiceNACKed(sessionType); - } @Override - public void onProtocolSessionStarted(SessionType sessionType, byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) { + public void onSessionStarted(int sessionID, Version version) { DebugTool.logInfo(TAG, "on protocol session started"); - BaseLifecycleManager.this.onServiceStarted(sessionType); - } - - @Override - public void onProtocolSessionEnded(SessionType sessionType, byte sessionID, String correlationID) { - //Currently not necessary - } - - @Override - public void onProtocolSessionEndedNACKed(SessionType sessionType, byte sessionID, String correlationID) { - //Currently not necessary + if (minimumProtocolVersion != null && minimumProtocolVersion.isNewerThan(version) == 1) { + DebugTool.logWarning(TAG, String.format("Disconnecting from head unit, the configured minimum protocol version %s is greater than the supported protocol version %s", minimumProtocolVersion, getProtocolVersion())); + session.endService(SessionType.RPC); + clean(); + return; + } + if (appConfig != null) { + appConfig.prepare(); + + SdlMsgVersion sdlMsgVersion = new SdlMsgVersion(); + sdlMsgVersion.setMajorVersion(MAX_SUPPORTED_RPC_VERSION.getMajor()); + sdlMsgVersion.setMinorVersion(MAX_SUPPORTED_RPC_VERSION.getMinor()); + sdlMsgVersion.setPatchVersion(MAX_SUPPORTED_RPC_VERSION.getPatch()); + + RegisterAppInterface rai = new RegisterAppInterface(sdlMsgVersion, + appConfig.getAppName(), appConfig.isMediaApp(), appConfig.getLanguageDesired(), + appConfig.getHmiDisplayLanguageDesired(), appConfig.getAppID()); + rai.setCorrelationID(REGISTER_APP_INTERFACE_CORRELATION_ID); + + rai.setTtsName(appConfig.getTtsName()); + rai.setNgnMediaScreenAppName(appConfig.getNgnMediaScreenAppName()); + rai.setVrSynonyms(appConfig.getVrSynonyms()); + rai.setAppHMIType(appConfig.getAppType()); + rai.setDayColorScheme(appConfig.getDayColorScheme()); + rai.setNightColorScheme(appConfig.getNightColorScheme()); + rai.setHashID(appConfig.getResumeHash()); + + //Add device/system info in the future + + sendRPCMessagePrivate(rai, true); + } else { + DebugTool.logError(TAG, "App config was null, soo..."); + } } @Override - public void onProtocolError(String info, Exception e) { - DebugTool.logError(TAG, "Protocol Error - " + info, e); + public void onSessionEnded(int sessionID) { + DebugTool.logInfo(TAG, "on protocol session ended"); } @Override - public void onHeartbeatTimedOut(byte sessionID) { /* Deprecated */ } - - @Override - public void onProtocolServiceDataACK(SessionType sessionType, int dataSize, byte sessionID) {/* Unused */ } - - - @Override - public void onAuthTokenReceived(String token, byte sessionID) { + public void onAuthTokenReceived(String token, int sessionID) { BaseLifecycleManager.this.authToken = token; } }; @@ -1317,57 +1309,12 @@ abstract class BaseLifecycleManager { setupInternalRpcListeners(); } - void onServiceStarted(SessionType sessionType) { - if (sessionType != null) { - if (minimumProtocolVersion != null && minimumProtocolVersion.isNewerThan(getProtocolVersion()) == 1) { - DebugTool.logWarning(TAG, String.format("Disconnecting from head unit, the configured minimum protocol version %s is greater than the supported protocol version %s", minimumProtocolVersion, getProtocolVersion())); - session.endService(sessionType, session.getSessionId()); - clean(); - return; - } - - if (sessionType.equals(SessionType.RPC)) { - if (appConfig != null) { - - appConfig.prepare(); - - SdlMsgVersion sdlMsgVersion = new SdlMsgVersion(); - sdlMsgVersion.setMajorVersion(MAX_SUPPORTED_RPC_VERSION.getMajor()); - sdlMsgVersion.setMinorVersion(MAX_SUPPORTED_RPC_VERSION.getMinor()); - sdlMsgVersion.setPatchVersion(MAX_SUPPORTED_RPC_VERSION.getPatch()); - - RegisterAppInterface rai = new RegisterAppInterface(sdlMsgVersion, - appConfig.getAppName(), appConfig.isMediaApp(), appConfig.getLanguageDesired(), - appConfig.getHmiDisplayLanguageDesired(), appConfig.getAppID()); - rai.setCorrelationID(REGISTER_APP_INTERFACE_CORRELATION_ID); - - rai.setTtsName(appConfig.getTtsName()); - rai.setNgnMediaScreenAppName(appConfig.getNgnMediaScreenAppName()); - rai.setVrSynonyms(appConfig.getVrSynonyms()); - rai.setAppHMIType(appConfig.getAppType()); - rai.setDayColorScheme(appConfig.getDayColorScheme()); - rai.setNightColorScheme(appConfig.getNightColorScheme()); - rai.setHashID(appConfig.getResumeHash()); - - //Add device/system info in the future - - sendRPCMessagePrivate(rai, true); - } else { - DebugTool.logError(TAG, "App config was null, soo..."); - } - } - } - } abstract void cycle(SdlDisconnectedReason disconnectedReason); void onTransportDisconnected(String info, boolean availablePrimary, BaseTransportConfig transportConfig) { } - void onStartServiceNACKed(SessionType sessionType) { - } - - void startVideoService(boolean encrypted, VideoStreamingParameters parameters) { } diff --git a/base/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdate.java b/base/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdate.java index 031918d3b..fa85a459b 100644 --- a/base/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdate.java +++ b/base/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdate.java @@ -35,7 +35,7 @@ package com.smartdevicelink.managers.lifecycle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import com.smartdevicelink.proxy.rpc.TTSChunk; diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java b/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java index 5314d0fd5..669a34a7a 100644 --- a/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java @@ -31,8 +31,8 @@ */ package com.smartdevicelink.managers.permission; -import android.support.annotation.IntDef; -import android.support.annotation.NonNull; +import androidx.annotation.IntDef; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.CompletionListener; diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java b/base/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java index 160d94e83..dd600fc6d 100644 --- a/base/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java +++ b/base/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.permission; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java index 6a3d2ab0c..cd7a8f736 100644 --- a/base/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java +++ b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.permission; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java index 740aca7b6..018e038c9 100644 --- a/base/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java +++ b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.permission; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.util.List; import java.util.UUID; diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java index 2d4950e46..8f44ac0f6 100644 --- a/base/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java +++ b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.permission; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java index 7b6ee1c30..80daf4d2e 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java @@ -31,8 +31,8 @@ */ package com.smartdevicelink.managers.screen; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.CompletionListener; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java index 882e84d49..da2ed1173 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.screen; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.livio.taskmaster.Queue; import com.livio.taskmaster.Task; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseSubscribeButtonManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseSubscribeButtonManager.java index 7d9bf26e1..ba9e8aa53 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/BaseSubscribeButtonManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseSubscribeButtonManager.java @@ -1,6 +1,6 @@ package com.smartdevicelink.managers.screen; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.CompletionListener; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java index 6245320f4..654d03f2f 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.screen; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.CompletionListener; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java index 76c2622a6..7b5befb3d 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.screen; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.file.filetypes.SdlArtwork; import com.smartdevicelink.proxy.rpc.OnButtonEvent; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonState.java b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonState.java index a2272c461..9c6a7d2d4 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonState.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonState.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.screen; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.file.filetypes.SdlArtwork; import com.smartdevicelink.proxy.rpc.SoftButton; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java index 9743790b6..7de4f3434 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java @@ -34,8 +34,8 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.livio.taskmaster.Queue; import com.livio.taskmaster.Task; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceCell.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceCell.java index eb8533cd0..f6995279c 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceCell.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceCell.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.file.filetypes.SdlArtwork; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSet.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSet.java index 7009c89b1..6585ad810 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSet.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSet.java @@ -32,8 +32,8 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.smartdevicelink.proxy.TTSChunkFactory; import com.smartdevicelink.proxy.rpc.KeyboardProperties; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperation.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperation.java index de68e1ffc..ffce35694 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperation.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperation.java @@ -35,7 +35,7 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.livio.taskmaster.Task; import com.smartdevicelink.managers.CompletionListener; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseMenuManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseMenuManager.java index b244389d3..0fcfc2c4c 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseMenuManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseMenuManager.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen.menu; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.CompletionListener; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseVoiceCommandManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseVoiceCommandManager.java index 8004413b7..c615408fd 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseVoiceCommandManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseVoiceCommandManager.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen.menu; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.CompletionListener; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuCell.java b/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuCell.java index 6f69993ee..20cc44d38 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuCell.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuCell.java @@ -32,8 +32,8 @@ package com.smartdevicelink.managers.screen.menu; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.smartdevicelink.managers.file.filetypes.SdlArtwork; import com.smartdevicelink.proxy.rpc.enums.MenuLayout; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuConfiguration.java b/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuConfiguration.java index 13e1f92e2..59bf7974f 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuConfiguration.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuConfiguration.java @@ -35,7 +35,7 @@ package com.smartdevicelink.managers.screen.menu; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.rpc.enums.MenuLayout; diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommand.java b/base/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommand.java index 8227b3087..aa94dd533 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommand.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommand.java @@ -32,8 +32,8 @@ package com.smartdevicelink.managers.screen.menu; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import java.util.List; diff --git a/base/src/main/java/com/smartdevicelink/managers/video/BaseVideoStreamManager.java b/base/src/main/java/com/smartdevicelink/managers/video/BaseVideoStreamManager.java index da8c35af3..d5a24766f 100644 --- a/base/src/main/java/com/smartdevicelink/managers/video/BaseVideoStreamManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/video/BaseVideoStreamManager.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.video; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.proxy.interfaces.ISdl; diff --git a/base/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java b/base/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java index a199e2a00..37e7972f4 100644 --- a/base/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java +++ b/base/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java @@ -1,34 +1,34 @@ -/* - * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ +/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
package com.smartdevicelink.protocol;
@@ -36,6 +36,7 @@ import com.smartdevicelink.protocol.enums.SessionType; import java.util.List;
+@Deprecated
public interface IProtocolListener {
// Called to indicate that these bytes are to be sent as part of a message.
// This call includes the part of the message.
diff --git a/base/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java b/base/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java index 9875178f1..69cbfb8a7 100644 --- a/base/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java +++ b/base/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java @@ -33,26 +33,110 @@ package com.smartdevicelink.protocol; +import androidx.annotation.RestrictTo; + import com.smartdevicelink.protocol.enums.SessionType; import com.smartdevicelink.security.SdlSecurityBase; import com.smartdevicelink.streaming.video.VideoStreamingParameters; import com.smartdevicelink.transport.BaseTransportConfig; +import com.smartdevicelink.util.Version; + +@RestrictTo(RestrictTo.Scope.LIBRARY) +public interface ISdlProtocol { + + /** + * Called to indicate that a complete message (RPC, BULK, etc.) has been received. + * @param msg the message that was received + */ + void onProtocolMessageReceived(ProtocolMessage msg); + + /** + * Called to indicate that a service has been started + * @param packet the control packet StartServiceACK received from the connected device + * @param serviceType the service type that has been started + * @param sessionID the session ID that this service has been started on + * @param version the protocol version used for this session and service + * @param isEncrypted if the service is encrypted + */ + void onServiceStarted(SdlPacket packet, SessionType serviceType, int sessionID, Version version, boolean isEncrypted); -public interface ISdlProtocol extends IProtocolListener { + /** + * This will get called when a service has ended + * @param packet the packet received that ended this service + * @param serviceType the service type that has ended + * @param sessionID the id of the session that this service was operating on + */ + void onServiceEnded(SdlPacket packet, SessionType serviceType, int sessionID); - byte getSessionId(); + /** + * If there is an error with starting or stopping the service or any other error this method + * will be called. This will also be called if the service was operating on a transport that + * has been disconnected. + * @param packet if there is a packet that caused this error it will be included, however this + * can be null. + * @param serviceType the service type that experienced the error + * @param sessionID the session ID that this service was associated with + * @param error a human readable string of the error + */ + void onServiceError(SdlPacket packet, SessionType serviceType, int sessionID, String error); + /** + * Called to indicate that a protocol error was detected in received data. + * @param info a human readable string of the error + * @param e the exception if one occurred + */ + void onProtocolError(String info, Exception e); + + /** + * Method that the protocol layer will use to obtain the session ID + * @return the session ID associated with the protocol instance + */ + int getSessionId(); + + /** + * A request made by the protocol layer to shutdown the layers above it. Likely due to + * the RPC service being shutdown or the primary transport disconnecting. + * @param info human readable string on why the shutdown should occur + */ void shutdown(String info); + /** + * Called when a transport disconnects + * @param info a human readable string including information on the disconnected transport + * @param altTransportAvailable a boolean flag indicating if there is another transport that can + * be used to connect with the SDL enabled device. + * @param transportConfig the previously supplied transport config + */ void onTransportDisconnected(String info, boolean altTransportAvailable, BaseTransportConfig transportConfig); + /** + * A method that should be implemented by the hosting class of the SdlProtocol instance that will + * return the currently being used security library if any. + * @return the security library to be used to encrypt/decrypt packets + */ SdlSecurityBase getSdlSecurity(); + /** + * A method that should be implemented by the hosting class of the SdlProtocol instance that will + * return the desired video streaming parameters. These parameters will be requested if + * another component has requested the video streaming service to start. + * @return the developer supplied desired video streaming parameters + */ VideoStreamingParameters getDesiredVideoParams(); + /** + * A callback that will be called when the video service has been successfully started and the + * streaming parameters have been negotiated. This should be called prior to the video service + * started callback. + * @param acceptedVideoParams the negotiated and accepted video parameters that should be used + * to stream to the SDL enabled device. + */ void setAcceptedVideoParams(VideoStreamingParameters acceptedVideoParams); - void stopStream(SessionType serviceType); - + /** + * A callback to indicate the SDL connected device has supplied an authentication token to this + * application. It will be called after the service start callback. + * @param authToken + */ void onAuthTokenReceived(String authToken); } diff --git a/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java b/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java index 1468f9477..18eebbbbc 100644 --- a/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java +++ b/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.protocol; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.exception.SdlException; import com.smartdevicelink.exception.SdlExceptionCause; @@ -383,7 +383,7 @@ public class SdlProtocolBase { for(TransportRecord record: transports){ if(secondaryTransportListeners.get(record.getType()) != null && !secondaryTransportListeners.get(record.getType()).isEmpty()){ - registerSecondaryTransport(iSdlProtocol.getSessionId(), record); + registerSecondaryTransport((byte)iSdlProtocol.getSessionId(), record); } } } @@ -531,8 +531,8 @@ public class SdlProtocolBase { } } - public void endSession(byte sessionID, int hashId) { - SdlPacket header = SdlPacketFactory.createEndSession(SessionType.RPC, sessionID, hashId, (byte)protocolVersion.getMajor(), hashId); + public void endSession(byte sessionID) { + SdlPacket header = SdlPacketFactory.createEndSession(SessionType.RPC, sessionID, hashID, (byte)protocolVersion.getMajor(), hashID); handlePacketToSend(header); if(transportManager != null) { transportManager.close(sessionID); @@ -540,12 +540,6 @@ public class SdlProtocolBase { } // end-method - public void sendPacket(SdlPacket packet){ - if(transportManager != null){ - transportManager.sendPacket(packet); - } - } - public void sendMessage(ProtocolMessage protocolMsg) { SessionType sessionType = protocolMsg.getSessionType(); byte sessionID = protocolMsg.getSessionID(); @@ -819,7 +813,7 @@ public class SdlProtocolBase { public void endService(SessionType serviceType, byte sessionID) { if(serviceType.equals(SessionType.RPC)){ //RPC session will close all other sessions so we want to make sure we use the correct EndProtocolSession method - endSession(sessionID,hashID); + endSession(sessionID); }else { SdlPacket header = SdlPacketFactory.createEndSession(serviceType, sessionID, hashID, (byte)protocolVersion.getMajor(), new byte[0]); TransportRecord transportRecord = activeTransports.get(serviceType); @@ -843,8 +837,8 @@ public class SdlProtocolBase { protected void handlePacketToSend(SdlPacket packet) { synchronized(FRAME_LOCK) { - if(packet!=null){ - iSdlProtocol.onProtocolMessageBytesToSend(packet); + if(packet!=null && transportManager != null) { + transportManager.sendPacket(packet); } } @@ -854,6 +848,7 @@ public class SdlProtocolBase { * sent to the protocol listener. **/ protected void handleServiceEndedNAK(SdlPacket packet, SessionType serviceType) { + String error = "Service ended NAK received for service type " + serviceType.getName(); if(packet.version >= 5){ if(DebugTool.isDebugEnabled()) { //Currently this is only during a debugging session. Might pass back in the future @@ -876,30 +871,32 @@ public class SdlProtocolBase { builder.append(rejectedParam); builder.append(" "); } - DebugTool.logWarning(TAG, builder.toString()); + error = builder.toString(); + DebugTool.logWarning(TAG, error); } } } - iSdlProtocol.onProtocolSessionEndedNACKed(serviceType, (byte)packet.getSessionId(), ""); + iSdlProtocol.onServiceError(packet, serviceType, packet.getSessionId(), error); } // This method handles the end of a protocol session. A callback is // sent to the protocol listener. - protected void handleServiceEnded(SdlPacket packet, SessionType sessionType) { - - iSdlProtocol.onProtocolSessionEnded(sessionType, (byte)packet.getSessionId(), ""); + //FIXME do we do anything in this class for this? + protected void handleServiceEnded(SdlPacket packet, SessionType sessionType) { + iSdlProtocol.onServiceEnded(packet, sessionType, packet.getSessionId()); } + /** * This method handles the startup of a protocol session. A callback is sent * to the protocol listener. * @param packet StarServiceACK packet * @param serviceType the service type that has just been started */ - protected void handleProtocolSessionStarted(SdlPacket packet, SessionType serviceType) { + protected void handleStartServiceACK(SdlPacket packet, SessionType serviceType) { // Use this sessionID to create a message lock Object messageLock = _messageLocks.get((byte)packet.getSessionId()); if (messageLock == null) { @@ -999,7 +996,7 @@ public class SdlProtocolBase { } else { DebugTool.logInfo(TAG, "Received a start service ack for RPC service while already active on a different transport."); - iSdlProtocol.onProtocolSessionStarted(serviceType, (byte) packet.getSessionId(), (byte)protocolVersion.getMajor(), "", hashID, packet.isEncrypted()); + iSdlProtocol.onServiceStarted(packet, serviceType, (byte) packet.getSessionId(), protocolVersion, packet.isEncrypted()); return; } @@ -1070,10 +1067,11 @@ public class SdlProtocolBase { iSdlProtocol.setAcceptedVideoParams(iSdlProtocol.getDesiredVideoParams()); } } - iSdlProtocol.onProtocolSessionStarted(serviceType, (byte) packet.getSessionId(), (byte)protocolVersion.getMajor(), "", hashID, packet.isEncrypted()); + iSdlProtocol.onServiceStarted(packet, serviceType, (byte) packet.getSessionId(), protocolVersion, packet.isEncrypted()); } protected void handleProtocolSessionNAKed(SdlPacket packet, SessionType serviceType) { + String error = "Service start NAK received for service type " + serviceType.getName(); List<String> rejectedParams = null; if(packet.version >= 5){ if(DebugTool.isDebugEnabled()) { @@ -1097,15 +1095,18 @@ public class SdlProtocolBase { builder.append(rejectedParam); builder.append(" "); } - DebugTool.logWarning(TAG, builder.toString()); + error = builder.toString(); + DebugTool.logWarning(TAG, error); } } } if (serviceType.eq(SessionType.NAV) || serviceType.eq(SessionType.PCM)) { - iSdlProtocol.onProtocolSessionNACKed(serviceType, (byte)packet.sessionId, (byte)protocolVersion.getMajor(), "", rejectedParams); + iSdlProtocol.onServiceError(packet, serviceType, (byte)packet.sessionId, error); } else { + //TODO should there be any additional checks here? Or should this be more explicit in + // what types of services would cause this protocol error handleProtocolError("Got StartSessionNACK for protocol sessionID = " + packet.getSessionId(), null); } } @@ -1120,14 +1121,6 @@ public class SdlProtocolBase { sendHeartBeatACK(sessionType,sessionID); } - protected void handleServiceDataACK(SdlPacket packet, SessionType sessionType) { - - if (packet.getPayload() != null && packet.getDataSize() == 4){ //service data ack will be 4 bytes in length - int serviceDataAckSize = BitConverter.intFromByteArray(packet.getPayload(), 0); - iSdlProtocol.onProtocolServiceDataACK(sessionType, serviceDataAckSize, (byte)packet.getSessionId ()); - - } - } /* -------------------------------------------------------------------------------------------- ----------------------------------- TRANSPORT_TYPE LISTENER --------------------------------- @@ -1176,13 +1169,11 @@ public class SdlProtocolBase { //a single transport record per transport. //TransportType type = disconnectedTransport.getType(); if(getTransportForSession(SessionType.NAV) != null && disconnectedTransport.equals(getTransportForSession(SessionType.NAV))){ - //stopVideoStream(); - iSdlProtocol.stopStream(SessionType.NAV); + iSdlProtocol.onServiceError(null, SessionType.NAV, iSdlProtocol.getSessionId(), "Transport disconnected"); activeTransports.remove(SessionType.NAV); } if(getTransportForSession(SessionType.PCM) != null && disconnectedTransport.equals(getTransportForSession(SessionType.PCM))){ - //stopAudioStream(); - iSdlProtocol.stopStream(SessionType.PCM); + iSdlProtocol.onServiceError(null, SessionType.PCM, iSdlProtocol.getSessionId(), "Transport disconnected"); activeTransports.remove(SessionType.PCM); } @@ -1400,7 +1391,7 @@ public class SdlProtocolBase { }else if (frameInfo == FrameDataControlFrameType.StartSessionACK.getValue()) { - handleProtocolSessionStarted(packet, serviceType); + handleStartServiceACK(packet, serviceType); } else if (frameInfo == FrameDataControlFrameType.StartSessionNACK.getValue()) { @@ -1409,7 +1400,7 @@ public class SdlProtocolBase { } else if (frameInfo == FrameDataControlFrameType.EndSession.getValue() || frameInfo == FrameDataControlFrameType.EndSessionACK.getValue()) { - handleServiceEnded(packet,serviceType); + handleServiceEnded(packet, serviceType); } else if (frameInfo == FrameDataControlFrameType.EndSessionNACK.getValue()) { @@ -1417,7 +1408,7 @@ public class SdlProtocolBase { } else if (frameInfo == FrameDataControlFrameType.ServiceDataACK.getValue()) { - handleServiceDataACK(packet, serviceType); + //Currently unused } else if (frameInfo == FrameDataControlFrameType.RegisterSecondaryTransportACK.getValue()) { diff --git a/base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java b/base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java index 2a7473191..771ccfe7c 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.rpc.enums.Result;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java b/base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java index a3e1da573..a4183f01a 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java +++ b/base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.interfaces; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.livio.taskmaster.Taskmaster; import com.smartdevicelink.protocol.enums.FunctionID; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java index be6ffa130..c46fb4a7a 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommandResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommandResponse.java index 897f6918c..1f5c084bc 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommandResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommandResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java index 7d54aebe2..3751134e0 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenuResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenuResponse.java index 1f824c7e2..86893b1b4 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenuResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenuResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java index eeadd28a7..49fdf959e 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuverResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuverResponse.java index b630132af..4b4549979 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuverResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuverResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java index 8463c8920..a2fae73be 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppInfo.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppInfo.java index a54e8bdcf..a71d7b6e2 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppInfo.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppInfo.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceCapability.java index e582162f4..780ac13ed 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceCapability.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceCapability.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.ServiceUpdateReason; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceData.java index d5df5f75c..1a441a7fa 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceData.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceManifest.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceManifest.java index db0106e3d..9f2e4e2f6 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceManifest.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceManifest.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceRecord.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceRecord.java index 66524e237..198be4e26 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceRecord.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceRecord.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServicesCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServicesCapabilities.java index 36b14d8be..63d3dd6a5 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServicesCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServicesCapabilities.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.ServiceUpdateReason; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java index 4210c9c2b..7ee26175e 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java index 79396638a..38f2f80bb 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.AudioType;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java index 0abc83e8c..da346d0f9 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java index 4dfb7ec5d..a502e1df6 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.IgnitionStableStatus;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java index 41dcb774d..1a8cb4df9 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.ButtonName;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java index 1872138c5..645ae336d 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPressResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPressResponse.java index 2caa1f5f7..9611760a6 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPressResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPressResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CancelInteraction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CancelInteraction.java index 3fb02422c..7df082734 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/CancelInteraction.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CancelInteraction.java @@ -34,7 +34,7 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CancelInteractionResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CancelInteractionResponse.java index defab83c9..508185534 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/CancelInteractionResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CancelInteractionResponse.java @@ -34,7 +34,7 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java index 1dfe21e57..2087ea886 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistrationResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistrationResponse.java index a141680eb..8658dabba 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistrationResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistrationResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java index 8f78e1a20..931752c73 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.util.Version;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java index 8d229c30a..856087fda 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.DefrostZone; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CloseApplicationResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CloseApplicationResponse.java index be3811759..5fc5729e2 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/CloseApplicationResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CloseApplicationResponse.java @@ -34,7 +34,7 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CloudAppProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CloudAppProperties.java index 493083495..1c81ce95b 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/CloudAppProperties.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CloudAppProperties.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.HybridAppPreference; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java index 3252a860c..98aa2a060 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.CarModeStatus;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java index 3863b652a..970692dab 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.util.SdlDataTypeConverter; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java index af873e9a1..be638065b 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSetResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSetResponse.java index 370eff3b3..b7d89228f 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSetResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSetResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateWindow.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateWindow.java index d0ac5807c..6184bb059 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateWindow.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateWindow.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateWindowResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateWindowResponse.java index 733283462..bac8b6d4b 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateWindowResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateWindowResponse.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java index 5e9858985..8cd8e9c18 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java index 31c319101..e102e9427 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommandResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommandResponse.java index 608590ba6..3d6d94917 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommandResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommandResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java index 8f4985489..177171027 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java index 386c25028..d8876a692 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java index 6bec1ff67..e3d0d5c86 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSetResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSetResponse.java index b2457e876..34cc5fcd8 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSetResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSetResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java index 296e02897..e526013c8 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenuResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenuResponse.java index 40de5ba0c..88190cb13 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenuResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenuResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindow.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindow.java index 3c766deeb..4e78b95a7 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindow.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindow.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindowResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindowResponse.java index d943e860b..fee588426 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindowResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindowResponse.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java index 6a747f05b..8748014f2 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.DeviceLevelStatus;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java index ea71394ec..effba93a9 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java index 53b7a32e0..ce6492a64 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java index 1264f8efa..989617456 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumberResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumberResponse.java index d2c7f0531..057c4d02b 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumberResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumberResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java index 3d461e2d0..d1334f1ed 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.DisplayType;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java index cce644c6b..03c69af0a 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.ECallConfirmationStatus;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java index b66d4d931..6c22dc83d 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.EmergencyEventType;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java index 277cd236f..008530b3a 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java index a680cfdb0..81c7f100c 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java index d10c90bf5..baeecc2f4 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.CompassDirection;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java index 857322939..aae6e3517 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceData.java index aefb1ef41..9946de27a 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceData.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceDataResponse.java index c7aabd7fe..253626e9b 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceDataResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceDataResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppProperties.java index c08d4e92f..3348d4cb1 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppProperties.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppProperties.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppPropertiesResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppPropertiesResponse.java index 7f779feff..2c4eddeda 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppPropertiesResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppPropertiesResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java index 9a632d5db..939e1cdb6 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java index a0de6de5c..023abc3c5 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFile.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFile.java index b67782fa3..d1453ded1 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFile.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFile.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFileResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFileResponse.java index e5ed08a85..711de294c 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFileResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFileResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java index a2999ae3b..a6a323646 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsent.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsent.java index fd53bedf2..b4d3e02f3 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsent.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsent.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsentResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsentResponse.java index 684eba292..5c2b5c7e9 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsentResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsentResponse.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java index 7a85ac129..c504c5d24 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java index e27031182..8cb70d7aa 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java index f324de95f..ebaf547b8 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java index efbad98fe..ea3fc3496 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java @@ -240,6 +240,13 @@ import java.util.Hashtable; * <td>N</td>
* <td>SmartDeviceLink 7.0.0</td>
* </tr>
+ * <tr>
+ * <td>windowStatus</td>
+ * <td>Boolean</td>
+ * <td>See WindowStatus</td>
+ * <td>N</td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
* </table>
*
*
@@ -294,6 +301,7 @@ public class GetVehicleData extends RPCRequest { public static final String KEY_TURN_SIGNAL = "turnSignal";
public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
+ public static final String KEY_WINDOW_STATUS = "windowStatus";
public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
/**
@@ -567,6 +575,26 @@ public class GetVehicleData extends RPCRequest { }
/**
+ * Sets the windowStatus.
+ *
+ * @param windowStatus See WindowStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public void setWindowStatus(Boolean windowStatus) {
+ setParameters(KEY_WINDOW_STATUS, windowStatus);
+ }
+
+ /**
+ * Gets the windowStatus.
+ *
+ * @return Boolean See WindowStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public Boolean getWindowStatus() {
+ return getBoolean(KEY_WINDOW_STATUS);
+ }
+
+ /**
* Sets the handsOffSteering.
*
* @param handsOffSteering To indicate whether driver hands are off the steering wheel
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java index 82ff51bfd..a70082cd6 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java @@ -32,7 +32,7 @@ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
@@ -84,6 +84,7 @@ public class GetVehicleDataResponse extends RPCResponse { public static final String KEY_TURN_SIGNAL = "turnSignal";
public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
+ public static final String KEY_WINDOW_STATUS = "windowStatus";
public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
/**
@@ -393,6 +394,27 @@ public class GetVehicleDataResponse extends RPCResponse { }
/**
+ * Sets the windowStatus.
+ *
+ * @param windowStatus See WindowStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public void setWindowStatus(List<WindowStatus> windowStatus) {
+ setParameters(KEY_WINDOW_STATUS, windowStatus);
+ }
+
+ /**
+ * Gets the windowStatus.
+ *
+ * @return List<WindowStatus> See WindowStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<WindowStatus> getWindowStatus() {
+ return (List<WindowStatus>) getObject(WindowStatus.class, KEY_WINDOW_STATUS);
+ }
+
+ /**
* Sets the handsOffSteering.
*
* @param handsOffSteering To indicate whether driver hands are off the steering wheel
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java index ca23b990c..2146e3933 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java index 76fa76df2..7a4924dea 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Grid.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Grid.java index 2aced1a6f..e0c93369d 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Grid.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Grid.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java index aecb9853f..68a84d451 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.HMILevel;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java index c9a7d690f..d62b646ba 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java index a102f3eb1..c4458e547 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java index 719c957b4..abd0f10e0 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Image.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Image.java index 197265cad..ba9f25f5c 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Image.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Image.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.ImageType;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java index c52bd706c..de052a6f7 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.FileType;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java index 32e9a46fc..66841c773 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java index 93c526efa..6ecfca5c6 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.LightName; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java index a3b66467c..3cc66e67e 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java index 5f7323773..05bcb5fec 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java index 5009e4a44..0676b50da 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.LightName; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java index 715fa915c..cad593aba 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java index 4f0da27d8..6a4694a22 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.MassageCushion; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java index e60b2e953..1802c18c3 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.MassageMode; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java index 8b00d67c7..3ed8db072 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java index 26cf08684..1c1333102 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.ModuleType; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleInfo.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleInfo.java index fd7be795f..701fe6c09 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleInfo.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleInfo.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java index ba085e90b..c72b8a203 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.VehicleDataStatus;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationInstruction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationInstruction.java index d7e21b92d..bd7bbc0eb 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationInstruction.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationInstruction.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.Direction; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceData.java index 8f34697af..ae566c6e8 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceData.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java index 31ea950dd..30fe4e755 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppServiceData.java index 638488664..e959b78f4 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppServiceData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppServiceData.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCNotification; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java index 96c78abc1..d4e1b01b7 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java index 87bc01ff7..f66ca4000 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java index e4c55afb6..1f474bd30 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java index f6a328dcf..dc0b1b5e7 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java index 9970eb66a..ba2a5300b 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java index dda2d57d9..0abe4c1a8 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java index 0d05452c2..37c9d107c 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCNotification; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java index 2fd2b1221..d888c685b 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java index 82c49a1b3..bf72f5f19 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java index 7a9532e36..41e003981 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java index 08ffb803b..ffd7f03cc 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCNotification; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemCapabilityUpdated.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemCapabilityUpdated.java index 10f7fd7ce..d01bf757d 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemCapabilityUpdated.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemCapabilityUpdated.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCNotification; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java index 9c694a893..66f047384 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.marshal.JsonRPCMarshaller;
import com.smartdevicelink.protocol.enums.FunctionID;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java index f3e481039..c11eb1066 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java index 3982a8c3c..b898cc398 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java index 3c2626d9f..e3ab2f2ff 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java @@ -291,6 +291,13 @@ import java.util.List; * <td>N</td>
* <td>SmartDeviceLink 7.0.0</td>
* </tr>
+ * <tr>
+ * <td>windowStatus</td>
+ * <td>Boolean</td>
+ * <td>See WindowStatus</td>
+ * <td>N</td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
* </table>
*
* @since SmartDeviceLink 1.0
@@ -332,6 +339,7 @@ public class OnVehicleData extends RPCNotification { public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
+ public static final String KEY_WINDOW_STATUS = "windowStatus";
public OnVehicleData() {
@@ -609,6 +617,27 @@ public class OnVehicleData extends RPCNotification { }
/**
+ * Sets the windowStatus.
+ *
+ * @param windowStatus See WindowStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public void setWindowStatus(List<WindowStatus> windowStatus) {
+ setParameters(KEY_WINDOW_STATUS, windowStatus);
+ }
+
+ /**
+ * Gets the windowStatus.
+ *
+ * @return List<WindowStatus> See WindowStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<WindowStatus> getWindowStatus() {
+ return (List<WindowStatus>) getObject(WindowStatus.class, KEY_WINDOW_STATUS);
+ }
+
+ /**
* Sets the handsOffSteering.
*
* @param handsOffSteering To indicate whether driver hands are off the steering wheel
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java index 44d3475a1..f204b6998 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCNotification; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java index 99aa2f13b..4de4ad82c 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteraction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteraction.java index 24e58ab1e..a71f1b25a 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteraction.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteraction.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteractionResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteractionResponse.java index 7e0f77f6d..cc6d5c5f4 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteractionResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteractionResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java index 77d656beb..f9a4a29cb 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThruResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThruResponse.java index b676a7913..05d4683a7 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThruResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThruResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java index 5e253e540..129825f6c 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java index 55fa94ca2..20fec4c85 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java index 63d9624f7..ce0ec00a7 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java @@ -32,7 +32,7 @@ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java index acd2638bf..4b218e143 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppService.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppService.java index 35587c289..9c121bc22 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppService.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppService.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppServiceResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppServiceResponse.java index 8939e9084..6fcddfd47 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppServiceResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppServiceResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java index f756d414b..263ed65a1 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java index 70bb48157..f0c047325 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java index 22d1d892e..862b13e4b 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java index 83bef72af..553922e0f 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java index a7cd3ca57..41694c446 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java index d2545b5e5..fc7f16c26 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java index a7038b04f..ee741f7c1 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java index ca37339be..a8fc1e105 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReleaseInteriorVehicleDataModule.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReleaseInteriorVehicleDataModule.java index fb00c9779..807e239da 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReleaseInteriorVehicleDataModule.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReleaseInteriorVehicleDataModule.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReleaseInteriorVehicleDataModuleResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReleaseInteriorVehicleDataModuleResponse.java index 61d8df98a..a5badb253 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReleaseInteriorVehicleDataModuleResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReleaseInteriorVehicleDataModuleResponse.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java index daea6a7f8..a88ca2950 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalPropertiesResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalPropertiesResponse.java index 482b86fc4..70abb374d 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalPropertiesResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalPropertiesResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java index 1c6bdc241..a5b9e1525 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java index a3bb9a567..1ad0d0846 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessageResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessageResponse.java index 31f7518f0..2ed8ff352 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessageResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessageResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java index 0b800ba5e..8a2135753 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.util.Version;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java index d56a321a2..106edf2cb 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java index e63b09105..fbaf55fad 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.SupportedSeat; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java index bdd4f850e..af27805db 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.SeatMemoryActionType; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticDataResponse.java index 58761a4a5..6fcdd4b2c 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticDataResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticDataResponse.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocationResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocationResponse.java index f5e971533..ad2bca9b2 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocationResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocationResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java index 85ec49ab6..6443be188 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java index 1da9099dc..887d8564b 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppProperties.java index 204c42518..a457304e3 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppProperties.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppProperties.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppPropertiesResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppPropertiesResponse.java index 310bfbd43..e4851b399 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppPropertiesResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppPropertiesResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java index 562021544..937c8e8da 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java index 0d136daf6..011dcf6ac 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalPropertiesResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalPropertiesResponse.java index cb0d3f223..e2a24a2cd 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalPropertiesResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalPropertiesResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java index 396d700ce..130d1e277 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java index 1e756ade9..522d68046 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java index 4de5bfb05..67353132f 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java @@ -31,8 +31,8 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimerResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimerResponse.java index 8174152d8..e9d189350 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimerResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimerResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowAppMenuResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowAppMenuResponse.java index f9ba65c7b..749daaf13 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowAppMenuResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowAppMenuResponse.java @@ -35,7 +35,7 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbtResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbtResponse.java index e6e4a9f97..6af6a2d49 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbtResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbtResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowResponse.java index b1c8dc70a..44c67260c 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java index de2061e2c..7a0edfa3c 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java index 466879845..374c610fe 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java index d8bb5dc69..cad93b19b 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java index 8fa5166d1..bfafea14e 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java index 4fff09591..bdd2a0b9b 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.util.Version;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java index 71fedd4ca..a0c66a99f 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SpeakResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SpeakResponse.java index 59c7d3dbb..2fb47b6e0 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SpeakResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SpeakResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java index 875139153..96060d535 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java index d799847ce..3c830dd61 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButtonResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButtonResponse.java index 87ba0e235..1ffa58e57 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButtonResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButtonResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java index f705f71ea..4bdefeba9 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java @@ -280,6 +280,13 @@ import java.util.Hashtable; * <td>N</td>
* <td>SmartDeviceLink 7.0.0</td>
* </tr>
+ * <tr>
+ * <td>windowStatus</td>
+ * <td>Boolean</td>
+ * <td>See WindowStatus</td>
+ * <td>N</td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
* </table>
*
* <p> <b>Response</b></p>
@@ -330,6 +337,7 @@ public class SubscribeVehicleData extends RPCRequest { public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
+ public static final String KEY_WINDOW_STATUS = "windowStatus";
/**
* Constructs a new SubscribeVehicleData object
@@ -891,6 +899,26 @@ public class SubscribeVehicleData extends RPCRequest { }
/**
+ * Sets the windowStatus.
+ *
+ * @param windowStatus See WindowStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public void setWindowStatus(Boolean windowStatus) {
+ setParameters(KEY_WINDOW_STATUS, windowStatus);
+ }
+
+ /**
+ * Gets the windowStatus.
+ *
+ * @return Boolean See WindowStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public Boolean getWindowStatus() {
+ return getBoolean(KEY_WINDOW_STATUS);
+ }
+
+ /**
* Sets the handsOffSteering.
*
* @param handsOffSteering To indicate whether driver hands are off the steering wheel
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java index 8965a21f2..5a0909cd3 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
@@ -75,6 +75,7 @@ public class SubscribeVehicleDataResponse extends RPCResponse { public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
+ public static final String KEY_WINDOW_STATUS = "windowStatus";
/**
* Constructs a new SubscribeVehicleDataResponse object
@@ -552,4 +553,24 @@ public class SubscribeVehicleDataResponse extends RPCResponse { public VehicleDataResult getHandsOffSteering() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_HANDS_OFF_STEERING);
}
+
+ /**
+ * Sets the windowStatus.
+ *
+ * @param windowStatus See WindowStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public void setWindowStatus(VehicleDataResult windowStatus) {
+ setParameters(KEY_WINDOW_STATUS, windowStatus);
+ }
+
+ /**
+ * Gets the windowStatus.
+ *
+ * @return VehicleDataResult See WindowStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public VehicleDataResult getWindowStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WINDOW_STATUS);
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPointsResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPointsResponse.java index 1d9e2a6cd..f9a40fce7 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPointsResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPointsResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java index 314b6d0cc..470321627 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java index 90865585a..5c02cfe7d 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequestResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequestResponse.java index b1b0ce983..d2e68a2d5 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequestResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequestResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java index 8f73770a7..fbd526b30 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java index ac1503ee9..c2c809f13 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.TemperatureUnit; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateConfiguration.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateConfiguration.java index a92e8e28a..c82b4c481 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateConfiguration.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateConfiguration.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java index 497bd66ee..dc9907bad 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.CharacterSet;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java index 0767c2dc1..c5e2626b8 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.WarningLightStatus;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java index a7584ff4b..3e33369cf 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java index 625a3d462..47f29c0b1 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java index d52ca219b..423ae4fa2 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppService.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppService.java index 7ad2d8d55..6e509fe1f 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppService.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppService.java @@ -35,7 +35,7 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppServiceResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppServiceResponse.java index 01ae96d8a..a5b171930 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppServiceResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppServiceResponse.java @@ -35,7 +35,7 @@ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterfaceResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterfaceResponse.java index b5fa9b990..98e9121fe 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterfaceResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterfaceResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java index 860772861..48c287ea8 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButtonResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButtonResponse.java index 3bcfd4898..af0281e8e 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButtonResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButtonResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java index 38dcbc3ca..483602b0b 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java @@ -267,6 +267,13 @@ import java.util.Hashtable; * <td>N</td>
* <td>SmartDeviceLink 7.0.0</td>
* </tr>
+ * <tr>
+ * <td>windowStatus</td>
+ * <td>Boolean</td>
+ * <td>See WindowStatus</td>
+ * <td>N</td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
* </table>
* <p><b> Response</b></p>
* <p><b>Non-default Result Codes:</b></p>
@@ -315,6 +322,7 @@ public class UnsubscribeVehicleData extends RPCRequest { public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
+ public static final String KEY_WINDOW_STATUS = "windowStatus";
/**
* Constructs a new UnsubscribeVehicleData object
@@ -895,4 +903,24 @@ public class UnsubscribeVehicleData extends RPCRequest { public Boolean getHandsOffSteering() {
return getBoolean(KEY_HANDS_OFF_STEERING);
}
+
+ /**
+ * Sets the windowStatus.
+ *
+ * @param windowStatus See WindowStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public void setWindowStatus(Boolean windowStatus) {
+ setParameters(KEY_WINDOW_STATUS, windowStatus);
+ }
+
+ /**
+ * Gets the windowStatus.
+ *
+ * @return Boolean See WindowStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public Boolean getWindowStatus() {
+ return getBoolean(KEY_WINDOW_STATUS);
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java index d1270720d..c8e6d62d3 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
@@ -75,6 +75,7 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse { public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
+ public static final String KEY_WINDOW_STATUS = "windowStatus";
/**
* Constructs a new UnsubscribeVehicleDataResponse object
@@ -554,4 +555,24 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse { public VehicleDataResult getHandsOffSteering() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_HANDS_OFF_STEERING);
}
+
+ /**
+ * Sets the windowStatus.
+ *
+ * @param windowStatus See WindowStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public void setWindowStatus(VehicleDataResult windowStatus) {
+ setParameters(KEY_WINDOW_STATUS, windowStatus);
+ }
+
+ /**
+ * Gets the windowStatus.
+ *
+ * @return VehicleDataResult See WindowStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public VehicleDataResult getWindowStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WINDOW_STATUS);
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPointsResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPointsResponse.java index b49536bf2..11df9312e 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPointsResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPointsResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnListResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnListResponse.java index d29ffafc7..a19931d19 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnListResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnListResponse.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java index e467d0407..5e50f18e9 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java @@ -31,7 +31,7 @@ */
package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java index 0fc981672..92c16cebc 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java index fcfa55f5f..0acb5b8dd 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherAlert.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherAlert.java index 2e7b0a0cd..2d3afdfb4 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherAlert.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherAlert.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceData.java index 81e6586f0..9ae1d4e0d 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceData.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.proxy.rpc; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowState.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowState.java new file mode 100644 index 000000000..e17d9b7d9 --- /dev/null +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowState.java @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2017 - 2020, SmartDeviceLink Consortium, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the SmartDeviceLink Consortium Inc. nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.smartdevicelink.proxy.rpc; + +import androidx.annotation.NonNull; + +import com.smartdevicelink.proxy.RPCStruct; + +import java.util.Hashtable; + +/** + * + * <p><b>Parameter List</b></p> + * + * <table border="1" rules="all"> + * <tr> + * <th>Param Name</th> + * <th>Type</th> + * <th>Description</th> + * <th>Required</th> + * <th>Version Available</th> + * </tr> + * <tr> + * <td>approximatePosition</td> + * <td>Integer</td> + * <td>The approximate percentage that the window is open - 0 being fully closed, 100 being fullyopen</td> + * <td>Y</td> + * <td></td> + * </tr> + * <tr> + * <td>deviation</td> + * <td>Integer</td> + * <td>The percentage deviation of the approximatePosition. e.g. If the approximatePosition is 50and the deviation is 10, then the window's location is somewhere between 40 and 60.</td> + * <td>Y</td> + * <td></td> + * </tr> + * </table> + * @since SmartDeviceLink 7.0.0 + */ +public class WindowState extends RPCStruct { + public static final String KEY_APPROXIMATE_POSITION = "approximatePosition"; + public static final String KEY_DEVIATION = "deviation"; + + /** + * Constructs a new WindowState object + */ + public WindowState() { } + + /** + * Constructs a new WindowState object indicated by the Hashtable parameter + * + * @param hash The Hashtable to use + */ + public WindowState(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Constructs a new WindowState object + * + * @param approximatePosition The approximate percentage that the window is open - 0 being fully closed, 100 being fully + * open + * @param deviation The percentage deviation of the approximatePosition. e.g. If the approximatePosition is 50 + * and the deviation is 10, then the window's location is somewhere between 40 and 60. + */ + public WindowState(@NonNull Integer approximatePosition, @NonNull Integer deviation) { + this(); + setApproximatePosition(approximatePosition); + setDeviation(deviation); + } + + /** + * Sets the approximatePosition. + * + * @param approximatePosition The approximate percentage that the window is open - 0 being fully closed, 100 being fully + * open + */ + public void setApproximatePosition(@NonNull Integer approximatePosition) { + setValue(KEY_APPROXIMATE_POSITION, approximatePosition); + } + + /** + * Gets the approximatePosition. + * + * @return Integer The approximate percentage that the window is open - 0 being fully closed, 100 being fully + * open + */ + public Integer getApproximatePosition() { + return getInteger(KEY_APPROXIMATE_POSITION); + } + + /** + * Sets the deviation. + * + * @param deviation The percentage deviation of the approximatePosition. e.g. If the approximatePosition is 50 + * and the deviation is 10, then the window's location is somewhere between 40 and 60. + */ + public void setDeviation(@NonNull Integer deviation) { + setValue(KEY_DEVIATION, deviation); + } + + /** + * Gets the deviation. + * + * @return Integer The percentage deviation of the approximatePosition. e.g. If the approximatePosition is 50 + * and the deviation is 10, then the window's location is somewhere between 40 and 60. + */ + public Integer getDeviation() { + return getInteger(KEY_DEVIATION); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowStatus.java new file mode 100644 index 000000000..075d5f142 --- /dev/null +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowStatus.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2017 - 2020, SmartDeviceLink Consortium, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the SmartDeviceLink Consortium Inc. nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.smartdevicelink.proxy.rpc; + +import androidx.annotation.NonNull; + +import com.smartdevicelink.proxy.RPCStruct; + +import java.util.Hashtable; + +/** + * Describes the status of a window of a door/liftgate etc. + * + * <p><b>Parameter List</b></p> + * + * <table border="1" rules="all"> + * <tr> + * <th>Param Name</th> + * <th>Type</th> + * <th>Description</th> + * <th>Required</th> + * <th>Version Available</th> + * </tr> + * <tr> + * <td>location</td> + * <td>Grid</td> + * <td></td> + * <td>Y</td> + * <td></td> + * </tr> + * <tr> + * <td>state</td> + * <td>WindowState</td> + * <td></td> + * <td>Y</td> + * <td></td> + * </tr> + * </table> + * + * @since SmartDeviceLink 7.0.0 + */ +public class WindowStatus extends RPCStruct { + public static final String KEY_LOCATION = "location"; + public static final String KEY_STATE = "state"; + + /** + * Constructs a new WindowStatus object + */ + public WindowStatus() { } + + /** + * Constructs a new WindowStatus object indicated by the Hashtable parameter + * + * @param hash The Hashtable to use + */ + public WindowStatus(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Constructs a new WindowStatus object + * + * @param location + * @param state + */ + public WindowStatus(@NonNull Grid location, @NonNull WindowState state) { + this(); + setLocation(location); + setState(state); + } + + /** + * Sets the location. + * + * @param location + */ + public void setLocation(@NonNull Grid location) { + setValue(KEY_LOCATION, location); + } + + /** + * Gets the location. + * + * @return Grid + */ + public Grid getLocation() { + return (Grid) getObject(Grid.class, KEY_LOCATION); + } + + /** + * Sets the state. + * + * @param state + */ + public void setState(@NonNull WindowState state) { + setValue(KEY_STATE, state); + } + + /** + * Gets the state. + * + * @return WindowState + */ + public WindowState getState() { + return (WindowState) getObject(WindowState.class, KEY_STATE); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowTypeCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowTypeCapabilities.java index f57d9a415..4853a29a2 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowTypeCapabilities.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowTypeCapabilities.java @@ -1,6 +1,6 @@ package com.smartdevicelink.proxy.rpc;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.WindowType;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppHMIType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppHMIType.java index f15fa34c5..e34a8f431 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppHMIType.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppHMIType.java @@ -1,34 +1,34 @@ -/* - * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ +/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
package com.smartdevicelink.proxy.rpc.enums;
/**
@@ -81,6 +81,12 @@ public enum AppHMIType { * Remote Control
*/
REMOTE_CONTROL,
+ /**
+ * Web View
+ *
+ * @since SmartDeviceLink 7.0.0
+ */
+ WEB_VIEW
;
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppInterfaceUnregisteredReason.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppInterfaceUnregisteredReason.java index 31690e0ab..425671b64 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppInterfaceUnregisteredReason.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppInterfaceUnregisteredReason.java @@ -1,34 +1,34 @@ -/* - * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ +/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
package com.smartdevicelink.proxy.rpc.enums;
/**
@@ -119,6 +119,16 @@ public enum AppInterfaceUnregisteredReason { * @since SmartDeviceLink 4.1
*/
UNSUPPORTED_HMI_RESOURCE,
+
+
+ /**
+ * The application is unregistered due to hardware resource constraints.
+ * The system will shortly close the application to free up hardware resources
+ *
+ * @since SmartDeviceLink 7.0
+ *
+ */
+ RESOURCE_CONSTRAINT
;
/**
* Convert String to AppInterfaceUnregisteredReason
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java index 23439b007..ca130d38c 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java @@ -137,6 +137,12 @@ public enum PredefinedLayout { A layout with only a single large graphic */ LARGE_GRAPHIC_ONLY("LARGE_GRAPHIC_ONLY"), + + /** + * Custom root template allowing in-vehicle WebEngine applications with + * appropriate permissions to show the application's own web view. + */ + WEB_VIEW("WEB_VIEW") ; private final String VALUE; diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlDisconnectedReason.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlDisconnectedReason.java index e344fb87f..7513d56af 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlDisconnectedReason.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlDisconnectedReason.java @@ -1,34 +1,34 @@ -/* - * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ +/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
package com.smartdevicelink.proxy.rpc.enums;
public enum SdlDisconnectedReason {
@@ -43,6 +43,7 @@ public enum SdlDisconnectedReason { MASTER_RESET,
FACTORY_DEFAULTS,
TRANSPORT_ERROR,
+ RESOURCE_CONSTRAINT,
APPLICATION_REQUESTED_DISCONNECT,
DEFAULT,
TRANSPORT_DISCONNECT,
@@ -109,6 +110,9 @@ public enum SdlDisconnectedReason { case FACTORY_DEFAULTS:
returnReason = SdlDisconnectedReason.FACTORY_DEFAULTS;
break;
+ case RESOURCE_CONSTRAINT:
+ returnReason = SdlDisconnectedReason.RESOURCE_CONSTRAINT;
+ break;
default:
break;
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java index b9c43366b..07d1ace8d 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java @@ -171,8 +171,11 @@ public enum VehicleDataType { /**
* @since SmartDeviceLink 7.0.0
*/
- VEHICLEDATA_HANDSOFFSTEERING
- ;
+ VEHICLEDATA_HANDSOFFSTEERING,
+ /**
+ * @since SmartDeviceLink 7.0.0
+ */
+ VEHICLEDATA_WINDOWSTATUS;
/**
* Convert String to VehicleDataType
diff --git a/base/src/main/java/com/smartdevicelink/security/AbstractSdlSecurityBase.java b/base/src/main/java/com/smartdevicelink/security/AbstractSdlSecurityBase.java index 3f1c54a6a..55e0fae2f 100644 --- a/base/src/main/java/com/smartdevicelink/security/AbstractSdlSecurityBase.java +++ b/base/src/main/java/com/smartdevicelink/security/AbstractSdlSecurityBase.java @@ -77,11 +77,11 @@ abstract class AbstractSdlSecurityBase { session.onSecurityInitialized(); } - public void handleSdlSession(SdlSession val) { - if (val == null) return; + public void handleSdlSession(SdlSession sdlSession) { + if (sdlSession == null) return; - setSessionId(val.getSessionId()); - setSdlSession(val); + setSessionId((byte)sdlSession.getSessionId()); + setSdlSession(sdlSession); } private void setInitSuccess(boolean val) { diff --git a/base/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java b/base/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java deleted file mode 100644 index a031defec..000000000 --- a/base/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -package com.smartdevicelink.streaming; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.ByteBuffer; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; - -import com.smartdevicelink.SdlConnection.SdlSession; -import com.smartdevicelink.managers.CompletionListener; -import com.smartdevicelink.protocol.ProtocolMessage; -import com.smartdevicelink.protocol.enums.SessionType; -import com.smartdevicelink.proxy.interfaces.IAudioStreamListener; -import com.smartdevicelink.proxy.interfaces.IVideoStreamListener; -import com.smartdevicelink.util.DebugTool; - -public class StreamPacketizer extends AbstractPacketizer implements IVideoStreamListener, IAudioStreamListener, Runnable{ - - public final static String TAG = "StreamPacketizer"; - - private Thread t = null; - - - private final static int TLS_MAX_RECORD_SIZE = 16384; - private final static int TLS_RECORD_HEADER_SIZE = 5; - private final static int TLS_RECORD_MES_AUTH_CDE_SIZE = 32; - private final static int TLS_MAX_RECORD_PADDING_SIZE = 256; - - - private final static int BUFF_READ_SIZE = TLS_MAX_RECORD_SIZE - TLS_RECORD_HEADER_SIZE - TLS_RECORD_MES_AUTH_CDE_SIZE - TLS_MAX_RECORD_PADDING_SIZE; - - // Approximate size of data that mOutputQueue can hold in bytes. - // By adding a buffer, we accept underlying transport being stuck for a short time. By setting - // a limit of the buffer size, we avoid buffer overflows when underlying transport is too slow. - private static final int MAX_QUEUE_SIZE = 256 * 1024; - - private Object mPauseLock; - private boolean mPaused; - private boolean isServiceProtected = false; - private BlockingQueue<ByteBufferWithListener> mOutputQueue; - - public StreamPacketizer(IStreamListener streamListener, InputStream is, SessionType sType, byte rpcSessionID, SdlSession session) throws IOException { - super(streamListener, is, sType, rpcSessionID, session); - mPauseLock = new Object(); - mPaused = false; - isServiceProtected = _session.isServiceProtected(_serviceType); - if (bufferSize == 0) { - // fail safe - bufferSize = BUFF_READ_SIZE; - } - if(isServiceProtected){ //If our service is encrypted we can only use 1024 as the max buffer size. - bufferSize = BUFF_READ_SIZE; - buffer = new byte[bufferSize]; - } - mOutputQueue = new LinkedBlockingQueue<ByteBufferWithListener>(MAX_QUEUE_SIZE / bufferSize); - } - - public void start() throws IOException { - if (t == null) { - t = new Thread(this); - t.start(); - } - } - - public void stop() { - - if (t != null) - { - t.interrupt(); - t = null; - } - - } - - public void run() { - int length; - try - { - while (t != null && !t.isInterrupted()) - { - synchronized(mPauseLock) - { - while (mPaused) - { - try - { - mPauseLock.wait(); - } - catch (InterruptedException e) { - DebugTool.logError(TAG, "Streaming thread has been interrupted", e); - } - } - } - - if (is != null) { // using InputStream interface - length = is.read(buffer, 0, bufferSize); - - if (length >= 0) { - ProtocolMessage pm = new ProtocolMessage(); - pm.setSessionID(_rpcSessionID); - pm.setSessionType(_serviceType); - pm.setFunctionID(0); - pm.setCorrID(0); - pm.setData(buffer, length); - pm.setPayloadProtected(isServiceProtected); - - if (t != null && !t.isInterrupted()) { - _streamListener.sendStreamPacket(pm); - } - } - } else { // using sendFrame interface - ByteBufferWithListener byteBufferWithListener; - ByteBuffer frame; - CompletionListener completionListener; - try { - byteBufferWithListener = mOutputQueue.take(); - frame = byteBufferWithListener.byteBuffer; - completionListener = byteBufferWithListener.completionListener; - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - break; - } - - while (frame.hasRemaining()) { - int len = frame.remaining() > bufferSize ? bufferSize : frame.remaining(); - - ProtocolMessage pm = new ProtocolMessage(); - pm.setSessionID(_rpcSessionID); - pm.setSessionType(_serviceType); - pm.setFunctionID(0); - pm.setCorrID(0); - pm.setData(frame.array(), frame.arrayOffset() + frame.position(), len); - pm.setPayloadProtected(isServiceProtected); - - if (t != null && !t.isInterrupted()) { - _streamListener.sendStreamPacket(pm); - } - - frame.position(frame.position() + len); - } - - if (!frame.hasRemaining() && completionListener != null){ - completionListener.onComplete(true); - } - } - } - } catch (IOException e) - { - e.printStackTrace(); - } - finally - { - if(_session != null) { - _session.endService(_serviceType,_rpcSessionID); - } - - - } - } - - @Override - public void pause() { - synchronized (mPauseLock) { - mPaused = true; - } - } - - @Override - public void resume() { - synchronized (mPauseLock) { - mPaused = false; - mPauseLock.notifyAll(); - } - } - - /** - * Called by the app. - * - * @see IVideoStreamListener#sendFrame(byte[], int, int, long) - */ - @Override - public void sendFrame(byte[] data, int offset, int length, long presentationTimeUs) - throws ArrayIndexOutOfBoundsException { - sendArrayData(data, offset, length); - } - - /** - * Called by the app. - * - * @see IVideoStreamListener#sendFrame(ByteBuffer, long) - */ - @Override - public void sendFrame(ByteBuffer data, long presentationTimeUs) { - sendByteBufferData(data, null); - } - - /** - * Called by the app. - * - * @see IAudioStreamListener#sendAudio(byte[], int, int, long) - */ - @Override - public void sendAudio(byte[] data, int offset, int length, long presentationTimeUs) - throws ArrayIndexOutOfBoundsException { - sendArrayData(data, offset, length); - } - - /** - * Called by the app. - * - * @see IAudioStreamListener#sendAudio(ByteBuffer, long) - */ - @Deprecated - @Override - public void sendAudio(ByteBuffer data, long presentationTimeUs) { - sendByteBufferData(data, null); - } - - @Override - public void sendAudio(ByteBuffer data, long presentationTimeUs, CompletionListener completionListener) { - sendByteBufferData(data, completionListener); - } - - private void sendArrayData(byte[] data, int offset, int length) - throws ArrayIndexOutOfBoundsException { - if (offset < 0 || offset > data.length || length <= 0 || offset + length > data.length) { - throw new ArrayIndexOutOfBoundsException(); - } - - // StreamPacketizer does not need to split a video frame into NAL units - ByteBuffer buffer = ByteBuffer.allocate(length); - buffer.put(data, offset, length); - buffer.flip(); - - try { - mOutputQueue.put(new ByteBufferWithListener(buffer, null)); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - - private void sendByteBufferData(ByteBuffer data, CompletionListener completionListener) { - if (data == null || data.remaining() == 0) { - return; - } - - // copy the whole buffer, so that even if the app modifies original ByteBuffer after - // sendFrame() or sendAudio() call, our buffer will stay intact - ByteBuffer buffer = ByteBuffer.allocate(data.remaining()); - buffer.put(data); - buffer.flip(); - - try { - mOutputQueue.put(new ByteBufferWithListener(buffer, completionListener)); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - - - private class ByteBufferWithListener{ - ByteBuffer byteBuffer; - CompletionListener completionListener; - ByteBufferWithListener (ByteBuffer byteBuffer, CompletionListener completionListener){ - this.byteBuffer = byteBuffer; - this.completionListener = completionListener; - } - } -} diff --git a/base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java b/base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java index 2da7b5133..9236be7a9 100644 --- a/base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java +++ b/base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java @@ -246,7 +246,7 @@ public class RTPH264Packetizer extends AbstractPacketizer implements IVideoStrea // XXX: This is added to sync with StreamPacketizer. Actually it shouldn't be here since // it's confusing that a packetizer takes care of End Service request. if (_session != null) { - _session.endService(_serviceType, _rpcSessionID); + _session.endService(_serviceType); } } diff --git a/base/src/main/java/com/smartdevicelink/trace/SdlTrace.java b/base/src/main/java/com/smartdevicelink/trace/SdlTraceBase.java index 4e654603b..bbddd6453 100644 --- a/base/src/main/java/com/smartdevicelink/trace/SdlTrace.java +++ b/base/src/main/java/com/smartdevicelink/trace/SdlTraceBase.java @@ -1,452 +1,444 @@ -/* - * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -package com.smartdevicelink.trace; - - - -import com.smartdevicelink.protocol.SdlPacket; -import com.smartdevicelink.protocol.enums.FrameDataControlFrameType; -import com.smartdevicelink.protocol.enums.FrameType; -import com.smartdevicelink.protocol.enums.SessionType; -import com.smartdevicelink.proxy.RPCMessage; -import com.smartdevicelink.proxy.RPCRequest; -import com.smartdevicelink.proxy.RPCResponse; -import com.smartdevicelink.trace.enums.DetailLevel; -import com.smartdevicelink.trace.enums.InterfaceActivityDirection; -import com.smartdevicelink.trace.enums.Mod; -import com.smartdevicelink.transport.SiphonServer; -import com.smartdevicelink.util.BitConverter; -import com.smartdevicelink.util.DebugTool; -import com.smartdevicelink.util.NativeLogTool; - -/* This class handles the global TraceSettings as requested by the users either through the combination of the following - 1. System defaults - 2. Application XML config - 3. Programmatic requests from application itself - - It is manifested in the <SmartDeviceLink>...</SmartDeviceLink> tags - */ - -//@SuppressLint("DefaultLocale") -public class SdlTrace { - private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66"; - - public static final String SYSTEM_LOG_TAG = "SdlTrace"; - - private static long baseTics = System.currentTimeMillis(); - private static boolean acceptAPITraceAdjustments = true; - - protected static ISTListener m_appTraceListener = null; - - /// - /// The PUBLIC interface to SdlTrace starts here - /// - - - public static void setAcceptAPITraceAdjustments(Boolean APITraceAdjustmentsAccepted) { - if (APITraceAdjustmentsAccepted != null) { - acceptAPITraceAdjustments = APITraceAdjustmentsAccepted; - } - } - - public static boolean getAcceptAPITraceAdjustments() { - return acceptAPITraceAdjustments; - } - - public static void setAppTraceListener(ISTListener listener) { - m_appTraceListener = listener; - } // end-method - - public static void setAppTraceLevel(DetailLevel dt) { - if ( dt != null && acceptAPITraceAdjustments) - DiagLevel.setLevel(Mod.app, dt); - } // end-method - - public static void setProxyTraceLevel(DetailLevel dt) { - if (dt != null && acceptAPITraceAdjustments) - DiagLevel.setLevel(Mod.proxy, dt); - } // end-method - - public static void setRpcTraceLevel(DetailLevel dt) { - if (dt != null && acceptAPITraceAdjustments) - DiagLevel.setLevel(Mod.rpc, dt); - } // end-method - - public static void setMarshallingTraceLevel(DetailLevel dt) { - if (dt != null && acceptAPITraceAdjustments) - DiagLevel.setLevel(Mod.mar, dt); - } // end-method - - public static void setProtocolTraceLevel(DetailLevel dt) { - if (dt != null && acceptAPITraceAdjustments) - DiagLevel.setLevel(Mod.proto, dt); - } // end-method - - public static void setTransportTraceLevel(DetailLevel dt) { - if (dt != null && acceptAPITraceAdjustments) - DiagLevel.setLevel(Mod.tran, dt); - } // end-method - - private static String getPid(){ - //Default implementation is not able to get this information - return "UNKNOWN"; - } - - private static String encodeTraceMessage(long timestamp, Mod module, InterfaceActivityDirection msgDirection, String msgBodyXml) { - StringBuilder sb = new StringBuilder("<msg><dms>"); - sb.append(timestamp); - sb.append("</dms><pid>"); - sb.append(getPid()); - sb.append("</pid><tid>"); - sb.append(Thread.currentThread().getId()); - sb.append("</tid><mod>"); - sb.append(module.toString()); - sb.append("</mod>"); - if (msgDirection != InterfaceActivityDirection.None) { - sb.append("<dir>"); - sb.append(interfaceActivityDirectionToString(msgDirection)); - sb.append("</dir>"); - } // end-if - sb.append(msgBodyXml); - sb.append("</msg>"); - - return sb.toString(); - } // end-method - - private static String interfaceActivityDirectionToString(InterfaceActivityDirection iaDirection) { - String str = ""; - switch (iaDirection) { - case Receive: - str = "rx"; - break; - case Transmit: - str = "tx"; - break; - default: - break; - } // end-switch - return str; - } // end-method - - static String B64EncodeForXML(String data) { - return Mime.base64Encode(data); - // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: return Base64.encodeToString(data.getBytes(), Base64.DEFAULT); - } // end-method - - public static boolean logProxyEvent(String eventText, String token) { - if (DiagLevel.getLevel(Mod.proxy) == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) { - return false; - } - - String msg = SdlTrace.B64EncodeForXML(eventText); - String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.proxy, InterfaceActivityDirection.None, "<d>" + msg + "</d>"); - return writeXmlTraceMessage(xml); - } - - public static boolean logAppEvent(String eventText) { - if (DiagLevel.getLevel(Mod.app) == DetailLevel.OFF) { - return false; - } - - long timestamp = SdlTrace.getBaseTicsDelta(); - String msg = SdlTrace.B64EncodeForXML(eventText); - String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.app, InterfaceActivityDirection.None, "<d>" + msg + "</d>"); - return writeXmlTraceMessage(xml); - } - - public static boolean logRPCEvent(InterfaceActivityDirection msgDirection, RPCMessage rpcMsg, String token) { - DetailLevel dl = DiagLevel.getLevel(Mod.rpc); - if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) { - return false; - } - - long timestamp = SdlTrace.getBaseTicsDelta(); - String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.rpc, msgDirection, rpc2Xml(dl, rpcMsg)); - return writeXmlTraceMessage(xml); - } - - private static String rpc2Xml(DetailLevel dl, RPCMessage rpcMsg) { - StringBuilder rpcAsXml = new StringBuilder(); - rpcAsXml.append("<op>"); - rpcAsXml.append(rpcMsg.getFunctionName()); - rpcAsXml.append("</op>"); - boolean hasCorrelationID = false; - Integer correlationID = -1; - if (rpcMsg instanceof RPCRequest) { - hasCorrelationID = true; - correlationID = ((RPCRequest)rpcMsg).getCorrelationID(); - } else if (rpcMsg instanceof RPCResponse) { - hasCorrelationID = true; - correlationID = ((RPCResponse)rpcMsg).getCorrelationID(); - } // end-if - if (hasCorrelationID) { - rpcAsXml.append("<cid>"); - rpcAsXml.append(correlationID); - rpcAsXml.append("</cid>"); - } // end-if - rpcAsXml.append("<type>"); - rpcAsXml.append(rpcMsg.getMessageType()); - rpcAsXml.append("</type>"); - //rpcAsXml.append(newline); - - if (dl == DetailLevel.VERBOSE) { - OpenRPCMessage orpcmsg = new OpenRPCMessage(rpcMsg); - String rpcParamList = orpcmsg.msgDump(); - String msg = SdlTrace.B64EncodeForXML(rpcParamList); - rpcAsXml.append("<d>"); - rpcAsXml.append(msg); - rpcAsXml.append("</d>"); - } // end-if - return rpcAsXml.toString(); - } // end-method - - public static boolean logMarshallingEvent(InterfaceActivityDirection msgDirection, byte[] marshalledMessage, String token) { - DetailLevel dl = DiagLevel.getLevel(Mod.mar); - if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) { - return false; - } - - long timestamp = SdlTrace.getBaseTicsDelta(); - StringBuilder msg = new StringBuilder(); - msg.append("<sz>"); - msg.append(marshalledMessage.length); - msg.append("</sz>"); - if (dl == DetailLevel.VERBOSE) { - msg.append("<d>"); - msg.append(Mime.base64Encode(marshalledMessage)); - // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: msg.append(Base64.encodeToString(marshalledMessage, Base64.DEFAULT)); - msg.append("</d>"); - } - String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.mar, msgDirection, msg.toString()); - return writeXmlTraceMessage(xml); - } - - public static boolean logProtocolEvent(InterfaceActivityDirection frameDirection, SdlPacket packet, int frameDataOffset, int frameDataLength, String token) { - DetailLevel dl = DiagLevel.getLevel(Mod.proto); - if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) { - return false; - } - - StringBuffer protoMsg = new StringBuffer(); - protoMsg.append("<frame>"); - protoMsg.append(SdlTrace.getProtocolFrameHeaderInfo(packet)); - if (dl == DetailLevel.VERBOSE) { - if (packet.getPayload() != null && frameDataLength > 0) { - protoMsg.append("<d>"); - String bytesInfo = ""; - bytesInfo = Mime.base64Encode(packet.getPayload(), frameDataOffset, frameDataLength); - // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: bytesInfo = Base64.encodeToString(frameData, frameDataOffset, frameDataLength, Base64.DEFAULT); - protoMsg.append(bytesInfo); - protoMsg.append("</d>"); - } - } - protoMsg.append("</frame>"); - String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.proto, frameDirection, protoMsg.toString()); - return writeXmlTraceMessage(xml); - } - - private static String getProtocolFrameType(FrameType f) { - if (f == FrameType.Control) - return "Control"; - else if (f == FrameType.Consecutive) - return "Consecutive"; - else if (f == FrameType.First) - return "First"; - else if (f == FrameType.Single) - return "Single"; - - return "Unknown"; - } // end-method - - private static String getProtocolSessionType(SessionType serviceType) { - String s; - if (serviceType == SessionType.RPC ) - s = "rpc"; - else if (serviceType == SessionType.BULK_DATA) - s = "bulk"; - else - s = "Unknown"; - return s; - } // end-method - - private static String getProtocolFrameHeaderInfo(SdlPacket hdr) { - StringBuilder sb = new StringBuilder(); - sb.append("<hdr>"); - sb.append("<ver>"); - sb.append(hdr.getVersion()); - sb.append("</ver><cmp>"); - sb.append(hdr.isEncrypted()); - sb.append("</cmp><ft>"); - sb.append(getProtocolFrameType(hdr.getFrameType())); - sb.append("</ft><st>"); - sb.append(getProtocolSessionType(SessionType.valueOf((byte)hdr.getServiceType()))); - sb.append("</st><sid>"); - sb.append(hdr.getSessionId()); - sb.append("</sid><sz>"); - sb.append(hdr.getDataSize()); - sb.append("</sz>"); - - int frameData = hdr.getFrameInfo(); - if (hdr.getFrameType() == FrameType.Control) { - sb.append("<ca>"); - if (frameData == FrameDataControlFrameType.StartSession.getValue()) - sb.append("StartSession"); - else if (frameData == FrameDataControlFrameType.StartSessionACK.getValue()) - sb.append("StartSessionACK"); - else if (frameData == FrameDataControlFrameType.StartSessionNACK.getValue()) - sb.append("StartSessionNACK"); - else if (frameData == FrameDataControlFrameType.EndSession.getValue()) - sb.append("EndSession"); - sb.append("</ca>"); - } else if (hdr.getFrameType() == FrameType.Consecutive ) { - sb.append("<fsn>"); - if (frameData == 0 ) - sb.append("lastFrame"); - else - sb.append(String.format("%02X",frameData)); - sb.append("</fsn>"); - } else if (hdr.getFrameType() == FrameType.First ) { - int totalSize = BitConverter.intFromByteArray(hdr.getPayload(), 0); - int numFrames = BitConverter.intFromByteArray(hdr.getPayload(), 4); - sb.append("<total>" + totalSize + "</total><numframes>" + numFrames + "</numframes>"); - } else if (hdr.getFrameType() == FrameType.Single ) { - sb.append("<single/>"); - } - - sb.append("</hdr>"); - - return sb.toString(); - } // end-method - - public static boolean logTransportEvent(String preamble, String transportSpecificInfoXml, InterfaceActivityDirection msgDirection, byte buf[], int byteLength, String token) { - return logTransportEvent(preamble, transportSpecificInfoXml, msgDirection, buf, 0, byteLength, token); - } - - private static void checkB64(String x, byte[] buf, int offset, int byteLength) { - if ((x.length() % 4) != 0) { - NativeLogTool.logWarning(SdlTrace.SYSTEM_LOG_TAG, "b64 string length (" + x.length() + ") isn't multiple of 4: buf.length=" + buf.length + ", offset=" + offset + ", len=" + byteLength); - } // end-if - } // end-method - - public static boolean logTransportEvent(String preamble, String transportSpecificInfoXml, InterfaceActivityDirection msgDirection, byte buf[], int offset, int byteLength, String token) { - if (DiagLevel.getLevel(Mod.tran) == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) { - return false; - } - - StringBuilder msg = new StringBuilder(); - if (transportSpecificInfoXml != null && transportSpecificInfoXml.length() > 0) { - msg.append(transportSpecificInfoXml); - } - if (preamble != null && preamble.length() > 0) { - msg.append("<desc>"); - msg.append(preamble); - msg.append("</desc>"); - } - if (buf != null) { - msg.append("<sz>"); - msg.append(byteLength); - msg.append("</sz>"); - DetailLevel dl = DiagLevel.getLevel(Mod.tran); - if (dl == DetailLevel.VERBOSE) { - if (buf != null && byteLength > 0) { - msg.append("<d>"); - String bytesInfo = Mime.base64Encode(buf, offset, byteLength); - checkB64(bytesInfo, buf, offset, byteLength); - msg.append(bytesInfo); - msg.append("</d>"); - } - } - } - String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.tran, msgDirection, msg.toString()); - return writeXmlTraceMessage(xml); - } - - // Package-scoped - static long getBaseTicsDelta() { - return System.currentTimeMillis() - getBaseTics(); - } - - // Package-scoped - static long getBaseTics() { - return baseTics; - } // end-method - - public static Boolean writeMessageToSiphonServer(String info) { - return SiphonServer.sendFormattedTraceMessage(info); - } - - private static boolean writeXmlTraceMessage(String msg) { - try { - // Attempt to write formatted message to the Siphon - if (false == writeMessageToSiphonServer(msg)) { - // If writing to the Siphon fails, write to the native log - NativeLogTool.logInfo(SdlTrace.SYSTEM_LOG_TAG, msg); - return false; - } - - ISTListener localTraceListener = m_appTraceListener; - - if (localTraceListener != null) { - try { - localTraceListener.logXmlMsg(msg, SDL_LIB_TRACE_KEY); - } catch (Exception ex) { - DebugTool.logError(SYSTEM_LOG_TAG,"Failure calling ISTListener: " + ex.toString(), ex); - return false; - } - } - } catch (Exception ex) { - NativeLogTool.logError(SdlTrace.SYSTEM_LOG_TAG, "Failure writing XML trace message: " + ex.toString()); - return false; - } - return true; - } - - - - - private static String getSmartDeviceLinkTraceRoot(String dumpReason, int seqNo) { - StringBuilder write = new StringBuilder("<SmartDeviceLinktraceroot>" + "<sequencenum>" + seqNo - + "</sequencenum>" + "<dumpreason>" + dumpReason - + "</dumpreason><tracelevel>"); - - write.append("<tran>" + DiagLevel.getLevel(Mod.tran) + "</tran>"); - write.append("<proto>" + DiagLevel.getLevel(Mod.proto) + "</proto>"); - write.append("<mar>" + DiagLevel.getLevel(Mod.mar) + "</mar>"); - write.append("<rpc>" + DiagLevel.getLevel(Mod.rpc) + "</rpc>"); - write.append("<proxy>" + DiagLevel.getLevel(Mod.proxy) + "</proxy>"); - write.append("<app>" + DiagLevel.getLevel(Mod.app) + "</app>"); - - write.append("</tracelevel>"); - write.append("</SmartDeviceLinktraceroot>"); - return write.toString(); - } // end-method +/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.trace;
+
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
+import com.smartdevicelink.protocol.enums.FrameType;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.trace.enums.DetailLevel;
+import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
+import com.smartdevicelink.trace.enums.Mod;
+import com.smartdevicelink.transport.SiphonServer;
+import com.smartdevicelink.util.BitConverter;
+import com.smartdevicelink.util.DebugTool;
+import com.smartdevicelink.util.NativeLogTool;
+
+/* This class handles the global TraceSettings as requested by the users either through the combination of the following
+ 1. System defaults
+ 2. Application XML config
+ 3. Programmatic requests from application itself
+
+ It is manifested in the <SmartDeviceLink>...</SmartDeviceLink> tags
+ */
+
+class SdlTraceBase {
+ private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
+
+ public static final String SYSTEM_LOG_TAG = "SdlTrace";
+
+ private static long baseTics = java.lang.System.currentTimeMillis();
+ private static boolean acceptAPITraceAdjustments = true;
+
+ protected static ISTListener m_appTraceListener = null;
+
+ ///
+ /// The PUBLIC interface to SdlTrace starts here
+ ///
+
+ public static void setAcceptAPITraceAdjustments(Boolean APITraceAdjustmentsAccepted) {
+ if (APITraceAdjustmentsAccepted != null) {
+ acceptAPITraceAdjustments = APITraceAdjustmentsAccepted;
+ }
+ }
+
+ public static boolean getAcceptAPITraceAdjustments() {
+ return acceptAPITraceAdjustments;
+ }
+
+ public static void setAppTraceListener(ISTListener listener) {
+ m_appTraceListener = listener;
+ } // end-method
+
+ public static void setAppTraceLevel(DetailLevel dt) {
+ if ( dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.app, dt);
+ } // end-method
+
+ public static void setProxyTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.proxy, dt);
+ } // end-method
+
+ public static void setRpcTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.rpc, dt);
+ } // end-method
+
+ public static void setMarshallingTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.mar, dt);
+ } // end-method
+
+ public static void setProtocolTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.proto, dt);
+ } // end-method
+
+ public static void setTransportTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.tran, dt);
+ } // end-method
+
+ private static String getPid() {
+ return "UNKNOWN";
+ }
+
+ private static String encodeTraceMessage(long timestamp, Mod module, InterfaceActivityDirection msgDirection, String msgBodyXml) {
+ StringBuilder sb = new StringBuilder("<msg><dms>");
+ sb.append(timestamp);
+ sb.append("</dms><pid>");
+ sb.append(getPid());
+ sb.append("</pid><tid>");
+ sb.append(Thread.currentThread().getId());
+ sb.append("</tid><mod>");
+ sb.append(module.toString());
+ sb.append("</mod>");
+ if (msgDirection != InterfaceActivityDirection.None) {
+ sb.append("<dir>");
+ sb.append(interfaceActivityDirectionToString(msgDirection));
+ sb.append("</dir>");
+ } // end-if
+ sb.append(msgBodyXml);
+ sb.append("</msg>");
+
+ return sb.toString();
+ } // end-method
+
+ private static String interfaceActivityDirectionToString(InterfaceActivityDirection iaDirection) {
+ String str = "";
+ switch (iaDirection) {
+ case Receive:
+ str = "rx";
+ break;
+ case Transmit:
+ str = "tx";
+ break;
+ default:
+ break;
+ } // end-switch
+ return str;
+ } // end-method
+
+ static String B64EncodeForXML(String data) {
+ return Mime.base64Encode(data);
+ // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: return Base64.encodeToString(data.getBytes(), Base64.DEFAULT);
+ } // end-method
+
+ public static boolean logProxyEvent(String eventText, String token) {
+ if (DiagLevel.getLevel(Mod.proxy) == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ String msg = SdlTrace.B64EncodeForXML(eventText);
+ String xml = SdlTraceBase.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.proxy, InterfaceActivityDirection.None, "<d>" + msg + "</d>");
+ return writeXmlTraceMessage(xml);
+ }
+
+ public static boolean logAppEvent(String eventText) {
+ if (DiagLevel.getLevel(Mod.app) == DetailLevel.OFF) {
+ return false;
+ }
+
+ long timestamp = SdlTrace.getBaseTicsDelta();
+ String msg = SdlTrace.B64EncodeForXML(eventText);
+ String xml = SdlTraceBase.encodeTraceMessage(timestamp, Mod.app, InterfaceActivityDirection.None, "<d>" + msg + "</d>");
+ return writeXmlTraceMessage(xml);
+ }
+
+ public static boolean logRPCEvent(InterfaceActivityDirection msgDirection, RPCMessage rpcMsg, String token) {
+ DetailLevel dl = DiagLevel.getLevel(Mod.rpc);
+ if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ long timestamp = SdlTrace.getBaseTicsDelta();
+ String xml = SdlTraceBase.encodeTraceMessage(timestamp, Mod.rpc, msgDirection, rpc2Xml(dl, rpcMsg));
+ return writeXmlTraceMessage(xml);
+ }
+
+ private static String rpc2Xml(DetailLevel dl, RPCMessage rpcMsg) {
+ StringBuilder rpcAsXml = new StringBuilder();
+ rpcAsXml.append("<op>");
+ rpcAsXml.append(rpcMsg.getFunctionName());
+ rpcAsXml.append("</op>");
+ boolean hasCorrelationID = false;
+ Integer correlationID = -1;
+ if (rpcMsg instanceof RPCRequest) {
+ hasCorrelationID = true;
+ correlationID = ((RPCRequest)rpcMsg).getCorrelationID();
+ } else if (rpcMsg instanceof RPCResponse) {
+ hasCorrelationID = true;
+ correlationID = ((RPCResponse)rpcMsg).getCorrelationID();
+ } // end-if
+ if (hasCorrelationID) {
+ rpcAsXml.append("<cid>");
+ rpcAsXml.append(correlationID);
+ rpcAsXml.append("</cid>");
+ } // end-if
+ rpcAsXml.append("<type>");
+ rpcAsXml.append(rpcMsg.getMessageType());
+ rpcAsXml.append("</type>");
+ //rpcAsXml.append(newline);
+
+ if (dl == DetailLevel.VERBOSE) {
+ OpenRPCMessage orpcmsg = new OpenRPCMessage(rpcMsg);
+ String rpcParamList = orpcmsg.msgDump();
+ String msg = SdlTrace.B64EncodeForXML(rpcParamList);
+ rpcAsXml.append("<d>");
+ rpcAsXml.append(msg);
+ rpcAsXml.append("</d>");
+ } // end-if
+ return rpcAsXml.toString();
+ } // end-method
+
+ public static boolean logMarshallingEvent(InterfaceActivityDirection msgDirection, byte[] marshalledMessage, String token) {
+ DetailLevel dl = DiagLevel.getLevel(Mod.mar);
+ if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ long timestamp = SdlTrace.getBaseTicsDelta();
+ StringBuilder msg = new StringBuilder();
+ msg.append("<sz>");
+ msg.append(marshalledMessage.length);
+ msg.append("</sz>");
+ if (dl == DetailLevel.VERBOSE) {
+ msg.append("<d>");
+ msg.append(Mime.base64Encode(marshalledMessage));
+ // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: msg.append(Base64.encodeToString(marshalledMessage, Base64.DEFAULT));
+ msg.append("</d>");
+ }
+ String xml = SdlTraceBase.encodeTraceMessage(timestamp, Mod.mar, msgDirection, msg.toString());
+ return writeXmlTraceMessage(xml);
+ }
+
+ public static boolean logProtocolEvent(InterfaceActivityDirection frameDirection, SdlPacket packet, int frameDataOffset, int frameDataLength, String token) {
+ DetailLevel dl = DiagLevel.getLevel(Mod.proto);
+ if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ StringBuffer protoMsg = new StringBuffer();
+ protoMsg.append("<frame>");
+ protoMsg.append(SdlTraceBase.getProtocolFrameHeaderInfo(packet));
+ if (dl == DetailLevel.VERBOSE) {
+ if (packet.getPayload() != null && frameDataLength > 0) {
+ protoMsg.append("<d>");
+ String bytesInfo = "";
+ bytesInfo = Mime.base64Encode(packet.getPayload(), frameDataOffset, frameDataLength);
+ // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: bytesInfo = Base64.encodeToString(frameData, frameDataOffset, frameDataLength, Base64.DEFAULT);
+ protoMsg.append(bytesInfo);
+ protoMsg.append("</d>");
+ }
+ }
+ protoMsg.append("</frame>");
+ String xml = SdlTraceBase.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.proto, frameDirection, protoMsg.toString());
+ return writeXmlTraceMessage(xml);
+ }
+
+ private static String getProtocolFrameType(FrameType f) {
+ if (f == FrameType.Control)
+ return "Control";
+ else if (f == FrameType.Consecutive)
+ return "Consecutive";
+ else if (f == FrameType.First)
+ return "First";
+ else if (f == FrameType.Single)
+ return "Single";
+
+ return "Unknown";
+ } // end-method
+
+ private static String getProtocolSessionType(SessionType serviceType) {
+ String s;
+ if (serviceType == SessionType.RPC )
+ s = "rpc";
+ else if (serviceType == SessionType.BULK_DATA)
+ s = "bulk";
+ else
+ s = "Unknown";
+ return s;
+ } // end-method
+
+ private static String getProtocolFrameHeaderInfo(SdlPacket hdr) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("<hdr>");
+ sb.append("<ver>");
+ sb.append(hdr.getVersion());
+ sb.append("</ver><cmp>");
+ sb.append(hdr.isEncrypted());
+ sb.append("</cmp><ft>");
+ sb.append(getProtocolFrameType(hdr.getFrameType()));
+ sb.append("</ft><st>");
+ sb.append(getProtocolSessionType(SessionType.valueOf((byte)hdr.getServiceType())));
+ sb.append("</st><sid>");
+ sb.append(hdr.getSessionId());
+ sb.append("</sid><sz>");
+ sb.append(hdr.getDataSize());
+ sb.append("</sz>");
+
+ int frameData = hdr.getFrameInfo();
+ if (hdr.getFrameType() == FrameType.Control) {
+ sb.append("<ca>");
+ if (frameData == FrameDataControlFrameType.StartSession.getValue())
+ sb.append("StartSession");
+ else if (frameData == FrameDataControlFrameType.StartSessionACK.getValue())
+ sb.append("StartSessionACK");
+ else if (frameData == FrameDataControlFrameType.StartSessionNACK.getValue())
+ sb.append("StartSessionNACK");
+ else if (frameData == FrameDataControlFrameType.EndSession.getValue())
+ sb.append("EndSession");
+ sb.append("</ca>");
+ } else if (hdr.getFrameType() == FrameType.Consecutive ) {
+ sb.append("<fsn>");
+ if (frameData == 0 )
+ sb.append("lastFrame");
+ else
+ sb.append(String.format("%02X",frameData));
+ sb.append("</fsn>");
+ } else if (hdr.getFrameType() == FrameType.First ) {
+ int totalSize = BitConverter.intFromByteArray(hdr.getPayload(), 0);
+ int numFrames = BitConverter.intFromByteArray(hdr.getPayload(), 4);
+ sb.append("<total>").append(totalSize).append("</total><numframes>").append(numFrames).append("</numframes>");
+ } else if (hdr.getFrameType() == FrameType.Single ) {
+ sb.append("<single/>");
+ }
+
+ sb.append("</hdr>");
+
+ return sb.toString();
+ } // end-method
+
+ public static boolean logTransportEvent(String preamble, String transportSpecificInfoXml, InterfaceActivityDirection msgDirection, byte buf[], int byteLength, String token) {
+ return logTransportEvent(preamble, transportSpecificInfoXml, msgDirection, buf, 0, byteLength, token);
+ }
+
+ private static void checkB64(String x, byte[] buf, int offset, int byteLength) {
+ if ((x.length() % 4) != 0) {
+ NativeLogTool.logWarning(SdlTrace.SYSTEM_LOG_TAG, "b64 string length (" + x.length() + ") isn't multiple of 4: buf.length=" + buf.length + ", offset=" + offset + ", len=" + byteLength);
+ } // end-if
+ } // end-method
+
+ public static boolean logTransportEvent(String preamble, String transportSpecificInfoXml, InterfaceActivityDirection msgDirection, byte buf[], int offset, int byteLength, String token) {
+ if (DiagLevel.getLevel(Mod.tran) == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ StringBuilder msg = new StringBuilder();
+ if (transportSpecificInfoXml != null && transportSpecificInfoXml.length() > 0) {
+ msg.append(transportSpecificInfoXml);
+ }
+ if (preamble != null && preamble.length() > 0) {
+ msg.append("<desc>");
+ msg.append(preamble);
+ msg.append("</desc>");
+ }
+ if (buf != null) {
+ msg.append("<sz>");
+ msg.append(byteLength);
+ msg.append("</sz>");
+ DetailLevel dl = DiagLevel.getLevel(Mod.tran);
+ if (dl == DetailLevel.VERBOSE) {
+ if (buf != null && byteLength > 0) {
+ msg.append("<d>");
+ String bytesInfo = Mime.base64Encode(buf, offset, byteLength);
+ checkB64(bytesInfo, buf, offset, byteLength);
+ msg.append(bytesInfo);
+ msg.append("</d>");
+ }
+ }
+ }
+ String xml = SdlTraceBase.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.tran, msgDirection, msg.toString());
+ return writeXmlTraceMessage(xml);
+ }
+
+ // Package-scoped
+ static long getBaseTicsDelta() {
+ return java.lang.System.currentTimeMillis() - getBaseTics();
+ }
+
+ // Package-scoped
+ static long getBaseTics() {
+ return baseTics;
+ } // end-method
+
+ public static Boolean writeMessageToSiphonServer(String info) {
+ return SiphonServer.sendFormattedTraceMessage(info);
+ }
+
+ private static boolean writeXmlTraceMessage(String msg) {
+ try {
+ // Attempt to write formatted message to the Siphon
+ if (false == writeMessageToSiphonServer(msg)) {
+ // If writing to the Siphon fails, write to the native log
+ NativeLogTool.logInfo(SdlTrace.SYSTEM_LOG_TAG, msg);
+ return false;
+ }
+
+ ISTListener localTraceListener = m_appTraceListener;
+
+ if (localTraceListener != null) {
+ try {
+ localTraceListener.logXmlMsg(msg, SDL_LIB_TRACE_KEY);
+ } catch (Exception ex) {
+ DebugTool.logError(SYSTEM_LOG_TAG, "Failure calling ISTListener: " + ex.toString(), ex);
+ return false;
+ }
+ }
+ } catch (Exception ex) {
+ NativeLogTool.logError(SdlTrace.SYSTEM_LOG_TAG, "Failure writing XML trace message: " + ex.toString());
+ return false;
+ }
+ return true;
+ }
+
+ static String getSmartDeviceLinkTraceRoot(String dumpReason, int seqNo) {
+ StringBuilder write = new StringBuilder("<SmartDeviceLinktraceroot>" + "<sequencenum>" + seqNo
+ + "</sequencenum>" + "<dumpreason>" + dumpReason
+ + "</dumpreason><tracelevel>");
+
+ write.append("<tran>").append(DiagLevel.getLevel(Mod.tran)).append("</tran>");
+ write.append("<proto>").append(DiagLevel.getLevel(Mod.proto)).append("</proto>");
+ write.append("<mar>").append(DiagLevel.getLevel(Mod.mar)).append("</mar>");
+ write.append("<rpc>").append(DiagLevel.getLevel(Mod.rpc)).append("</rpc>");
+ write.append("<proxy>").append(DiagLevel.getLevel(Mod.proxy)).append("</proxy>");
+ write.append("<app>").append(DiagLevel.getLevel(Mod.app)).append("</app>");
+
+ write.append("</tracelevel>");
+ write.append("</SmartDeviceLinktraceroot>");
+ return write.toString();
+ } // end-method
} // end-class
\ No newline at end of file diff --git a/base/src/main/java/com/smartdevicelink/util/FileUtls.java b/base/src/main/java/com/smartdevicelink/util/FileUtls.java index 6c5e955eb..b9be1c761 100644 --- a/base/src/main/java/com/smartdevicelink/util/FileUtls.java +++ b/base/src/main/java/com/smartdevicelink/util/FileUtls.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.util; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.io.ByteArrayOutputStream; import java.io.File; diff --git a/base/src/main/java/com/smartdevicelink/util/Version.java b/base/src/main/java/com/smartdevicelink/util/Version.java index 497a46f9e..d25bcd6fe 100644 --- a/base/src/main/java/com/smartdevicelink/util/Version.java +++ b/base/src/main/java/com/smartdevicelink/util/Version.java @@ -32,7 +32,7 @@ package com.smartdevicelink.util; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.rpc.SdlMsgVersion; diff --git a/baseAndroid/README.md b/baseAndroid/README.md deleted file mode 100644 index 4a143e5f9..000000000 --- a/baseAndroid/README.md +++ /dev/null @@ -1,11 +0,0 @@ -## SmartDeviceLink BaseAndroid - -The Base Android folder symbolically links files used by the Android project that are in the Base folder. - -This folder does not need to be imported. Please refer to the installation instructions in the Android, JavaSE, or JavaEE README's. - -### Windows - -The original symbolic links were created for a Unix based operating system. If compiling with Windows the symbolic links will have to be created before compiling the SDL Android project. There is a gradle task added to the `build.gradle` file in the `sdl_android` project that contains a task called `buildWindowSymLinks`. Please note, this task and the supplied script require admin privileges and python to be installed to run. After running this task, Android Studio will recognize the new folder path as the `build.gradle` file contains the necessary conditional that will pick the correct source set to use. - -If you are not building the project with the supplied gradle files, you will need to point to the correct path based on the operating system in which you are building the project.
\ No newline at end of file diff --git a/baseAndroid/make_symbolic_links.py b/baseAndroid/make_symbolic_links.py deleted file mode 100644 index 4be7cdeea..000000000 --- a/baseAndroid/make_symbolic_links.py +++ /dev/null @@ -1,69 +0,0 @@ -import os -import pathlib -from pathlib import Path -import re - - -def has_admin(): - if os.name == 'nt': - try: - # only windows users with admin privileges can read the C:\windows\temp - temp = os.listdir(os.sep.join([os.environ.get('SystemRoot', 'C:\\windows'), 'temp'])) - except: - return os.environ['USERNAME'],False - else: - return os.environ['USERNAME'],True - else: - if 'SUDO_USER' in os.environ and os.geteuid() == 0: - return os.environ['SUDO_USER'],True - else: - return os.environ['USERNAME'],False - - -print('Script Start') - -isAdmin = has_admin() -print('Running As Admin - ', isAdmin[1]) -if not isAdmin[1]: - print('Can\'t run without admin privileges') - exit() - -pathlist = Path('src/').glob('**/*') -# Delete the old directory -os.system('echo y | rmdir windows /s') - -for path in pathlist: - path_in_str = str(path) - if os.path.isfile(path): - # check if it's a link to a file or folder - source_link_str = path_in_str - source_link_str = '..\\base\\' + source_link_str - # Remove the root folder for the actual link - print(source_link_str) - - testDest = 'windows\\' + path_in_str - - directory = pathlib.Path(testDest).parent - print(str(directory)) - prefixDir = (re.sub(r"\\+[^\\]*", r"\\..", str(directory))+'\\..\\')[8:] # 8 to remove windows/ - # Change all the directory paths into .. so that it will properly move up a folder. - - os.system('mkdir %s' % directory) - os.system('icacls %s /grant Everyone:(f)' % directory) - - # Now we need to go through each destination directory and understand that's how many ../ we have to add - if path_in_str.endswith('.java'): - print('Java file link found') - - command = 'mklink "%s" "%s%s"' % (testDest, prefixDir, source_link_str) - print('Performing command %s' % command) - os.system(command) - else: - print('Directory link found') - command = 'mklink /D "%s" "%s%s"' % (testDest, prefixDir, source_link_str) - print('Performing command %s' % command) - os.system(command) - -print('Script Ends') - - diff --git a/baseAndroid/make_symlinks.lnk b/baseAndroid/make_symlinks.lnk Binary files differdeleted file mode 100644 index 86e9d3e41..000000000 --- a/baseAndroid/make_symlinks.lnk +++ /dev/null diff --git a/baseAndroid/run_as_admin_symlink_script.bat b/baseAndroid/run_as_admin_symlink_script.bat deleted file mode 100644 index 439d7709f..000000000 --- a/baseAndroid/run_as_admin_symlink_script.bat +++ /dev/null @@ -1,4 +0,0 @@ -pushd %~dp0 -python make_symbolic_links.py -popd -pause
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/Dispatcher b/baseAndroid/src/main/java/com/smartdevicelink/Dispatcher deleted file mode 120000 index 2af882be4..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/Dispatcher +++ /dev/null @@ -1 +0,0 @@ -../../../../../../base/src/main/java/com/smartdevicelink/Dispatcher/
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java b/baseAndroid/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java deleted file mode 120000 index 0bc868029..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java b/baseAndroid/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java deleted file mode 120000 index 0e22d9dc9..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/exception b/baseAndroid/src/main/java/com/smartdevicelink/exception deleted file mode 120000 index d5d048354..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/exception +++ /dev/null @@ -1 +0,0 @@ -../../../../../../base/src/main/java/com/smartdevicelink/exception/
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java b/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java deleted file mode 120000 index bf45a3bf6..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSdlManagerListener.java b/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSdlManagerListener.java deleted file mode 120000 index 568044bfd..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSdlManagerListener.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/managers/BaseSdlManagerListener.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSubManager.java b/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSubManager.java deleted file mode 120000 index f1f35fe92..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSubManager.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/CompletionListener.java b/baseAndroid/src/main/java/com/smartdevicelink/managers/CompletionListener.java deleted file mode 120000 index 1bd4fd70e..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/managers/CompletionListener.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/managers/CompletionListener.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/ManagerUtility.java b/baseAndroid/src/main/java/com/smartdevicelink/managers/ManagerUtility.java deleted file mode 120000 index 55d1ecb8b..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/managers/ManagerUtility.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/managers/ManagerUtility.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/ServiceEncryptionListener.java b/baseAndroid/src/main/java/com/smartdevicelink/managers/ServiceEncryptionListener.java deleted file mode 120000 index f35552f46..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/managers/ServiceEncryptionListener.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/managers/ServiceEncryptionListener.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java b/baseAndroid/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java deleted file mode 120000 index 2d817807f..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/audio b/baseAndroid/src/main/java/com/smartdevicelink/managers/audio deleted file mode 120000 index 7d71d50ed..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/managers/audio +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/managers/audio/
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/file b/baseAndroid/src/main/java/com/smartdevicelink/managers/file deleted file mode 120000 index 177a5823e..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/managers/file +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/managers/file
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/lifecycle b/baseAndroid/src/main/java/com/smartdevicelink/managers/lifecycle deleted file mode 120000 index d72cada51..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/managers/lifecycle +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/managers/lifecycle/
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/permission b/baseAndroid/src/main/java/com/smartdevicelink/managers/permission deleted file mode 120000 index d18186971..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/managers/permission +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/managers/permission
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/screen b/baseAndroid/src/main/java/com/smartdevicelink/managers/screen deleted file mode 120000 index fbf226f8e..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/managers/screen +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/managers/screen
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/video b/baseAndroid/src/main/java/com/smartdevicelink/managers/video deleted file mode 120000 index de58416c9..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/managers/video +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/managers/video/
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/marshal b/baseAndroid/src/main/java/com/smartdevicelink/marshal deleted file mode 120000 index c86064e2f..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/marshal +++ /dev/null @@ -1 +0,0 @@ -../../../../../../base/src/main/java/com/smartdevicelink/marshal/
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/BaseSdlPacket.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/BaseSdlPacket.java deleted file mode 120000 index 2fec10c84..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/protocol/BaseSdlPacket.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/protocol/BaseSdlPacket.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java deleted file mode 120000 index c2b9f5a5d..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java deleted file mode 120000 index 05acb054b..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java deleted file mode 120000 index 37bba1630..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java deleted file mode 120000 index 92bbe53bf..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java deleted file mode 120000 index 530ee50b1..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java deleted file mode 120000 index aded79f74..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java deleted file mode 120000 index 12d9192e9..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/enums b/baseAndroid/src/main/java/com/smartdevicelink/protocol/enums deleted file mode 120000 index e4adb738b..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/protocol/enums +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/protocol/enums
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/IProxyListener.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/IProxyListener.java deleted file mode 120000 index e79a51ef6..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/IProxyListener.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/proxy/IProxyListener.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCMessage.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCMessage.java deleted file mode 120000 index 97e44408d..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCMessage.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/proxy/RPCMessage.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCNotification.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCNotification.java deleted file mode 120000 index 8713d52e3..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCNotification.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/proxy/RPCNotification.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCRequest.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCRequest.java deleted file mode 120000 index c1e2f4a27..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCRequest.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/proxy/RPCRequest.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCResponse.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCResponse.java deleted file mode 120000 index afcfd9e15..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCResponse.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCStruct.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCStruct.java deleted file mode 120000 index 683ec16a9..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCStruct.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/proxy/RPCStruct.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java deleted file mode 120000 index ba944a202..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/callbacks b/baseAndroid/src/main/java/com/smartdevicelink/proxy/callbacks deleted file mode 120000 index 74653ae9f..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/callbacks +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/proxy/callbacks/
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/constants b/baseAndroid/src/main/java/com/smartdevicelink/proxy/constants deleted file mode 120000 index ced1d41aa..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/constants +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/proxy/constants/
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java deleted file mode 120000 index 02570d2f8..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java deleted file mode 120000 index cede25df1..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java deleted file mode 120000 index 32895d7fe..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java deleted file mode 120000 index 41112b9e7..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java deleted file mode 120000 index 9b79b4afc..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java deleted file mode 120000 index 87f717597..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java deleted file mode 120000 index c817900a3..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/rpc b/baseAndroid/src/main/java/com/smartdevicelink/proxy/rpc deleted file mode 120000 index 7f7d97664..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/proxy/rpc +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/proxy/rpc
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/security b/baseAndroid/src/main/java/com/smartdevicelink/security deleted file mode 120000 index 09e7051a4..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/security +++ /dev/null @@ -1 +0,0 @@ -../../../../../../base/src/main/java/com/smartdevicelink/security
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java b/baseAndroid/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java deleted file mode 120000 index ce7fd47d9..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/streaming/IStreamListener.java b/baseAndroid/src/main/java/com/smartdevicelink/streaming/IStreamListener.java deleted file mode 120000 index f703ac149..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/streaming/IStreamListener.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/streaming/IStreamListener.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/streaming/audio b/baseAndroid/src/main/java/com/smartdevicelink/streaming/audio deleted file mode 120000 index b91099bd1..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/streaming/audio +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/streaming/audio/
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java b/baseAndroid/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java deleted file mode 120000 index 1eec0a104..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java b/baseAndroid/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java deleted file mode 120000 index 8b18e72b2..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/trace/DiagLevel.java b/baseAndroid/src/main/java/com/smartdevicelink/trace/DiagLevel.java deleted file mode 120000 index 1bc9b65d1..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/trace/DiagLevel.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/trace/DiagLevel.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/trace/ISTListener.java b/baseAndroid/src/main/java/com/smartdevicelink/trace/ISTListener.java deleted file mode 120000 index 2ac262989..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/trace/ISTListener.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/trace/ISTListener.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/trace/Mime.java b/baseAndroid/src/main/java/com/smartdevicelink/trace/Mime.java deleted file mode 120000 index 8dc93a328..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/trace/Mime.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/trace/Mime.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java b/baseAndroid/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java deleted file mode 120000 index 8d7260eb5..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/trace/enums b/baseAndroid/src/main/java/com/smartdevicelink/trace/enums deleted file mode 120000 index 6c0343907..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/trace/enums +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/trace/enums/
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java b/baseAndroid/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java deleted file mode 120000 index 92effaf36..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/ITransportListener.java b/baseAndroid/src/main/java/com/smartdevicelink/transport/ITransportListener.java deleted file mode 120000 index 587a7a3de..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/transport/ITransportListener.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/transport/ITransportListener.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/SdlPsm.java b/baseAndroid/src/main/java/com/smartdevicelink/transport/SdlPsm.java deleted file mode 120000 index 22d69d1cd..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/transport/SdlPsm.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/transport/SdlPsm.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/SiphonServer.java b/baseAndroid/src/main/java/com/smartdevicelink/transport/SiphonServer.java deleted file mode 120000 index b28f2965d..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/transport/SiphonServer.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/transport/SiphonServer.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/TransportConstants.java b/baseAndroid/src/main/java/com/smartdevicelink/transport/TransportConstants.java deleted file mode 120000 index 61f953de2..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/transport/TransportConstants.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/transport/TransportConstants.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java b/baseAndroid/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java deleted file mode 120000 index f89613939..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/enums b/baseAndroid/src/main/java/com/smartdevicelink/transport/enums deleted file mode 120000 index c5b0467f6..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/transport/enums +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/transport/enums/
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/utl/BaseTransportRecord.java b/baseAndroid/src/main/java/com/smartdevicelink/transport/utl/BaseTransportRecord.java deleted file mode 120000 index 067c6a17a..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/transport/utl/BaseTransportRecord.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../base/src/main/java/com/smartdevicelink/transport/utl/BaseTransportRecord.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/BitConverter.java b/baseAndroid/src/main/java/com/smartdevicelink/util/BitConverter.java deleted file mode 120000 index ace3985f9..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/util/BitConverter.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/util/BitConverter.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/ByteEnumer.java b/baseAndroid/src/main/java/com/smartdevicelink/util/ByteEnumer.java deleted file mode 120000 index 8cc7d9ac8..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/util/ByteEnumer.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/util/ByteEnumer.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/CompareUtils.java b/baseAndroid/src/main/java/com/smartdevicelink/util/CompareUtils.java deleted file mode 120000 index 9d331ba9c..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/util/CompareUtils.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/util/CompareUtils.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java b/baseAndroid/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java deleted file mode 120000 index 4d9cfea49..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/DebugTool.java b/baseAndroid/src/main/java/com/smartdevicelink/util/DebugTool.java deleted file mode 120000 index 2c9f91906..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/util/DebugTool.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/util/DebugTool.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/FileUtls.java b/baseAndroid/src/main/java/com/smartdevicelink/util/FileUtls.java deleted file mode 120000 index 8eb2f22c2..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/util/FileUtls.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/util/FileUtls.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/IConsole.java b/baseAndroid/src/main/java/com/smartdevicelink/util/IConsole.java deleted file mode 120000 index 2cf061029..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/util/IConsole.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/util/IConsole.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/NativeLogTool.java b/baseAndroid/src/main/java/com/smartdevicelink/util/NativeLogTool.java deleted file mode 120000 index 3e1645508..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/util/NativeLogTool.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/util/NativeLogTool.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java b/baseAndroid/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java deleted file mode 120000 index d44a2b6e0..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java
\ No newline at end of file diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/Version.java b/baseAndroid/src/main/java/com/smartdevicelink/util/Version.java deleted file mode 120000 index e21ea0440..000000000 --- a/baseAndroid/src/main/java/com/smartdevicelink/util/Version.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../base/src/main/java/com/smartdevicelink/util/Version.java
\ No newline at end of file diff --git a/generator/transformers/enums_producer.py b/generator/transformers/enums_producer.py index a04046441..c876b3a52 100644 --- a/generator/transformers/enums_producer.py +++ b/generator/transformers/enums_producer.py @@ -73,7 +73,7 @@ class EnumsProducer(InterfaceProducerCommon): return render def extract_param(self, param: EnumElement, kind): - d = {'origin': param.name, 'name': self.key(self.converted(param.name))} + d = {'origin': param.name, 'name': self.converted(param.name)} if kind == 'custom': d['internal'] = '"{}"'.format(param.name) diff --git a/javaEE/build.gradle b/javaEE/build.gradle index 39b6f0956..a07678dd5 100644 --- a/javaEE/build.gradle +++ b/javaEE/build.gradle @@ -28,7 +28,7 @@ configurations { dependencies { extraLibs fileTree(dir: 'libs', include: ['*.jar']) extraLibs 'org.mongodb:bson:3.10.1' - extraLibs 'com.android.support:support-annotations:28.0.0' + extraLibs 'androidx.annotation:annotation:1.0.0' extraLibs 'org.java-websocket:Java-WebSocket:1.3.9' extraLibs 'com.livio.taskmaster:taskmaster:0.3.0' configurations.api.extendsFrom(configurations.extraLibs) diff --git a/javaSE/build.gradle b/javaSE/build.gradle index 1f4dcc048..9e9b5596a 100644 --- a/javaSE/build.gradle +++ b/javaSE/build.gradle @@ -29,7 +29,7 @@ configurations { dependencies { extraLibs fileTree(dir: 'libs', include: ['*.jar']) extraLibs 'org.mongodb:bson:3.10.1' - extraLibs 'com.android.support:support-annotations:28.0.0' + extraLibs 'androidx.annotation:annotation:1.0.0' extraLibs 'org.java-websocket:Java-WebSocket:1.3.9' extraLibs 'com.livio.taskmaster:taskmaster:0.3.0' configurations.api.extendsFrom(configurations.extraLibs) diff --git a/base/src/main/java/android/os/AsyncTask.java b/javaSE/src/main/java/android/os/AsyncTask.java index db6b69a8e..db6b69a8e 100644 --- a/base/src/main/java/android/os/AsyncTask.java +++ b/javaSE/src/main/java/android/os/AsyncTask.java diff --git a/base/src/main/java/android/os/Parcel.java b/javaSE/src/main/java/android/os/Parcel.java index b99dbc671..b99dbc671 100644 --- a/base/src/main/java/android/os/Parcel.java +++ b/javaSE/src/main/java/android/os/Parcel.java diff --git a/base/src/main/java/android/os/Parcelable.java b/javaSE/src/main/java/android/os/Parcelable.java index e09a1754c..e09a1754c 100644 --- a/base/src/main/java/android/os/Parcelable.java +++ b/javaSE/src/main/java/android/os/Parcelable.java diff --git a/base/src/main/java/android/util/Log.java b/javaSE/src/main/java/android/util/Log.java index 7374ff04c..7374ff04c 100644 --- a/base/src/main/java/android/util/Log.java +++ b/javaSE/src/main/java/android/util/Log.java diff --git a/base/src/main/java/com/livio/BSON/BsonEncoder.java b/javaSE/src/main/java/com/livio/BSON/BsonEncoder.java index 22c47f6cb..22c47f6cb 100644 --- a/base/src/main/java/com/livio/BSON/BsonEncoder.java +++ b/javaSE/src/main/java/com/livio/BSON/BsonEncoder.java diff --git a/javaSE/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java b/javaSE/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java index 98150b218..542ff6b35 100644 --- a/javaSE/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java +++ b/javaSE/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java @@ -33,14 +33,15 @@ package com.smartdevicelink.SdlConnection; +import com.smartdevicelink.protocol.SdlPacket; import com.smartdevicelink.protocol.SdlProtocol; import com.smartdevicelink.protocol.SdlProtocolBase; import com.smartdevicelink.protocol.enums.SessionType; import com.smartdevicelink.proxy.interfaces.ISdlServiceListener; import com.smartdevicelink.transport.BaseTransportConfig; import com.smartdevicelink.util.DebugTool; +import com.smartdevicelink.util.Version; -import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; public class SdlSession extends BaseSdlSession { @@ -48,7 +49,7 @@ public class SdlSession extends BaseSdlSession { private static final String TAG = "SdlSession"; - public SdlSession(ISdlConnectionListener listener, BaseTransportConfig config) { + public SdlSession(ISdlSessionListener listener, BaseTransportConfig config) { super(listener, config); } @@ -57,50 +58,46 @@ public class SdlSession extends BaseSdlSession { return new SdlProtocol(this, transportConfig); } - @Override - public void onProtocolSessionStarted(SessionType sessionType, - byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) { - - DebugTool.logInfo(TAG, "Protocol session started"); + public void onServiceStarted(SdlPacket packet, SessionType serviceType, int sessionID, Version version, boolean isEncrypted) { + DebugTool.logInfo(TAG, serviceType.getName() + " service started"); - this.sessionId = sessionID; - if (sessionType.eq(SessionType.RPC)) { - sessionHashId = hashID; + if (serviceType != null && serviceType.eq(SessionType.RPC) && this.sessionId == -1) { + this.sessionId = sessionID; + this.sessionListener.onSessionStarted(sessionID, version); } if (isEncrypted) { - encryptedServices.addIfAbsent(sessionType); + encryptedServices.addIfAbsent(serviceType); } - this.sessionListener.onProtocolSessionStarted(sessionType, sessionID, version, correlationID, hashID, isEncrypted); - if (serviceListeners != null && serviceListeners.containsKey(sessionType)) { - CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType); + if (serviceListeners != null && serviceListeners.containsKey(serviceType)) { + CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(serviceType); for (ISdlServiceListener listener : listeners) { - listener.onServiceStarted(this, sessionType, isEncrypted); + listener.onServiceStarted(this, serviceType, isEncrypted); } } - } @Override - public void onProtocolSessionEnded(SessionType sessionType, byte sessionID, - String correlationID) { - this.sessionListener.onProtocolSessionEnded(sessionType, sessionID, correlationID); - if (serviceListeners != null && serviceListeners.containsKey(sessionType)) { - CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType); + public void onServiceEnded(SdlPacket packet, SessionType serviceType, int sessionID) { + + if (SessionType.RPC.equals(serviceType)) { + this.sessionListener.onSessionEnded(sessionID); + } + + if (serviceListeners != null && serviceListeners.containsKey(serviceType)) { + CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(serviceType); for (ISdlServiceListener listener : listeners) { - listener.onServiceEnded(this, sessionType); + listener.onServiceEnded(this, serviceType); } } - encryptedServices.remove(sessionType); - } + encryptedServices.remove(serviceType); + } @Override - public void onProtocolSessionEndedNACKed(SessionType sessionType, - byte sessionID, String correlationID) { - this.sessionListener.onProtocolSessionEndedNACKed(sessionType, sessionID, correlationID); + public void onServiceError(SdlPacket packet, SessionType sessionType, int sessionID, String error) { if (serviceListeners != null && serviceListeners.containsKey(sessionType)) { CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType); for (ISdlServiceListener listener : listeners) { @@ -109,22 +106,4 @@ public class SdlSession extends BaseSdlSession { } } - - - - - /* *********************************************************************************************************************************************************************** - * ***************************************************************** IProtocol Listener ******************************************************************************** - *************************************************************************************************************************************************************************/ - - public void onProtocolSessionNACKed(SessionType sessionType, byte sessionID, byte version, String correlationID, List<String> rejectedParams) { - this.sessionListener.onProtocolSessionStartedNACKed(sessionType, - sessionID, version, correlationID, rejectedParams); - if (serviceListeners != null && serviceListeners.containsKey(sessionType)) { - CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType); - for (ISdlServiceListener listener : listeners) { - listener.onServiceError(this, sessionType, "Start " + sessionType.toString() + " Service NAKed"); - } - } - } }
\ No newline at end of file diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java index 37c8ae14e..4dae813f6 100644 --- a/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java +++ b/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.util.Log; import com.smartdevicelink.managers.file.FileManager; diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java index e3a36d7bf..959a9ced5 100644 --- a/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java +++ b/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.file; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.file.filetypes.SdlFile; import com.smartdevicelink.proxy.interfaces.ISdl; import com.smartdevicelink.proxy.rpc.PutFile; diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java b/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java index fdfec6420..69bfb9238 100644 --- a/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java +++ b/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.file.filetypes; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.proxy.rpc.enums.FileType; import com.smartdevicelink.proxy.rpc.enums.ImageType; diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java b/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java index eac88d5e6..60b3f42e9 100644 --- a/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java +++ b/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.file.filetypes; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.rpc.enums.FileType; import com.smartdevicelink.proxy.rpc.enums.StaticIconName; diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java index 1d5915bf4..eda411dc5 100644 --- a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java +++ b/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.lifecycle; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.ServiceEncryptionListener; import com.smartdevicelink.proxy.interfaces.ISdl; diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java index 4cfadf611..b7167b81c 100644 --- a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java +++ b/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java @@ -32,8 +32,7 @@ package com.smartdevicelink.managers.lifecycle; -import android.support.annotation.RestrictTo; -import com.smartdevicelink.util.Log; +import androidx.annotation.RestrictTo; import com.smartdevicelink.SdlConnection.SdlSession; import com.smartdevicelink.exception.SdlException; @@ -53,7 +52,7 @@ public class LifecycleManager extends BaseLifecycleManager { @Override void initialize() { super.initialize(); - this.session = new SdlSession(sdlConnectionListener, _transportConfig); + this.session = new SdlSession(this.sdlSessionListener, _transportConfig); } @Override diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java index c580cc359..2918e0161 100644 --- a/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java +++ b/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.permission; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.interfaces.ISdl; /** diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java index b9828f4c3..38e17d0dc 100644 --- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java +++ b/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.screen; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.file.FileManager; import com.smartdevicelink.proxy.interfaces.ISdl; diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java index e29c6ed49..0b95d1aa5 100644 --- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java +++ b/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.screen; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.file.FileManager; import com.smartdevicelink.proxy.interfaces.ISdl; diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java index c34b0775d..49d41d495 100644 --- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java +++ b/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java @@ -1,6 +1,6 @@ package com.smartdevicelink.managers.screen; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.proxy.interfaces.ISdl; public class SubscribeButtonManager extends BaseSubscribeButtonManager { diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java index 9c680446c..961e9e196 100644 --- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java +++ b/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java @@ -31,7 +31,7 @@ */ package com.smartdevicelink.managers.screen; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.file.FileManager; import com.smartdevicelink.managers.file.filetypes.SdlArtwork; import com.smartdevicelink.proxy.interfaces.ISdl; diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java index df14bfa6f..804054373 100644 --- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java +++ b/javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java @@ -32,7 +32,7 @@ package com.smartdevicelink.managers.screen.choiceset; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.smartdevicelink.managers.file.FileManager; import com.smartdevicelink.proxy.interfaces.ISdl; diff --git a/base/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java b/javaSE/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java index 67ea25cc1..67ea25cc1 100644 --- a/base/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java +++ b/javaSE/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java diff --git a/javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java b/javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java new file mode 100644 index 000000000..482b4a846 --- /dev/null +++ b/javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.smartdevicelink.trace; + + +/* This class handles the global TraceSettings as requested by the users either through the combination of the following + 1. System defaults + 2. Application XML config + 3. Programmatic requests from application itself + + It is manifested in the <SmartDeviceLink>...</SmartDeviceLink> tags + */ + +public class SdlTrace extends SdlTraceBase{ + private static String getPid(){ + //Default implementation is not able to get this information + return "UNKNOWN"; + } +} // end-class
\ No newline at end of file diff --git a/base/src/main/java/com/smartdevicelink/transport/CustomTransport.java b/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransport.java index ad02f96d2..ad02f96d2 100644 --- a/base/src/main/java/com/smartdevicelink/transport/CustomTransport.java +++ b/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransport.java diff --git a/base/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java b/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java index af0613aa1..af0613aa1 100644 --- a/base/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java +++ b/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java diff --git a/base/src/main/java/com/smartdevicelink/transport/TransportCallback.java b/javaSE/src/main/java/com/smartdevicelink/transport/TransportCallback.java index 551ed9d29..551ed9d29 100644 --- a/base/src/main/java/com/smartdevicelink/transport/TransportCallback.java +++ b/javaSE/src/main/java/com/smartdevicelink/transport/TransportCallback.java diff --git a/base/src/main/java/com/smartdevicelink/transport/TransportInterface.java b/javaSE/src/main/java/com/smartdevicelink/transport/TransportInterface.java index 989b2df33..989b2df33 100644 --- a/base/src/main/java/com/smartdevicelink/transport/TransportInterface.java +++ b/javaSE/src/main/java/com/smartdevicelink/transport/TransportInterface.java diff --git a/base/src/main/java/com/smartdevicelink/transport/TransportManager.java b/javaSE/src/main/java/com/smartdevicelink/transport/TransportManager.java index c8a07a1cc..c8a07a1cc 100644 --- a/base/src/main/java/com/smartdevicelink/transport/TransportManager.java +++ b/javaSE/src/main/java/com/smartdevicelink/transport/TransportManager.java diff --git a/base/src/main/java/com/smartdevicelink/transport/WebSocketServer.java b/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServer.java index 8f5411ce0..8f5411ce0 100644 --- a/base/src/main/java/com/smartdevicelink/transport/WebSocketServer.java +++ b/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServer.java diff --git a/base/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java b/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java index 6add5ae71..6add5ae71 100644 --- a/base/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java +++ b/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java diff --git a/base/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java b/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java index ec40dcade..d46e8aac6 100644 --- a/base/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java +++ b/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java @@ -31,8 +31,8 @@ */ package com.smartdevicelink.transport.utl; -import android.support.annotation.IntDef; -import android.support.annotation.NonNull; +import androidx.annotation.IntDef; +import androidx.annotation.NonNull; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/base/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java b/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java index 95d0ceac2..95d0ceac2 100644 --- a/base/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java +++ b/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java diff --git a/base/src/main/java/org/json/JSON.java b/javaSE/src/main/java/org/json/JSON.java index 1b32e698d..1b32e698d 100644 --- a/base/src/main/java/org/json/JSON.java +++ b/javaSE/src/main/java/org/json/JSON.java diff --git a/base/src/main/java/org/json/JSONArray.java b/javaSE/src/main/java/org/json/JSONArray.java index 996f44909..996f44909 100644 --- a/base/src/main/java/org/json/JSONArray.java +++ b/javaSE/src/main/java/org/json/JSONArray.java diff --git a/base/src/main/java/org/json/JSONException.java b/javaSE/src/main/java/org/json/JSONException.java index 05e1dddc9..05e1dddc9 100644 --- a/base/src/main/java/org/json/JSONException.java +++ b/javaSE/src/main/java/org/json/JSONException.java diff --git a/base/src/main/java/org/json/JSONObject.java b/javaSE/src/main/java/org/json/JSONObject.java index cebe2fece..74ea973c2 100644 --- a/base/src/main/java/org/json/JSONObject.java +++ b/javaSE/src/main/java/org/json/JSONObject.java @@ -16,8 +16,8 @@ package org.json; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; diff --git a/base/src/main/java/org/json/JSONStringer.java b/javaSE/src/main/java/org/json/JSONStringer.java index dd3b2a7d8..dd3b2a7d8 100644 --- a/base/src/main/java/org/json/JSONStringer.java +++ b/javaSE/src/main/java/org/json/JSONStringer.java diff --git a/base/src/main/java/org/json/JSONTokener.java b/javaSE/src/main/java/org/json/JSONTokener.java index 4bdd9ad37..4bdd9ad37 100644 --- a/base/src/main/java/org/json/JSONTokener.java +++ b/javaSE/src/main/java/org/json/JSONTokener.java |