diff options
author | BrettyWhite <geekman3454@protonmail.com> | 2018-10-02 17:13:01 -0400 |
---|---|---|
committer | BrettyWhite <geekman3454@protonmail.com> | 2018-10-02 17:13:01 -0400 |
commit | fb693f60ce1711a6d0638358371ddb34f5964eb7 (patch) | |
tree | 0efc0149d2d2d2f01b33d6c19f49e19d2a62fcf4 | |
parent | f72558bc05d6c971f8ab17e71b416d1cca93ae40 (diff) | |
download | sdl_android-fb693f60ce1711a6d0638358371ddb34f5964eb7.tar.gz |
change build flavors to better represent new transport options
-rwxr-xr-x | hello_sdl_android/build.gradle | 24 | ||||
-rwxr-xr-x | hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java | 21 |
2 files changed, 12 insertions, 33 deletions
diff --git a/hello_sdl_android/build.gradle b/hello_sdl_android/build.gradle index 86101cb27..22aef813c 100755 --- a/hello_sdl_android/build.gradle +++ b/hello_sdl_android/build.gradle @@ -18,34 +18,26 @@ android { } flavorDimensions "default" productFlavors{ - mbt_high { - buildConfigField 'String', 'TRANSPORT', '"MBT"' + multi_high { + buildConfigField 'String', 'TRANSPORT', '"MULTI"' buildConfigField 'String', 'SECURITY', '"HIGH"' } - mbt_med { - buildConfigField 'String', 'TRANSPORT', '"MBT"' + multi_med { + buildConfigField 'String', 'TRANSPORT', '"MULTI"' buildConfigField 'String', 'SECURITY', '"MED"' } - mbt_low { - buildConfigField 'String', 'TRANSPORT', '"MBT"' + multi_low { + buildConfigField 'String', 'TRANSPORT', '"MULTI"' buildConfigField 'String', 'SECURITY', '"LOW"' } - mbt_off { - buildConfigField 'String', 'TRANSPORT', '"MBT"' - buildConfigField 'String', 'SECURITY', '"OFF"' - } - lbt { - buildConfigField 'String', 'TRANSPORT', '"LBT"' + multi_off { + buildConfigField 'String', 'TRANSPORT', '"MULTI"' buildConfigField 'String', 'SECURITY', '"OFF"' } tcp { buildConfigField 'String', 'TRANSPORT', '"TCP"' buildConfigField 'String', 'SECURITY', '"OFF"' } - usb { - buildConfigField 'String', 'TRANSPORT', '"USB"' - buildConfigField 'String', 'SECURITY', '"OFF"' - } } lintOptions { disable 'GoogleAppIndexingWarning' diff --git a/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java b/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java index de87d5d83..b1d3b9636 100755 --- a/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java +++ b/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java @@ -45,7 +45,7 @@ public class SdlService extends Service { private static final String TAG = "SDL Service"; private static final String APP_NAME = "Hello Sdl"; - private static final String APP_ID = "8677309"; + 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"; @@ -101,7 +101,7 @@ public class SdlService extends Service { @Override public int onStartCommand(Intent intent, int flags, int startId) { - startProxy(intent); + startProxy(); return START_STICKY; } @@ -118,12 +118,12 @@ public class SdlService extends Service { super.onDestroy(); } - private void startProxy(Intent intent) { + private void startProxy() { // This logic is to select the correct transport and security levels defined in the selected build flavor if (sdlManager == null) { Log.i(TAG, "Starting SDL Proxy"); BaseTransportConfig transport = null; - if (BuildConfig.TRANSPORT.equals("MBT")) { + if (BuildConfig.TRANSPORT.equals("MULTI")) { int securityLevel; if (BuildConfig.SECURITY.equals("HIGH")) { securityLevel = MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH; @@ -135,21 +135,8 @@ public class SdlService extends Service { securityLevel = MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF; } transport = new MultiplexTransportConfig(this, APP_ID, securityLevel); - } else if (BuildConfig.TRANSPORT.equals("LBT")) { - transport = new BTTransportConfig(); } else if (BuildConfig.TRANSPORT.equals("TCP")) { transport = new TCPTransportConfig(TCP_PORT, DEV_MACHINE_IP_ADDRESS, true); - } else if (BuildConfig.TRANSPORT.equals("USB")) { - if (intent != null && intent.hasExtra(UsbManager.EXTRA_ACCESSORY)) { //If we want to support USB transport - if (android.os.Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.HONEYCOMB) { - Log.e(TAG, "Unable to start proxy. Android OS version is too low"); - return; - } else { - //We have a usb transport - transport = new USBTransportConfig(getBaseContext(), (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY)); - Log.d(TAG, "USB created."); - } - } } // The app type to be used |