summaryrefslogtreecommitdiff
path: root/javaSE
diff options
context:
space:
mode:
authorJulian Kast <julian@livio.com>2020-09-03 16:35:17 -0400
committerJulian Kast <julian@livio.com>2020-09-03 16:35:17 -0400
commit385afe5cb23c914108a95269b2b965acb0f8ad41 (patch)
tree9edb8d3d56b9b63d58fc8d4a5aedb71a34dcdb92 /javaSE
parent692f925b312c1c8263f9e49454922ebdf506bb4b (diff)
parent0bb42e3275615049697228c323a84ae3124d75ab (diff)
downloadsdl_android-385afe5cb23c914108a95269b2b965acb0f8ad41.tar.gz
Merge branch 'develop' into Add-New-AnnotationsAdd-New-Annotations
# Conflicts: # javaSE/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
Diffstat (limited to 'javaSE')
-rw-r--r--javaSE/build.gradle77
-rwxr-xr-xjavaSE/hello_sdl_java/assets/images/sdl.pngbin0 -> 3274 bytes
-rwxr-xr-xjavaSE/hello_sdl_java/assets/images/sdl_s_green.pngbin0 -> 25896 bytes
-rw-r--r--javaSE/hello_sdl_java/build.gradle33
-rw-r--r--javaSE/hello_sdl_java/gradle/wrapper/gradle-wrapper.jarbin0 -> 56172 bytes
-rw-r--r--javaSE/hello_sdl_java/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xjavaSE/hello_sdl_java/gradlew172
-rw-r--r--javaSE/hello_sdl_java/gradlew.bat84
-rw-r--r--javaSE/hello_sdl_java/settings.gradle4
-rw-r--r--javaSE/hello_sdl_java/src/main/java/com/smartdevicelink/java/Main.java101
-rw-r--r--javaSE/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java405
-rw-r--r--javaSE/javaSE/README.md (renamed from javaSE/README.md)0
-rw-r--r--javaSE/javaSE/bintray.gradle (renamed from javaSE/bintray.gradle)2
-rw-r--r--javaSE/javaSE/bintray.properties (renamed from javaSE/bintray.properties)0
-rw-r--r--javaSE/javaSE/build.gradle80
-rw-r--r--javaSE/javaSE/gradle/wrapper/gradle-wrapper.jar (renamed from javaSE/gradle/wrapper/gradle-wrapper.jar)bin55190 -> 55190 bytes
-rw-r--r--javaSE/javaSE/gradle/wrapper/gradle-wrapper.properties (renamed from javaSE/gradle/wrapper/gradle-wrapper.properties)0
-rwxr-xr-xjavaSE/javaSE/gradlew (renamed from javaSE/gradlew)0
-rw-r--r--javaSE/javaSE/gradlew.bat (renamed from javaSE/gradlew.bat)168
-rw-r--r--javaSE/javaSE/settings.gradle2
-rw-r--r--javaSE/javaSE/src/main/java/com/livio/BSON/BsonEncoder.java (renamed from javaSE/src/main/java/com/livio/BSON/BsonEncoder.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/BuildConfig.java (renamed from javaSE/src/main/java/com/smartdevicelink/BuildConfig.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java (renamed from javaSE/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java)15
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java)44
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java)13
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java)57
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java)4
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java (renamed from javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java)27
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java (renamed from javaSE/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java (renamed from javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java)10
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java (renamed from javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransport.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/CustomTransport.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportCallback.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/TransportCallback.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportInterface.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/TransportInterface.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/TransportManager.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServer.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServer.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java)1
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java41
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/util/Log.java (renamed from javaSE/src/main/java/com/smartdevicelink/util/Log.java)0
-rw-r--r--javaSE/javaSE/src/main/java/org/json/JSON.java (renamed from javaSE/src/main/java/org/json/JSON.java)0
-rw-r--r--javaSE/javaSE/src/main/java/org/json/JSONArray.java (renamed from javaSE/src/main/java/org/json/JSONArray.java)0
-rw-r--r--javaSE/javaSE/src/main/java/org/json/JSONException.java (renamed from javaSE/src/main/java/org/json/JSONException.java)0
-rw-r--r--javaSE/javaSE/src/main/java/org/json/JSONObject.java (renamed from javaSE/src/main/java/org/json/JSONObject.java)0
-rw-r--r--javaSE/javaSE/src/main/java/org/json/JSONStringer.java (renamed from javaSE/src/main/java/org/json/JSONStringer.java)0
-rw-r--r--javaSE/javaSE/src/main/java/org/json/JSONTokener.java (renamed from javaSE/src/main/java/org/json/JSONTokener.java)0
-rw-r--r--javaSE/settings.gradle4
-rw-r--r--javaSE/src/main/java/android/os/AsyncTask.java27
-rw-r--r--javaSE/src/main/java/android/os/Parcel.java59
-rw-r--r--javaSE/src/main/java/android/os/Parcelable.java31
-rw-r--r--javaSE/src/main/java/android/util/Log.java71
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java77
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/util/HttpRequestTask.java183
67 files changed, 1130 insertions, 668 deletions
diff --git a/javaSE/build.gradle b/javaSE/build.gradle
index b056fe7a0..85f6e7e3e 100644
--- a/javaSE/build.gradle
+++ b/javaSE/build.gradle
@@ -1,80 +1,15 @@
-apply plugin: 'java-library'
+plugins {
+ id 'java'
+}
group 'com.smartdevicelink'
-version new File(projectDir.path, ('/../VERSION')).text.trim()
-
-sourceCompatibility = 1.7
-
-buildscript {
- repositories {
- jcenter()
- }
- dependencies {
- classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
- }
-}
+sourceCompatibility = 1.8
repositories {
- google()
- jcenter()
-}
-
-// This extraLibs solution is explained here: https://discuss.gradle.org/t/how-to-include-dependencies-in-jar/19571/5
-configurations {
- // configuration that holds jars to include in the jar
- extraLibs
+ mavenCentral()
}
dependencies {
- extraLibs fileTree(dir: 'libs', include: ['*.jar'])
- extraLibs 'org.mongodb:bson:4.0.5'
- extraLibs 'androidx.annotation:annotation:1.1.0'
- extraLibs 'org.java-websocket:Java-WebSocket:1.3.9'
- extraLibs 'com.livio.taskmaster:taskmaster:0.3.0'
- configurations.api.extendsFrom(configurations.extraLibs)
-}
-
-sourceSets {
- main.java.srcDirs += '../base/src/main/java'
-}
-
-jar {
- dependsOn 'generateSources'
- from {
- configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
- }
+ testCompile group: 'junit', name: 'junit', version: '4.12'
}
-
-task generateSources {
- outputs.upToDateWhen { false }
- File outputDir = file("$buildDir/../src/main/java/com/smartdevicelink/")
- outputs.dir outputDir
- doFirst {
- println "Generating BuildConfig.java ..."
- def srcFile = new File(outputDir, "BuildConfig.java")
- srcFile.parentFile.mkdirs()
- File license = new File("$buildDir/../../LICENSE")
- if (license.exists()) {
- srcFile.write("/*\n")
- def lines = license.readLines()
- for (line in lines) {
- srcFile.append("* ")
- srcFile.append(line)
- srcFile.append("\n")
- }
- srcFile.append("*/\n")
- }else{
- srcFile.write("\n")
- }
- srcFile.append(
-"""package com.smartdevicelink;
-
-// THIS FILE IS AUTO GENERATED, DO NOT MODIFY!!
-public final class BuildConfig {
- public static final String VERSION_NAME = "$project.version";
-}""")
- }
-}
-
-apply from: 'bintray.gradle'
diff --git a/javaSE/hello_sdl_java/assets/images/sdl.png b/javaSE/hello_sdl_java/assets/images/sdl.png
new file mode 100755
index 000000000..5cfc0f84a
--- /dev/null
+++ b/javaSE/hello_sdl_java/assets/images/sdl.png
Binary files differ
diff --git a/javaSE/hello_sdl_java/assets/images/sdl_s_green.png b/javaSE/hello_sdl_java/assets/images/sdl_s_green.png
new file mode 100755
index 000000000..c43021775
--- /dev/null
+++ b/javaSE/hello_sdl_java/assets/images/sdl_s_green.png
Binary files differ
diff --git a/javaSE/hello_sdl_java/build.gradle b/javaSE/hello_sdl_java/build.gradle
new file mode 100644
index 000000000..ce0689640
--- /dev/null
+++ b/javaSE/hello_sdl_java/build.gradle
@@ -0,0 +1,33 @@
+plugins {
+ id 'java'
+}
+
+version '1.0'
+
+sourceCompatibility = 1.7
+
+repositories {
+ mavenCentral()
+ mavenLocal()
+ google()
+ jcenter()
+}
+// This extraLibs solution is explained here: https://discuss.gradle.org/t/how-to-include-dependencies-in-jar/19571/5
+configurations {
+ // configuration that holds jars to include in the jar
+ extraLibs
+}
+dependencies {
+ extraLibs fileTree(dir: 'libs', include: ['*.jar'])
+ extraLibs project(path: ':sdl_java_se')
+ configurations.implementation.extendsFrom(configurations.extraLibs)
+}
+jar {
+ from {
+ configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
+ }
+ manifest {
+ attributes 'Class-Path': configurations.compile.collect { it.getName() }.join(' ')
+ attributes 'Main-Class': 'com.smartdevicelink.java.Main'
+ }
+} \ No newline at end of file
diff --git a/javaSE/hello_sdl_java/gradle/wrapper/gradle-wrapper.jar b/javaSE/hello_sdl_java/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 000000000..28861d273
--- /dev/null
+++ b/javaSE/hello_sdl_java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/javaSE/hello_sdl_java/gradle/wrapper/gradle-wrapper.properties b/javaSE/hello_sdl_java/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000..fd6d42bd6
--- /dev/null
+++ b/javaSE/hello_sdl_java/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Mar 18 12:47:09 EDT 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
diff --git a/javaSE/hello_sdl_java/gradlew b/javaSE/hello_sdl_java/gradlew
new file mode 100755
index 000000000..cccdd3d51
--- /dev/null
+++ b/javaSE/hello_sdl_java/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/javaSE/hello_sdl_java/gradlew.bat b/javaSE/hello_sdl_java/gradlew.bat
new file mode 100644
index 000000000..f9553162f
--- /dev/null
+++ b/javaSE/hello_sdl_java/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/javaSE/hello_sdl_java/settings.gradle b/javaSE/hello_sdl_java/settings.gradle
new file mode 100644
index 000000000..fd254fa69
--- /dev/null
+++ b/javaSE/hello_sdl_java/settings.gradle
@@ -0,0 +1,4 @@
+rootProject.name = 'hello_sdl_java'
+include ":sdl_java_se"
+project (":sdl_java_se").projectDir = new File("../javaSE/")
+
diff --git a/javaSE/hello_sdl_java/src/main/java/com/smartdevicelink/java/Main.java b/javaSE/hello_sdl_java/src/main/java/com/smartdevicelink/java/Main.java
new file mode 100644
index 000000000..dc1ce2457
--- /dev/null
+++ b/javaSE/hello_sdl_java/src/main/java/com/smartdevicelink/java/Main.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2019. 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.java;
+
+import com.smartdevicelink.transport.WebSocketServerConfig;
+import com.smartdevicelink.util.DebugTool;
+
+public class Main {
+ private static final String TAG = "Main";
+ static Thread thread = null, mainThread;
+ static Object LOCK;
+
+ static SdlService sdlService;
+
+ public static void main(String[] args) {
+ //Enable DebugTool
+ DebugTool.enableDebugTool();
+
+ mainThread = Thread.currentThread();
+ LOCK = new Object();
+ startSdlService();
+
+ while(!mainThread.isInterrupted()) {
+ try {
+ synchronized (LOCK) {
+ LOCK.wait();
+ }
+ System.gc();
+ Thread.sleep(500);
+ DebugTool.logInfo(TAG, "Attempting to start SDL Service again");
+ startSdlService();
+ DebugTool.logInfo(TAG, "SdlService started");
+
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ break;
+ }
+ }
+ }
+
+ static SdlService.SdlServiceCallback serviceCallback = new SdlService.SdlServiceCallback() {
+ @Override
+ public void onEnd() {
+ if (thread != null) {
+ thread.interrupt();
+ thread = null;
+ }
+ synchronized (LOCK) {
+ LOCK.notify();
+ }
+
+ }
+ };
+
+ private static void startSdlService() {
+
+ thread = new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ DebugTool.logInfo(TAG, "Starting SDL Service");
+ sdlService = new SdlService(new WebSocketServerConfig(5432, -1), serviceCallback);
+ sdlService.start();
+
+ System.gc();
+
+ }
+ });
+ thread.start();
+ }
+}
diff --git a/javaSE/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java b/javaSE/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java
new file mode 100644
index 000000000..8c5eda17c
--- /dev/null
+++ b/javaSE/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java
@@ -0,0 +1,405 @@
+/*
+ * Copyright (c) 2019. 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.java;
+
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.screen.OnButtonListener;
+import com.smartdevicelink.managers.SdlManager;
+import com.smartdevicelink.managers.SdlManagerListener;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.managers.lifecycle.LifecycleConfigurationUpdate;
+import com.smartdevicelink.managers.screen.choiceset.ChoiceCell;
+import com.smartdevicelink.managers.screen.choiceset.ChoiceSet;
+import com.smartdevicelink.managers.screen.choiceset.ChoiceSetSelectionListener;
+import com.smartdevicelink.managers.screen.menu.MenuCell;
+import com.smartdevicelink.managers.screen.menu.MenuSelectionListener;
+import com.smartdevicelink.managers.screen.menu.VoiceCommand;
+import com.smartdevicelink.managers.screen.menu.VoiceCommandSelectionListener;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.*;
+import com.smartdevicelink.proxy.rpc.enums.*;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.util.DebugTool;
+
+import java.util.*;
+
+public class SdlService {
+
+
+ private static final String TAG = "SDL Service";
+
+ private static final String APP_NAME = "Hello Sdl";
+ private static final String APP_NAME_ES = "Hola Sdl";
+ private static final String APP_NAME_FR = "Bonjour Sdl";
+ private static final String APP_ID = "8678309";
+
+ private static final String ICON_FILENAME = "hello_sdl_icon.png";
+ private static final String SDL_IMAGE_FILENAME = "sdl_full_image.png";
+
+ private static final String WELCOME_SHOW = "Welcome to HelloSDL";
+ private static final String WELCOME_SPEAK = "Welcome to Hello S D L";
+
+ private static final String TEST_COMMAND_NAME = "Test Command";
+
+ private static final String IMAGE_DIR = "assets/images/";
+
+ // variable to create and call functions of the SyncProxy
+ private SdlManager sdlManager = null;
+ private List<ChoiceCell> choiceCellList;
+
+ private SdlServiceCallback callback;
+
+ public SdlService(BaseTransportConfig config, SdlServiceCallback callback){
+ this.callback = callback;
+ buildSdlManager(config);
+ }
+
+ public void start() {
+ DebugTool.logInfo(TAG, "SdlService start() ");
+ if(sdlManager != null){
+ sdlManager.start();
+ }
+ }
+
+ public void stop() {
+ if (sdlManager != null) {
+ sdlManager.dispose();
+ sdlManager = null;
+ }
+ }
+
+ private void buildSdlManager(BaseTransportConfig transport) {
+ // This logic is to select the correct transport and security levels defined in the selected build flavor
+ // Build flavors are selected by the "build variants" tab typically located in the bottom left of Android Studio
+ // Typically in your app, you will only set one of these.
+ if (sdlManager == null) {
+ DebugTool.logInfo(TAG, "Creating SDL Manager");
+
+ //FIXME add the transport type
+ // The app type to be used
+ Vector<AppHMIType> appType = new Vector<>();
+ appType.add(AppHMIType.MEDIA);
+
+ // The manager listener helps you know when certain events that pertain to the SDL Manager happen
+ // Here we will listen for ON_HMI_STATUS and ON_COMMAND notifications
+ SdlManagerListener listener = new SdlManagerListener() {
+ @Override
+ public void onStart(SdlManager sdlManager) {
+ DebugTool.logInfo(TAG, "SdlManager onStart");
+ }
+
+ @Override
+ public void onDestroy(SdlManager sdlManager) {
+ DebugTool.logInfo(TAG, "SdlManager onDestroy ");
+ SdlService.this.sdlManager = null;
+ if(SdlService.this.callback != null){
+ SdlService.this.callback.onEnd();
+ stop();
+ }
+ }
+
+ @Override
+ public void onError(SdlManager sdlManager, String info, Exception e) {
+ }
+
+ @Override
+ public LifecycleConfigurationUpdate managerShouldUpdateLifecycle(Language language, Language hmiLanguage) {
+ boolean isNeedUpdate = false;
+ String appName = APP_NAME;
+ String ttsName = APP_NAME;
+ switch (language) {
+ case ES_MX:
+ isNeedUpdate = true;
+ ttsName = APP_NAME_ES;
+ break;
+ case FR_CA:
+ isNeedUpdate = true;
+ ttsName = APP_NAME_FR;
+ break;
+ default:
+ break;
+ }
+ switch (hmiLanguage) {
+ case ES_MX:
+ isNeedUpdate = true;
+ appName = APP_NAME_ES;
+ break;
+ case FR_CA:
+ isNeedUpdate = true;
+ appName = APP_NAME_FR;
+ break;
+ default:
+ break;
+ }
+ if (isNeedUpdate) {
+ Vector<TTSChunk> chunks = new Vector<>(Collections.singletonList(new TTSChunk(ttsName, SpeechCapabilities.TEXT)));
+ return new LifecycleConfigurationUpdate(appName, null, chunks, null);
+ } else {
+ return null;
+ }
+ }
+ };
+
+
+ HashMap<FunctionID,OnRPCNotificationListener> notificationListenerHashMap = new HashMap<FunctionID,OnRPCNotificationListener>();
+ notificationListenerHashMap.put(FunctionID.ON_HMI_STATUS, new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ OnHMIStatus status = (OnHMIStatus) notification;
+ if (status.getHmiLevel() == HMILevel.HMI_FULL && ((OnHMIStatus) notification).getFirstRun()) {
+ setVoiceCommands();
+ sendMenus();
+ performWelcomeSpeak();
+ performWelcomeShow();
+ preloadChoices();
+ subscribeToButtons();
+ }
+ }
+ });
+
+ // Create App Icon, this is set in the SdlManager builder
+ SdlArtwork appIcon = new SdlArtwork(ICON_FILENAME, FileType.GRAPHIC_PNG, IMAGE_DIR+"sdl_s_green.png", true);
+
+ // The manager builder sets options for your session
+ SdlManager.Builder builder = new SdlManager.Builder(APP_ID, APP_NAME, listener);
+ builder.setAppTypes(appType);
+ builder.setTransportType(transport);
+ builder.setAppIcon(appIcon);
+ builder.setRPCNotificationListeners(notificationListenerHashMap);
+ sdlManager = builder.build();
+ }
+ }
+
+ /**
+ * Send some voice commands
+ */
+ private void setVoiceCommands(){
+
+ List<String> list1 = Collections.singletonList("Command One");
+ List<String> list2 = Collections.singletonList("Command two");
+
+ VoiceCommand voiceCommand1 = new VoiceCommand(list1, new VoiceCommandSelectionListener() {
+ @Override
+ public void onVoiceCommandSelected() {
+ DebugTool.logInfo(TAG, "Voice Command 1 triggered");
+ }
+ });
+
+ VoiceCommand voiceCommand2 = new VoiceCommand(list2, new VoiceCommandSelectionListener() {
+ @Override
+ public void onVoiceCommandSelected() {
+ DebugTool.logInfo(TAG, "Voice Command 2 triggered");
+ }
+ });
+
+ sdlManager.getScreenManager().setVoiceCommands(Arrays.asList(voiceCommand1,voiceCommand2));
+ }
+
+ /**
+ * Add menus for the app on SDL.
+ */
+ private void sendMenus(){
+
+ // some arts
+ SdlArtwork livio = new SdlArtwork(ICON_FILENAME, FileType.GRAPHIC_PNG, IMAGE_DIR+"sdl_s_green.png", true);
+
+ // some voice commands
+ List<String> voice2 = Collections.singletonList("Cell two");
+
+ MenuCell mainCell1 = new MenuCell("Test Cell 1 (speak)", livio, null, new MenuSelectionListener() {
+ @Override
+ public void onTriggered(TriggerSource trigger) {
+ DebugTool.logInfo(TAG, "Test cell 1 triggered. Source: "+ trigger.toString());
+ showTest();
+ }
+ });
+
+ MenuCell mainCell2 = new MenuCell("Test Cell 2", null, voice2, new MenuSelectionListener() {
+ @Override
+ public void onTriggered(TriggerSource trigger) {
+ DebugTool.logInfo(TAG, "Test cell 2 triggered. Source: "+ trigger.toString());
+ }
+ });
+
+ // SUB MENU
+
+ MenuCell subCell1 = new MenuCell("SubCell 1",null, null, new MenuSelectionListener() {
+ @Override
+ public void onTriggered(TriggerSource trigger) {
+ DebugTool.logInfo(TAG, "Sub cell 1 triggered. Source: "+ trigger.toString());
+ }
+ });
+
+ MenuCell subCell2 = new MenuCell("SubCell 2",null, null, new MenuSelectionListener() {
+ @Override
+ public void onTriggered(TriggerSource trigger) {
+ DebugTool.logInfo(TAG, "Sub cell 2 triggered. Source: "+ trigger.toString());
+ }
+ });
+
+ // sub menu parent cell
+ MenuCell mainCell3 = new MenuCell("Test Cell 3 (sub menu)", MenuLayout.LIST, null, Arrays.asList(subCell1,subCell2));
+
+ MenuCell mainCell4 = new MenuCell("Show Perform Interaction", null, null, new MenuSelectionListener() {
+ @Override
+ public void onTriggered(TriggerSource trigger) {
+ showPerformInteraction();
+ }
+ });
+
+ MenuCell mainCell5 = new MenuCell("Clear the menu",null, null, new MenuSelectionListener() {
+ @Override
+ public void onTriggered(TriggerSource trigger) {
+ DebugTool.logInfo(TAG, "Clearing Menu. Source: "+ trigger.toString());
+ // Clear this thing
+ sdlManager.getScreenManager().setMenu(Collections.<MenuCell>emptyList());
+ showAlert("Menu Cleared");
+ }
+ });
+
+ // Send the entire menu off to be created
+ sdlManager.getScreenManager().setMenu(Arrays.asList(mainCell1, mainCell2, mainCell3, mainCell4, mainCell5));
+ }
+
+ /**
+ * Will speak a sample welcome message
+ */
+ private void performWelcomeSpeak(){
+ List<TTSChunk> chunks = Collections.singletonList(new TTSChunk(WELCOME_SPEAK, SpeechCapabilities.TEXT));
+ sdlManager.sendRPC(new Speak(chunks));
+ }
+
+ /**
+ * Use the Screen Manager to set the initial screen text and set the image.
+ * Because we are setting multiple items, we will call beginTransaction() first,
+ * and finish with commit() when we are done.
+ */
+ private void performWelcomeShow() {
+ sdlManager.getScreenManager().beginTransaction();
+ sdlManager.getScreenManager().setTextField1(APP_NAME);
+ sdlManager.getScreenManager().setTextField2(WELCOME_SHOW);
+ sdlManager.getScreenManager().setPrimaryGraphic(new SdlArtwork(SDL_IMAGE_FILENAME, FileType.GRAPHIC_PNG, IMAGE_DIR+"sdl.png", true));
+ sdlManager.getScreenManager().commit(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ if (success){
+ DebugTool.logInfo(TAG, "welcome show successful");
+ }
+ }
+ });
+ }
+
+ /**
+ * Attempts to Subscribe to all preset buttons
+ */
+ private void subscribeToButtons() {
+ ButtonName[] buttonNames = {ButtonName.PLAY_PAUSE, ButtonName.SEEKLEFT, ButtonName.SEEKRIGHT, ButtonName.AC_MAX, ButtonName.AC, ButtonName.RECIRCULATE,
+ ButtonName.FAN_UP, ButtonName.FAN_DOWN, ButtonName.TEMP_UP, ButtonName.TEMP_DOWN, ButtonName.FAN_DOWN, ButtonName.DEFROST_MAX, ButtonName.DEFROST_REAR, ButtonName.DEFROST,
+ ButtonName.UPPER_VENT, ButtonName.LOWER_VENT, ButtonName.VOLUME_UP, ButtonName.VOLUME_DOWN, ButtonName.EJECT, ButtonName.SOURCE, ButtonName.SHUFFLE, ButtonName.REPEAT};
+
+ OnButtonListener onButtonListener = new OnButtonListener() {
+ @Override
+ public void onPress(ButtonName buttonName, OnButtonPress buttonPress) {
+ sdlManager.getScreenManager().setTextField1(buttonName + " pressed");
+ DebugTool.logInfo(TAG, "onPress: " + buttonName);
+ }
+
+ @Override
+ public void onEvent(ButtonName buttonName, OnButtonEvent buttonEvent) {
+ sdlManager.getScreenManager().setTextField2(buttonName + " " + buttonEvent.getButtonEventMode());
+ }
+
+ @Override
+ public void onError(String info) {
+ DebugTool.logInfo(TAG, "onError: " + info);
+ }
+ };
+
+ for (ButtonName buttonName : buttonNames) {
+ sdlManager.getScreenManager().addButtonListener(buttonName, onButtonListener);
+ }
+ }
+
+ /**
+ * Will show a sample test message on screen as well as speak a sample test message
+ */
+ private void showTest(){
+ sdlManager.getScreenManager().beginTransaction();
+ sdlManager.getScreenManager().setTextField1("Test Cell 1 has been selected");
+ sdlManager.getScreenManager().setTextField2("");
+ sdlManager.getScreenManager().commit(null);
+
+ List<TTSChunk> chunks = Collections.singletonList(new TTSChunk(TEST_COMMAND_NAME, SpeechCapabilities.TEXT));
+ sdlManager.sendRPC(new Speak(chunks));
+ }
+
+ private void showAlert(String text){
+ Alert alert = new Alert();
+ alert.setAlertText1(text);
+ alert.setDuration(5000);
+ sdlManager.sendRPC(alert);
+ }
+
+ public interface SdlServiceCallback{
+ void onEnd();
+ }
+
+ // Choice Set
+
+ private void preloadChoices(){
+ ChoiceCell cell1 = new ChoiceCell("Item 1");
+ ChoiceCell cell2 = new ChoiceCell("Item 2");
+ ChoiceCell cell3 = new ChoiceCell("Item 3");
+ choiceCellList = new ArrayList<>(Arrays.asList(cell1,cell2,cell3));
+ sdlManager.getScreenManager().preloadChoices(choiceCellList, null);
+ }
+
+ private void showPerformInteraction(){
+ if (choiceCellList != null) {
+ ChoiceSet choiceSet = new ChoiceSet("Choose an Item from the list", choiceCellList, new ChoiceSetSelectionListener() {
+ @Override
+ public void onChoiceSelected(ChoiceCell choiceCell, TriggerSource triggerSource, int rowIndex) {
+ showAlert(choiceCell.getText() + " was selected");
+ }
+
+ @Override
+ public void onError(String error) {
+ DebugTool.logError(TAG, "There was an error showing the perform interaction: "+ error);
+ }
+ });
+ sdlManager.getScreenManager().presentChoiceSet(choiceSet, InteractionMode.MANUAL_ONLY);
+ }
+ }
+}
diff --git a/javaSE/README.md b/javaSE/javaSE/README.md
index e40e9ca4a..e40e9ca4a 100644
--- a/javaSE/README.md
+++ b/javaSE/javaSE/README.md
diff --git a/javaSE/bintray.gradle b/javaSE/javaSE/bintray.gradle
index 49ab4761a..d40cb0e28 100644
--- a/javaSE/bintray.gradle
+++ b/javaSE/javaSE/bintray.gradle
@@ -5,7 +5,7 @@ apply plugin: 'maven'
def siteUrl = 'https://github.com/smartdevicelink/sdl_java_suite' // Homepage URL of the library
def gitUrl = 'https://github.com/smartdevicelink/sdl_java_suite.git' // Git repository URL
def libDescription = 'SmartDeviceLink mobile library'
-def libVersion = new File(projectDir.path, ('/../VERSION')).text.trim()
+def libVersion = new File(projectDir.path, ('/../../VERSION')).text.trim()
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
diff --git a/javaSE/bintray.properties b/javaSE/javaSE/bintray.properties
index b491c7774..b491c7774 100644
--- a/javaSE/bintray.properties
+++ b/javaSE/javaSE/bintray.properties
diff --git a/javaSE/javaSE/build.gradle b/javaSE/javaSE/build.gradle
new file mode 100644
index 000000000..1e5525316
--- /dev/null
+++ b/javaSE/javaSE/build.gradle
@@ -0,0 +1,80 @@
+apply plugin: 'java-library'
+
+group 'com.smartdevicelink'
+version new File(projectDir.path, ('/../../VERSION')).text.trim()
+
+sourceCompatibility = 1.7
+
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
+ }
+}
+
+repositories {
+ google()
+ jcenter()
+}
+
+// This extraLibs solution is explained here: https://discuss.gradle.org/t/how-to-include-dependencies-in-jar/19571/5
+configurations {
+ // configuration that holds jars to include in the jar
+ extraLibs
+}
+
+dependencies {
+ extraLibs fileTree(dir: 'libs', include: ['*.jar'])
+ extraLibs 'org.mongodb:bson:4.0.5'
+ extraLibs 'androidx.annotation:annotation:1.1.0'
+ extraLibs 'org.java-websocket:Java-WebSocket:1.3.9'
+ extraLibs 'com.livio.taskmaster:taskmaster:0.3.0'
+ configurations.api.extendsFrom(configurations.extraLibs)
+}
+
+sourceSets {
+ main.java.srcDirs += '../../base/src/main/java'
+}
+
+jar {
+ dependsOn 'generateSources'
+ from {
+ configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
+ }
+}
+
+task generateSources {
+ outputs.upToDateWhen { false }
+ File outputDir = file("$buildDir/../src/main/java/com/smartdevicelink/")
+ outputs.dir outputDir
+ doFirst {
+ println "Generating BuildConfig.java ..."
+ def srcFile = new File(outputDir, "BuildConfig.java")
+ srcFile.parentFile.mkdirs()
+ File license = new File("$buildDir/../../../LICENSE")
+ if (license.exists()) {
+ srcFile.write("/*\n")
+ def lines = license.readLines()
+ for (line in lines) {
+ srcFile.append("* ")
+ srcFile.append(line)
+ srcFile.append("\n")
+ }
+ srcFile.append("*/\n")
+ }else{
+ srcFile.write("\n")
+ }
+ srcFile.append(
+"""package com.smartdevicelink;
+
+// THIS FILE IS AUTO GENERATED, DO NOT MODIFY!!
+public final class BuildConfig {
+ public static final String VERSION_NAME = "$project.version";
+}""")
+ }
+}
+
+apply from: 'bintray.gradle'
diff --git a/javaSE/gradle/wrapper/gradle-wrapper.jar b/javaSE/javaSE/gradle/wrapper/gradle-wrapper.jar
index 87b738cbd..87b738cbd 100644
--- a/javaSE/gradle/wrapper/gradle-wrapper.jar
+++ b/javaSE/javaSE/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/javaSE/gradle/wrapper/gradle-wrapper.properties b/javaSE/javaSE/gradle/wrapper/gradle-wrapper.properties
index ca21d83d3..ca21d83d3 100644
--- a/javaSE/gradle/wrapper/gradle-wrapper.properties
+++ b/javaSE/javaSE/gradle/wrapper/gradle-wrapper.properties
diff --git a/javaSE/gradlew b/javaSE/javaSE/gradlew
index af6708ff2..af6708ff2 100755
--- a/javaSE/gradlew
+++ b/javaSE/javaSE/gradlew
diff --git a/javaSE/gradlew.bat b/javaSE/javaSE/gradlew.bat
index 0f8d5937c..6d57edc70 100644
--- a/javaSE/gradlew.bat
+++ b/javaSE/javaSE/gradlew.bat
@@ -1,84 +1,84 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m"
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/javaSE/javaSE/settings.gradle b/javaSE/javaSE/settings.gradle
new file mode 100644
index 000000000..f7ac48020
--- /dev/null
+++ b/javaSE/javaSE/settings.gradle
@@ -0,0 +1,2 @@
+rootProject.name = 'javaSE'
+
diff --git a/javaSE/src/main/java/com/livio/BSON/BsonEncoder.java b/javaSE/javaSE/src/main/java/com/livio/BSON/BsonEncoder.java
index 22c47f6cb..22c47f6cb 100644
--- a/javaSE/src/main/java/com/livio/BSON/BsonEncoder.java
+++ b/javaSE/javaSE/src/main/java/com/livio/BSON/BsonEncoder.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/BuildConfig.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/BuildConfig.java
index ecd7b1f9b..ecd7b1f9b 100644
--- a/javaSE/src/main/java/com/smartdevicelink/BuildConfig.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/BuildConfig.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java
index 17a961a17..17a961a17 100644
--- a/javaSE/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java
index 4dae813f6..4dae813f6 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java
index 8118a9c93..43aad3161 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java
@@ -60,21 +60,6 @@ public interface SdlManagerListener extends BaseSdlManagerListener {
* of LifecycleConfigurationUpdate, otherwise it should return null to indicate that the language
* is not supported.
*
- * @param language The language of the connected head unit the manager is trying to update the configuration.
- * @return An object of LifecycleConfigurationUpdate if the head unit language is supported,
- * otherwise null to indicate that the language is not supported.
- * @deprecated use {@link #managerShouldUpdateLifecycle(Language language, Language hmiLanguage)} instead
- */
- @Deprecated
- LifecycleConfigurationUpdate managerShouldUpdateLifecycle(Language language);
-
- /**
- * Called when the SDL manager detected a language mismatch. In case of a language mismatch the
- * manager should change the apps registration by updating the lifecycle configuration to the
- * specified language. If the app can support the specified language it should return an Object
- * of LifecycleConfigurationUpdate, otherwise it should return null to indicate that the language
- * is not supported.
- *
* @param language The VR+TTS language of the connected head unit the manager is trying to update the configuration.
* @param hmiLanguage The HMI display language of the connected head unit the manager is trying to update the configuration.
* @return An object of LifecycleConfigurationUpdate if the head unit language is supported,
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java
index 7786e80a0..9fb7c7ce3 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java
@@ -37,8 +37,13 @@ import androidx.annotation.RestrictTo;
import com.smartdevicelink.managers.file.filetypes.SdlFile;
import com.smartdevicelink.proxy.interfaces.ISdl;
import com.smartdevicelink.proxy.rpc.PutFile;
+import com.smartdevicelink.util.DebugTool;
import com.smartdevicelink.util.FileUtls;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+
/**
* <strong>FileManager</strong> <br>
*
@@ -56,13 +61,6 @@ import com.smartdevicelink.util.FileUtls;
*/
public class FileManager extends BaseFileManager {
- @Deprecated
- public FileManager(ISdl internalInterface) {
-
- // setup
- super(internalInterface);
- }
-
/**
* Constructor for FileManager
* @param internalInterface an instance of the ISdl interface that can be used for common SDL operations (sendRpc, addRpcListener, etc)
@@ -96,6 +94,14 @@ public class FileManager extends BaseFileManager {
}else{
throw new IllegalArgumentException("File at path was empty");
}
+ }else if(file.getURI() != null){
+ // Use URI to upload file
+ byte[] data = contentsOfUri(file.getURI());
+ if(data != null){
+ putFile.setFileData(data);
+ }else{
+ throw new IllegalArgumentException("Uri was empty");
+ }
}else if(file.getFileData() != null){
// Use file data (raw bytes) to upload file
putFile.setFileData(file.getFileData());
@@ -112,4 +118,28 @@ public class FileManager extends BaseFileManager {
return putFile;
}
+
+ /**
+ * Helper method to take Uri and turn it into byte array
+ * @param uri Uri for desired file
+ * @return Resulting byte array
+ */
+ private byte[] contentsOfUri(URI uri){
+ InputStream is = null;
+ try{
+ is = uri.toURL().openStream();
+ return contentsOfInputStream(is);
+ } catch (IOException e){
+ DebugTool.logError(TAG, "Can't read from URI", e);
+ return null;
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
}
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java
index 69bfb9238..a63c3e27b 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java
@@ -38,6 +38,8 @@ import com.smartdevicelink.proxy.rpc.enums.ImageType;
import com.smartdevicelink.proxy.rpc.enums.StaticIconName;
import com.smartdevicelink.util.DebugTool;
+import java.net.URI;
+
/**
* A class that extends SdlFile, representing artwork (JPEG, PNG, or BMP) to be uploaded to core
*/
@@ -65,6 +67,17 @@ public class SdlArtwork extends SdlFile implements Cloneable{
* Creates a new instance of SdlArtwork
* @param fileName a String value representing the name that will be used to store the file in the head unit. You can pass null if you want the library to auto generate the name
* @param fileType a FileType enum value representing the type of the file
+ * @param uri a URI value representing a file's location. Currently, it only supports local files
+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public SdlArtwork(String fileName, @NonNull FileType fileType, URI uri, boolean persistentFile) {
+ super(fileName, fileType, uri, persistentFile);
+ }
+
+ /**
+ * Creates a new instance of SdlArtwork
+ * @param fileName a String value representing the name that will be used to store the file in the head unit. You can pass null if you want the library to auto generate the name
+ * @param fileType a FileType enum value representing the type of the file
* @param data a byte array representing the data of the file
* @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
*/
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java
index 60b3f42e9..bb1c170d4 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java
@@ -36,6 +36,7 @@ import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.rpc.enums.FileType;
import com.smartdevicelink.proxy.rpc.enums.StaticIconName;
+import java.net.URI;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@@ -45,6 +46,7 @@ import java.security.NoSuchAlgorithmException;
public class SdlFile{
private String fileName;
private String filePath;
+ private URI uri;
private byte[] fileData;
private FileType fileType;
private boolean persistentFile;
@@ -76,6 +78,20 @@ public class SdlFile{
* Creates a new instance of SdlFile
* @param fileName a String value representing the name that will be used to store the file in the head unit. You can pass null if you want the library to auto generate the name
* @param fileType a FileType enum value representing the type of the file
+ * @param uri a URI value representing a file's location. Currently, it only supports local files
+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public SdlFile(String fileName, @NonNull FileType fileType, URI uri, boolean persistentFile){
+ setName(fileName);
+ setType(fileType);
+ setURI(uri);
+ setPersistent(persistentFile);
+ }
+
+ /**
+ * Creates a new instance of SdlFile
+ * @param fileName a String value representing the name that will be used to store the file in the head unit. You can pass null if you want the library to auto generate the name
+ * @param fileType a FileType enum value representing the type of the file
* @param data a byte array representing the data of the file
* @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
*/
@@ -109,6 +125,8 @@ public class SdlFile{
this.shouldAutoGenerateName = true;
if (this.getFileData() != null) {
this.fileName = generateFileNameFromData(this.getFileData());
+ } else if (this.getURI() != null) {
+ this.fileName = generateFileNameFromUri(this.getURI());
} else if (this.getFilePath() != null) {
this.fileName = generateFileNameFromFilePath(this.getFilePath());
}
@@ -143,6 +161,25 @@ public class SdlFile{
}
/**
+ * Sets the uri of the file
+ * @param uri a URI value representing a file's location. Currently, it only supports local files
+ */
+ public void setURI(URI uri){
+ this.uri = uri;
+ if (shouldAutoGenerateName && uri != null) {
+ this.fileName = generateFileNameFromUri(uri);
+ }
+ }
+
+ /**
+ * Gets the uri of the file
+ * @return a URI value representing a file's location. Currently, it only supports local files
+ */
+ public URI getURI(){
+ return uri;
+ }
+
+ /**
* Sets the byte array that represents the content of the file
* @param data a byte array representing the data of the file
*/
@@ -262,6 +299,15 @@ public class SdlFile{
}
/**
+ * Generates a file name from uri by hashing the uri string and returning the last 16 chars
+ * @param uri a URI value representing a file's location
+ * @return a String value representing the name that will be used to store the file in the head unit
+ */
+ private String generateFileNameFromUri(@NonNull URI uri) {
+ return generateFileNameFromData(uri.toString().getBytes());
+ }
+
+ /**
* Used to compile hashcode for SdlFile for use to compare in equals method
* @return Custom hashcode of SdlFile variables
*/
@@ -269,11 +315,12 @@ public class SdlFile{
public int hashCode() {
int result = 1;
result += ((getName() == null) ? 0 : Integer.rotateLeft(getName().hashCode(), 1));
- result += ((getFilePath() == null) ? 0 : Integer.rotateLeft(getFilePath().hashCode(), 2));
- result += ((getFileData() == null) ? 0 : Integer.rotateLeft(getFileData().hashCode(), 3));
- result += ((getType() == null) ? 0 : Integer.rotateLeft(getType().hashCode(), 4));
- result += Integer.rotateLeft(Boolean.valueOf(isStaticIcon()).hashCode(), 5);
- result += Integer.rotateLeft(Boolean.valueOf(isPersistent()).hashCode(), 6);
+ result += ((getURI() == null) ? 0 : Integer.rotateLeft(getURI().hashCode(), 2));
+ result += ((getFilePath() == null) ? 0 : Integer.rotateLeft(getFilePath().hashCode(), 3));
+ result += ((getFileData() == null) ? 0 : Integer.rotateLeft(getFileData().hashCode(), 4));
+ result += ((getType() == null) ? 0 : Integer.rotateLeft(getType().hashCode(), 5));
+ result += Integer.rotateLeft(Boolean.valueOf(isStaticIcon()).hashCode(), 6);
+ result += Integer.rotateLeft(Boolean.valueOf(isPersistent()).hashCode(), 7);
return result;
}
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java
index eda411dc5..eda411dc5 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java
index b7167b81c..b7167b81c 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java
index e4e635883..e4e635883 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java
index b27b00bcb..b27b00bcb 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java
index 2989be3f2..2989be3f2 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java
index a7e9d30c2..a7e9d30c2 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java
index 8db1cd957..8db1cd957 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java
index 08525e7c1..76c142e9a 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java
@@ -47,10 +47,10 @@ import com.smartdevicelink.proxy.rpc.enums.FileType;
@RestrictTo(RestrictTo.Scope.LIBRARY)
class TextAndGraphicManager extends BaseTextAndGraphicManager {
- TextAndGraphicManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager, @NonNull SoftButtonManager softButtonManager) {
+ TextAndGraphicManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager, @NonNull SoftButtonManager softButtonManager) {
super(internalInterface, fileManager, softButtonManager);
}
-
+
@Override
SdlArtwork getBlankArtwork(){
if (blankArtwork == null){
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java
index cd7f20dfe..cd7f20dfe 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java
index ec2ae5fb3..ec2ae5fb3 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java
index 1d2233fb0..1d2233fb0 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
index 21ff54fa8..816e70e20 100644
--- a/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
@@ -31,9 +31,6 @@
*/
package com.smartdevicelink.protocol;
-import android.os.Parcel;
-import android.os.Parcelable;
-import androidx.annotation.RestrictTo;
@RestrictTo(RestrictTo.Scope.LIBRARY)
public class SdlPacket extends BaseSdlPacket {
@@ -57,28 +54,4 @@ public class SdlPacket extends BaseSdlPacket {
protected SdlPacket(BaseSdlPacket packet) {
super(packet);
}
-
- @Deprecated
- public SdlPacket(Parcel p){}
-
- @Deprecated
- public int describeContents() {
- return 0;
- }
-
- @Deprecated
- public void writeToParcel(Parcel dest, int flags) {}
-
- @Deprecated
- public static final Parcelable.Creator<SdlPacket> CREATOR = new Parcelable.Creator<SdlPacket>() {
- public SdlPacket createFromParcel(Parcel in) {
- return new SdlPacket(in);
- }
-
- @Override
- public SdlPacket[] newArray(int size) {
- return new SdlPacket[size];
- }
-
- };
}
diff --git a/javaSE/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java
index 18343acb0..18343acb0 100644
--- a/javaSE/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
index f65f98720..e8ed85b70 100644
--- a/javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
@@ -29,8 +29,8 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-package com.smartdevicelink.security;
-
-public abstract class SdlSecurityBase extends AbstractSdlSecurityBase {
-
-}
+package com.smartdevicelink.security;
+
+public abstract class SdlSecurityBase extends AbstractSdlSecurityBase {
+
+}
diff --git a/javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java
index 482b4a846..482b4a846 100644
--- a/javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransport.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransport.java
index ad02f96d2..ad02f96d2 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransport.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransport.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java
index af0613aa1..af0613aa1 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/TransportCallback.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportCallback.java
index 551ed9d29..551ed9d29 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/TransportCallback.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportCallback.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/TransportInterface.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportInterface.java
index 989b2df33..989b2df33 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/TransportInterface.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportInterface.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/TransportManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportManager.java
index c8a07a1cc..c8a07a1cc 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/TransportManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportManager.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServer.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServer.java
index 8f5411ce0..8f5411ce0 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServer.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServer.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java
index 6add5ae71..23e0b25c1 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java
@@ -46,7 +46,6 @@ public class WebSocketServerConfig extends BaseTransportConfig{
*/
public WebSocketServerConfig(int port, int connectionLostTimeout){
this.port = port;
- this.shareConnection = false;
this.connectionLostTimeout = connectionLostTimeout;
}
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java
index d46e8aac6..d46e8aac6 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java
index 95d0ceac2..95d0ceac2 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java
diff --git a/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java
new file mode 100644
index 000000000..d8155c2fd
--- /dev/null
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java
@@ -0,0 +1,41 @@
+/*
+ * 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.transport.utl;
+
+import com.smartdevicelink.transport.enums.TransportType;
+
+public class TransportRecord extends BaseTransportRecord {
+
+ public TransportRecord(TransportType transportType, String address) {
+ super(transportType, address);
+ }
+}
diff --git a/javaSE/src/main/java/com/smartdevicelink/util/Log.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/util/Log.java
index 2de00692c..2de00692c 100644
--- a/javaSE/src/main/java/com/smartdevicelink/util/Log.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/util/Log.java
diff --git a/javaSE/src/main/java/org/json/JSON.java b/javaSE/javaSE/src/main/java/org/json/JSON.java
index 1b32e698d..1b32e698d 100644
--- a/javaSE/src/main/java/org/json/JSON.java
+++ b/javaSE/javaSE/src/main/java/org/json/JSON.java
diff --git a/javaSE/src/main/java/org/json/JSONArray.java b/javaSE/javaSE/src/main/java/org/json/JSONArray.java
index 996f44909..996f44909 100644
--- a/javaSE/src/main/java/org/json/JSONArray.java
+++ b/javaSE/javaSE/src/main/java/org/json/JSONArray.java
diff --git a/javaSE/src/main/java/org/json/JSONException.java b/javaSE/javaSE/src/main/java/org/json/JSONException.java
index 05e1dddc9..05e1dddc9 100644
--- a/javaSE/src/main/java/org/json/JSONException.java
+++ b/javaSE/javaSE/src/main/java/org/json/JSONException.java
diff --git a/javaSE/src/main/java/org/json/JSONObject.java b/javaSE/javaSE/src/main/java/org/json/JSONObject.java
index 74ea973c2..74ea973c2 100644
--- a/javaSE/src/main/java/org/json/JSONObject.java
+++ b/javaSE/javaSE/src/main/java/org/json/JSONObject.java
diff --git a/javaSE/src/main/java/org/json/JSONStringer.java b/javaSE/javaSE/src/main/java/org/json/JSONStringer.java
index dd3b2a7d8..dd3b2a7d8 100644
--- a/javaSE/src/main/java/org/json/JSONStringer.java
+++ b/javaSE/javaSE/src/main/java/org/json/JSONStringer.java
diff --git a/javaSE/src/main/java/org/json/JSONTokener.java b/javaSE/javaSE/src/main/java/org/json/JSONTokener.java
index 4bdd9ad37..4bdd9ad37 100644
--- a/javaSE/src/main/java/org/json/JSONTokener.java
+++ b/javaSE/javaSE/src/main/java/org/json/JSONTokener.java
diff --git a/javaSE/settings.gradle b/javaSE/settings.gradle
index f7ac48020..0652c8ce8 100644
--- a/javaSE/settings.gradle
+++ b/javaSE/settings.gradle
@@ -1,2 +1,2 @@
-rootProject.name = 'javaSE'
-
+include ':javaSE', ':hello_sdl_java', ':sdl_java_se'
+project (":sdl_java_se").projectDir = new File("/javaSE/")
diff --git a/javaSE/src/main/java/android/os/AsyncTask.java b/javaSE/src/main/java/android/os/AsyncTask.java
deleted file mode 100644
index db6b69a8e..000000000
--- a/javaSE/src/main/java/android/os/AsyncTask.java
+++ /dev/null
@@ -1,27 +0,0 @@
- /*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Note: This file has been modified from its original form.
- */
-
-package android.os;
-
-@Deprecated
-public abstract class AsyncTask<Params, Progress, Result> {
-
-
- abstract protected Result doInBackground(Params...params);
-
-}
diff --git a/javaSE/src/main/java/android/os/Parcel.java b/javaSE/src/main/java/android/os/Parcel.java
deleted file mode 100644
index b99dbc671..000000000
--- a/javaSE/src/main/java/android/os/Parcel.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2006 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Note: This file has been modified from its original form.
- */
-
-package android.os;
-
-@Deprecated
-public class Parcel {
-
- public void writeInt(int data){
-
- }
-
- public void writeByteArray(byte[] bytes){
-
- }
-
- public void writeString(String data){
-
- }
-
- public void writeParcelable(Parcelable p, int flags){
-
- }
-
- public int readInt(){
- return 0;
- }
-
- public String readString(){
- return "hello";
- }
-
- public byte[] readByteArray(byte[] array){
- return array;
- }
-
- public Parcelable readParcelable(ClassLoader loader){
- return null;
- }
-
- public int dataAvail(){
- return 0;
- }
-}
diff --git a/javaSE/src/main/java/android/os/Parcelable.java b/javaSE/src/main/java/android/os/Parcelable.java
deleted file mode 100644
index e09a1754c..000000000
--- a/javaSE/src/main/java/android/os/Parcelable.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2006 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Note: This file has been modified from its original form.
- */
-package android.os;
-
-@Deprecated
-public interface Parcelable {
-
- int describeContents();
- void writeToParcel(Parcel dest, int flags);
-
-
- abstract class Creator<T>{
- public abstract T[] newArray(int size);
- }
-
-}
diff --git a/javaSE/src/main/java/android/util/Log.java b/javaSE/src/main/java/android/util/Log.java
deleted file mode 100644
index 7374ff04c..000000000
--- a/javaSE/src/main/java/android/util/Log.java
+++ /dev/null
@@ -1,71 +0,0 @@
- /*
- * Copyright (C) 2006 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Note: This file has been modified from its original form.
- */
-
-package android.util;
-
-@Deprecated
-public class Log {
-
-
- public static int i(String tag, String message){
- System.out.print("\r\nINFO: " + tag+ " - " + message);
- return 10;
-
-
- }
- public static int v(String tag, String message){
- System.out.print("\r\nVERBOSE: " + tag+ " - " + message);
- return 10;
-
-
- }
- public static int d(String tag, String message){
- System.out.print("\r\nDEBUG: " + tag+ " - " + message);
- return 10;
-
-
- }
- public static int w(String tag, String message){
- System.out.print("\r\nWARN: " + tag+ " - " + message);
- return 10;
-
-
- }
- public static int e(String tag, String message){
- System.out.print("\r\nERROR: " + tag+ " - " + message);
- return 10;
-
- }
- public static int e(String tag, String message, Exception e){
- if(e != null){
- System.out.print("\r\nERROR: " + tag+ " - " + message + " - " + e.getMessage());
- }else{
- System.out.print("\r\nERROR: " + tag+ " - " + message);
- }
- return 10;
- }
- public static int e(String tag, String message, Throwable t){
- if(t != null){
- System.out.print("\r\nERROR: " + tag+ " - " + message + " - " + t.getMessage());
- }else{
- System.out.print("\r\nERROR: " + tag+ " - " + message);
- }
- return 10;
- }
-
-}
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java b/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java
deleted file mode 100644
index 7bc15e2ab..000000000
--- a/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java
+++ /dev/null
@@ -1,77 +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.transport.utl;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-import com.smartdevicelink.transport.enums.TransportType;
-
-public class TransportRecord extends BaseTransportRecord {
-
- public TransportRecord(TransportType transportType, String address) {
- super(transportType, address);
- }
-
- @Deprecated
- public TransportRecord(Parcel p) {}
-
- @Deprecated
- public int describeContents() {
- return 0;
- };
-
- @Deprecated
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(type!=null? 1 : 0);
- if(type != null){
- dest.writeString(type.name());
- }
-
- dest.writeInt(address !=null? 1 : 0);
- if(address != null){
- dest.writeString(address);
- }
- }
-
- @Deprecated
- public static final Parcelable.Creator<TransportRecord> CREATOR = new Parcelable.Creator<TransportRecord>() {
- public TransportRecord createFromParcel(Parcel in) {
- return new TransportRecord(in);
- }
-
- @Override
- public TransportRecord[] newArray(int size) {
- return new TransportRecord[size];
- }
-
- };
-}
diff --git a/javaSE/src/main/java/com/smartdevicelink/util/HttpRequestTask.java b/javaSE/src/main/java/com/smartdevicelink/util/HttpRequestTask.java
deleted file mode 100644
index 77c9f4f7a..000000000
--- a/javaSE/src/main/java/com/smartdevicelink/util/HttpRequestTask.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package com.smartdevicelink.util;
-
-import android.os.AsyncTask;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.net.HttpURLConnection;
-import java.net.URL;
-
-
-@Deprecated
-public class HttpRequestTask extends AsyncTask<String, String, String> {
- private static final String TAG = "Http Request Task";
-
- public static final String REQUEST_TYPE_POST = "POST";
- public static final String REQUEST_TYPE_GET = "GET";
- public static final String REQUEST_TYPE_DELETE = "DELETE";
-
- HttpRequestTaskCallback cb;
-
- /**
- * @param hcb callback for when this task finishes
- * <br><br><b> - When calling execute, params as followed: </b><br>
- * 1. Url String<br>
- * 2. Request type (Defined in this class) REQUEST_TYPE_POST, REQUEST_TYPE_GET, REQUEST_TYPE_DELETE<br>
- * 3. (Optional) Data to be sent. <br>
- * 4. (Optional) Content Type Default will be application/json<br>
- * 5. (Optional) Accept Type default will be application/json
- *
- */
- @Deprecated
- public HttpRequestTask( HttpRequestTaskCallback hcb){
- this.cb = hcb;
- }
-
- @Deprecated
- protected String doInBackground(String... params) {
- int length = params.length;
- String urlString = params[0];
- String request_type = params[1];
-
- //Grab and set data to be written if included
- String data;
- if(length>2){
- data = params[2];
- }else{
- data = null;
- }
-
- //Grab and set content type for the header if included
- String contentType;
- if(length>3){
- contentType = params[3];
- }else{
- contentType = "application/json";
- }
- //Grab and set accept type for the header if included
- String acceptType;
- if(length>4){
- acceptType = params[4];
- }else{
- acceptType = "application/json";
- }
-
- if(urlString == null || request_type == null){
- DebugTool.logError(TAG, "Can't process request, param error");
- if(cb!=null){
- cb.httpFailure(-1);
- cb = null;
- }
- return "Error";
- }
-
- HttpURLConnection urlConnection = null;
- BufferedReader reader = null;
- try {
- URL url = new URL(urlString);
- urlConnection = (HttpURLConnection) url.openConnection();
- urlConnection.setDoOutput(true);
- urlConnection.setRequestMethod(request_type);
- urlConnection.setRequestProperty("Content-Type", contentType);
- urlConnection.setRequestProperty("Accept", acceptType);
- //If we have data, we should write it out
- if(data !=null){
- Writer writer = new BufferedWriter(new OutputStreamWriter(urlConnection.getOutputStream(), "UTF-8"));
- writer.write(data);
- writer.close();
- }
- InputStream inputStream = urlConnection.getInputStream();
-
- int responseCode = urlConnection.getResponseCode();
- if (responseCode == 200) { //Success
- //input stream
- StringBuffer buffer = new StringBuffer();
- if (inputStream == null) {
- // Nothing to do.
- if(cb!=null){
- cb.httpCallComplete(null);
- cb = null;
- }
- return null;
- }
- reader = new BufferedReader(new InputStreamReader(inputStream));
-
- String inputLine;
- while ((inputLine = reader.readLine()) != null)
- buffer.append(inputLine).append("\n");
- if (buffer.length() == 0) {
- // Stream was empty. No point in parsing.
- if(cb!=null){
- cb.httpCallComplete(null);
- cb = null;
- }
- return null;
- }
- String response = null;
-
- response = buffer.toString();
- //send to post execute
- if(cb!=null){
- cb.httpCallComplete(response);
- cb = null;
- }
- return response;
- }else{
- if(cb!=null){
- cb.httpFailure(responseCode);
- cb = null;
- }
- DebugTool.logError(TAG, "Failed to download file - " + responseCode);
- return null;
- }
-
-
- } catch (IOException e) {
- e.printStackTrace();
- } catch (NullPointerException e){ // Only to catch error in urlConnection.getOutputStream() - when servers are down
- e.printStackTrace();
- urlConnection = null;
- }
- finally {
- if (urlConnection != null) {
- urlConnection.disconnect();
- }
- if (reader != null) {
- try {
- reader.close();
- } catch (final IOException e) {
- DebugTool.logError(TAG, "Error closing stream", e);
- }
- }
- if(cb!=null){
- cb.httpFailure(-1);
- }
- }
- return null;
- }
-
- /**
- * Callback interface for HTTP requests.
- * @author Joey Grover
- *
- */
- @Deprecated
- public interface HttpRequestTaskCallback{
- /**
- * Called when HTTP request is successfully completed.
- * @param response The response to the HTTP request.
- */
- public abstract void httpCallComplete(String response);
- /**
- * Called when HTTP request failed.
- * @param statusCode The HTTP failure code.
- */
- public abstract void httpFailure(int statusCode);
- }
-
-}