diff --git a/.gitignore b/.gitignore index 0fbc275966..f4441437f4 100755 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.apk *.ap_ .externalNativeBuild +.cxx/ # Files for the Dalvik VM *.dex @@ -108,7 +109,7 @@ local.properties # PDT-specific .buildpath -# sbteclipse plugin +# sbteclipse plugin .target # TeXlipse plugin @@ -301,4 +302,4 @@ DerivedData ant.properties build.xml HVCW.jar -RobotLibrary.jar \ No newline at end of file +RobotLibrary.jar diff --git a/README.md b/README.md index 975ea0b56c..48e91f1d4d 100755 --- a/README.md +++ b/README.md @@ -31,10 +31,10 @@ DeviceConnect-Androidのソースコードをダウンロードしてくださ $ git clone https://github.com/DeviceConnect/DeviceConnect-Android.git ``` -ビルド前にANDROID_HOMEの環境変数にAndroidSDKへのパスが設定されていることを確認してください。 +ビルド前にANDROID_SDK_ROOTの環境変数にAndroidSDKへのパスが設定されていることを確認してください。 ``` -$ echo 'export ANDROID_HOME=' >> ~/.bash_profile +$ echo 'export ANDROID_SDK_ROOT=' >> ~/.bash_profile ``` <path>には、AndroidSDKへのパスを指定してください。 @@ -49,7 +49,7 @@ $ ./gradlew assembleDebug Device Connect Managerを端末にインストールします。 ``` -$ adb install app/build/outputs/apk/app-debug.apk +$ adb install dconnect-manager-app/build/outputs/apk/debug/dconnect-manager-app-debug.apk ``` ### Windows diff --git a/dConnectDevicePlugin/dConnectDeviceAndroidWear/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceAndroidWear/app/build.gradle index d860a13275..54cbb27a04 100644 --- a/dConnectDevicePlugin/dConnectDeviceAndroidWear/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceAndroidWear/app/build.gradle @@ -8,7 +8,7 @@ repositories { dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.2' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' implementation 'com.android.support:multidex:1.0.3' implementation 'com.google.android.gms:play-services-wearable:15.0.1' @@ -17,7 +17,7 @@ dependencies { android { - compileSdkVersion 28 + compileSdkVersion 29 def getVersionName = { -> def version @@ -33,7 +33,7 @@ android { defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.wear" minSdkVersion 23 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName getVersionName() multiDexEnabled true @@ -69,4 +69,8 @@ android { checkReleaseBuilds false abortOnError false } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } } \ No newline at end of file diff --git a/dConnectDevicePlugin/dConnectDeviceAndroidWear/wear-app/build.gradle b/dConnectDevicePlugin/dConnectDeviceAndroidWear/wear-app/build.gradle index 2341cb0cb1..99c4926b91 100755 --- a/dConnectDevicePlugin/dConnectDeviceAndroidWear/wear-app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceAndroidWear/wear-app/build.gradle @@ -2,11 +2,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.wear" minSdkVersion 23 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName '2.0.0' } @@ -34,7 +34,10 @@ android { checkReleaseBuilds false abortOnError false } - + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } } dependencies { diff --git a/dConnectDevicePlugin/dConnectDeviceChromeCast/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceChromeCast/app/build.gradle index af11607f56..4fbcc585de 100644 --- a/dConnectDevicePlugin/dConnectDeviceChromeCast/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceChromeCast/app/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 26 + compileSdkVersion 28 def getVersionName = { -> def version @@ -17,7 +17,7 @@ android { defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.chromecast" minSdkVersion 14 - targetSdkVersion 26 + targetSdkVersion 28 versionCode 1 versionName getVersionName() } @@ -48,6 +48,10 @@ android { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } } repositories { @@ -59,9 +63,9 @@ repositories { dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.1' - implementation 'com.android.support:appcompat-v7:26.1.0' - implementation 'com.android.support:mediarouter-v7:26.1.0' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' + implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'com.android.support:mediarouter-v7:28.0.0' implementation 'com.google.android.gms:play-services-cast-framework:11.8.0' } diff --git a/dConnectDevicePlugin/dConnectDeviceFaBo/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceFaBo/app/build.gradle index ed9ec1ac90..280d3ae9a1 100644 --- a/dConnectDevicePlugin/dConnectDeviceFaBo/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceFaBo/app/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 26 + compileSdkVersion 29 def getVersionName = { -> def version @@ -16,7 +16,7 @@ android { defaultConfig { minSdkVersion 16 - targetSdkVersion 26 + targetSdkVersion 29 versionCode 1 versionName getVersionName() } @@ -41,6 +41,10 @@ android { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } } repositories { @@ -52,7 +56,7 @@ repositories { dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - api 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.2' + api 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' androidTestImplementation 'com.android.support.test:testing-support-lib:0.1' androidTestImplementation 'org.hamcrest:hamcrest-library:1.3' } diff --git a/dConnectDevicePlugin/dConnectDeviceFaBo/app/src/main/java/org/deviceconnect/android/deviceplugin/fabo/FaBoDeviceService.java b/dConnectDevicePlugin/dConnectDeviceFaBo/app/src/main/java/org/deviceconnect/android/deviceplugin/fabo/FaBoDeviceService.java index 02f753fae0..387cd55fc0 100644 --- a/dConnectDevicePlugin/dConnectDeviceFaBo/app/src/main/java/org/deviceconnect/android/deviceplugin/fabo/FaBoDeviceService.java +++ b/dConnectDevicePlugin/dConnectDeviceFaBo/app/src/main/java/org/deviceconnect/android/deviceplugin/fabo/FaBoDeviceService.java @@ -27,7 +27,8 @@ import org.deviceconnect.android.message.DConnectMessageService; import org.deviceconnect.android.profile.DConnectProfile; import org.deviceconnect.android.profile.SystemProfile; -import org.deviceconnect.android.profile.spec.DConnectProfileSpec; +import org.deviceconnect.android.profile.spec.DConnectServiceSpec; +import org.deviceconnect.android.profile.spec.models.Swagger; import org.deviceconnect.android.service.DConnectService; import java.util.ArrayList; @@ -269,12 +270,6 @@ public VirtualService updateServiceData(final ServiceData serviceData) { DConnectProfile profile = VirtualServiceFactory.createProfile(p); if (profile != null) { service.addProfile(profile); - - DConnectProfileSpec profileSpec = - getPluginSpec().findProfileSpec(profile.getProfileName().toLowerCase()); - if (profileSpec != null) { - profile.setProfileSpec(profileSpec); - } profile.setContext(this); } } diff --git a/dConnectDevicePlugin/dConnectDeviceFaBo/plugin/build.gradle b/dConnectDevicePlugin/dConnectDeviceFaBo/plugin/build.gradle index db5700f2a0..7f4a349f3d 100644 --- a/dConnectDevicePlugin/dConnectDeviceFaBo/plugin/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceFaBo/plugin/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 26 + compileSdkVersion 29 def getVersionName = { -> def version @@ -17,7 +17,7 @@ android { defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.fabo" minSdkVersion 16 - targetSdkVersion 26 + targetSdkVersion 29 versionCode 1 versionName getVersionName() @@ -44,6 +44,10 @@ android { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } } repositories { diff --git a/dConnectDevicePlugin/dConnectDeviceFaBo/things-plugin/build.gradle b/dConnectDevicePlugin/dConnectDeviceFaBo/things-plugin/build.gradle index 9e2c797bbb..41b11c069f 100644 --- a/dConnectDevicePlugin/dConnectDeviceFaBo/things-plugin/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceFaBo/things-plugin/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 26 + compileSdkVersion 29 def getVersionName = { -> def version @@ -17,7 +17,7 @@ android { defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.fabo" minSdkVersion 16 - targetSdkVersion 26 + targetSdkVersion 29 versionCode 1 versionName getVersionName() @@ -44,6 +44,10 @@ android { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } } repositories { maven { url 'https://raw.githubusercontent.com/DeviceConnect/DeviceConnect-Android/master/dConnectSDK/dConnectSDKForAndroid/repository/' } @@ -55,5 +59,5 @@ repositories { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(':app') - compileOnly 'com.google.android.things:androidthings:0.4-devpreview' + compileOnly 'com.google.android.things:androidthings:1.0' } diff --git a/dConnectDevicePlugin/dConnectDeviceFaBo/things-plugin/src/main/java/org/deviceconnect/android/deviceplugin/fabo/device/things/FaBoThingsDeviceControl.java b/dConnectDevicePlugin/dConnectDeviceFaBo/things-plugin/src/main/java/org/deviceconnect/android/deviceplugin/fabo/device/things/FaBoThingsDeviceControl.java index 49389ec58d..6d6300ef12 100644 --- a/dConnectDevicePlugin/dConnectDeviceFaBo/things-plugin/src/main/java/org/deviceconnect/android/deviceplugin/fabo/device/things/FaBoThingsDeviceControl.java +++ b/dConnectDevicePlugin/dConnectDeviceFaBo/things-plugin/src/main/java/org/deviceconnect/android/deviceplugin/fabo/device/things/FaBoThingsDeviceControl.java @@ -7,7 +7,7 @@ import com.google.android.things.pio.Gpio; import com.google.android.things.pio.GpioCallback; import com.google.android.things.pio.I2cDevice; -import com.google.android.things.pio.PeripheralManagerService; +import com.google.android.things.pio.PeripheralManager; import org.deviceconnect.android.deviceplugin.fabo.BuildConfig; import org.deviceconnect.android.deviceplugin.fabo.device.FaBoDeviceControl; @@ -113,7 +113,7 @@ public class FaBoThingsDeviceControl implements FaBoDeviceControl { /** * GPIO,I2cなどのデバイスを管理するクラス. */ - private PeripheralManagerService mManagerService; + private PeripheralManager mManagerService; /** * GPIOの処理を行うハンドラ. @@ -132,7 +132,7 @@ public void initialize() { Log.i(TAG, "FaBoThingsDeviceControl::initialize"); } - mManagerService = new PeripheralManagerService(); + mManagerService = PeripheralManager.getInstance(); initGpio(); } diff --git a/dConnectDevicePlugin/dConnectDeviceHOGP/plugin/build.gradle b/dConnectDevicePlugin/dConnectDeviceHOGP/plugin/build.gradle index f6c841bcc1..9c70c8243f 100644 --- a/dConnectDevicePlugin/dConnectDeviceHOGP/plugin/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceHOGP/plugin/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.1' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' } repositories { @@ -14,12 +14,12 @@ repositories { android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.hogp" minSdkVersion 14 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName '1.0.0' } @@ -51,4 +51,9 @@ android { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } \ No newline at end of file diff --git a/dConnectDevicePlugin/dConnectDeviceHVC/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceHVC/app/build.gradle index 63f37dd31f..7ffefef47f 100644 --- a/dConnectDevicePlugin/dConnectDeviceHVC/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceHVC/app/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } def getVersionName = { -> @@ -22,7 +22,7 @@ android { defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.hvc" minSdkVersion 18 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName getVersionName() } @@ -64,5 +64,5 @@ repositories { dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.1' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' } diff --git a/dConnectDevicePlugin/dConnectDeviceHVC/app/src/main/java/org/deviceconnect/android/deviceplugin/hvc/HvcDeviceService.java b/dConnectDevicePlugin/dConnectDeviceHVC/app/src/main/java/org/deviceconnect/android/deviceplugin/hvc/HvcDeviceService.java index a0536ca0a0..c2c591aa4b 100755 --- a/dConnectDevicePlugin/dConnectDeviceHVC/app/src/main/java/org/deviceconnect/android/deviceplugin/hvc/HvcDeviceService.java +++ b/dConnectDevicePlugin/dConnectDeviceHVC/app/src/main/java/org/deviceconnect/android/deviceplugin/hvc/HvcDeviceService.java @@ -589,7 +589,7 @@ public void timeoutProc() { */ private void initDetector() { if (mDetector == null) { - mDetector = new BleDeviceDetector(getContext()); + mDetector = new BleDeviceDetector(this); mDetector.setListener(new BleDeviceDiscoveryListener() { @Override diff --git a/dConnectDevicePlugin/dConnectDeviceHVCP/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceHVCP/app/build.gradle index fb1b69000d..e951588f01 100644 --- a/dConnectDevicePlugin/dConnectDeviceHVCP/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceHVCP/app/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 def getVersionName = { -> def version @@ -17,7 +17,7 @@ android { defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.hvcp" minSdkVersion 15 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName getVersionName() } @@ -48,6 +48,11 @@ android { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } repositories { @@ -60,6 +65,6 @@ repositories { dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.1' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' implementation 'com.hoho.android:usb-serial-for-android:0.2.0-SNAPSHOT@aar' } diff --git a/dConnectDevicePlugin/dConnectDeviceHeartRate/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceHeartRate/app/build.gradle index f03fa4c947..befa5c8cf7 100644 --- a/dConnectDevicePlugin/dConnectDeviceHeartRate/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceHeartRate/app/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 def getVersionName = { -> def version @@ -17,7 +17,7 @@ android { defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.heartrate" minSdkVersion 18 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName getVersionName() } @@ -48,6 +48,11 @@ android { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } repositories { @@ -59,7 +64,7 @@ repositories { dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.1' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' androidTestImplementation('junit:junit:4.11') { exclude group: 'org.hamcrest' } diff --git a/dConnectDevicePlugin/dConnectDeviceHeartRate/app/src/main/java/org/deviceconnect/android/deviceplugin/heartrate/HeartRateDeviceService.java b/dConnectDevicePlugin/dConnectDeviceHeartRate/app/src/main/java/org/deviceconnect/android/deviceplugin/heartrate/HeartRateDeviceService.java index 405285fc69..e1e714f6d4 100644 --- a/dConnectDevicePlugin/dConnectDeviceHeartRate/app/src/main/java/org/deviceconnect/android/deviceplugin/heartrate/HeartRateDeviceService.java +++ b/dConnectDevicePlugin/dConnectDeviceHeartRate/app/src/main/java/org/deviceconnect/android/deviceplugin/heartrate/HeartRateDeviceService.java @@ -121,7 +121,7 @@ public void onCreate() { mLogger.fine("HeartRateDeviceService start."); - if (!BleUtils.isBLESupported(getContext())) { + if (!BleUtils.isBLESupported(this)) { mLogger.warning("BLE is not support."); return; } diff --git a/dConnectDevicePlugin/dConnectDeviceHitoe/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceHitoe/app/build.gradle index 22d9d165c5..a6c62b5916 100644 --- a/dConnectDevicePlugin/dConnectDeviceHitoe/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceHitoe/app/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 def getVersionName = { -> def version @@ -17,7 +17,7 @@ android { defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.hitoe" minSdkVersion 21 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName getVersionName() } @@ -48,6 +48,11 @@ android { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } repositories { @@ -58,7 +63,7 @@ repositories { dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.1' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' testImplementation 'junit:junit:4.12' - implementation 'com.android.support:appcompat-v7:26.1.0' + implementation 'com.android.support:appcompat-v7:28.0.0' } diff --git a/dConnectDevicePlugin/dConnectDeviceHost/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceHost/app/build.gradle index 377f26ee0f..172f1ec97c 100644 --- a/dConnectDevicePlugin/dConnectDeviceHost/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceHost/app/build.gradle @@ -4,7 +4,6 @@ def DEMO_ZIP_NAME = "demo.zip" android { compileSdkVersion 29 - buildToolsVersion '28.0.3' def getVersionName = { -> def version @@ -77,7 +76,7 @@ dependencies { exclude module: 'animated-vector-drawable' exclude module: 'support-media-compat' } - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.7.3' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' implementation project(':dconnect-demo-lib') implementation project(':libstreaming') implementation('com.serenegiant:common:2.12.5') { diff --git a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/camera/Camera2RTSPPreviewServer.java b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/camera/Camera2RTSPPreviewServer.java index a860e5c714..9f4e89d79d 100644 --- a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/camera/Camera2RTSPPreviewServer.java +++ b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/camera/Camera2RTSPPreviewServer.java @@ -219,7 +219,7 @@ private Session startPreviewStreaming(final Socket clientSocket) throws IOExcept SessionBuilder builder = new SessionBuilder(); builder.setContext(mContext); builder.setVideoStream(mVideoStream); - mAac = new AACStream(); + mAac = new AACStream(mContext); if (isMuted()) { mAac.mute(); } else { diff --git a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/screen/ScreenCastRTSPPreviewServer.java b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/screen/ScreenCastRTSPPreviewServer.java index bff3e2351c..253e061b42 100644 --- a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/screen/ScreenCastRTSPPreviewServer.java +++ b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/screen/ScreenCastRTSPPreviewServer.java @@ -201,7 +201,7 @@ private Session startScreenCast(final Socket clientSocket) throws IOException { SessionBuilder builder = new SessionBuilder(); builder.setContext(mContext); builder.setVideoStream(mVideoStream); - mAac = new AACStream(); + mAac = new AACStream(mContext); if (isMuted()) { mAac.mute(); } else { diff --git a/dConnectDevicePlugin/dConnectDeviceHue/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceHue/app/build.gradle index 5fb219e21a..98fb484a10 100644 --- a/dConnectDevicePlugin/dConnectDeviceHue/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceHue/app/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 26 + compileSdkVersion 28 def getVersionName = { -> def version @@ -17,7 +17,7 @@ android { defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.hue" minSdkVersion 14 - targetSdkVersion 26 + targetSdkVersion 28 versionCode 1 versionName getVersionName() } @@ -58,6 +58,11 @@ android { dimension "common" } } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } repositories { @@ -69,6 +74,6 @@ repositories { dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.1' - compileOnly 'com.google.android.things:androidthings:+' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' + compileOnly 'com.google.android.things:androidthings:1.0' } diff --git a/dConnectDevicePlugin/dConnectDeviceIRKit/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceIRKit/app/build.gradle index b004a15d78..d81ae86cac 100644 --- a/dConnectDevicePlugin/dConnectDeviceIRKit/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceIRKit/app/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 def getVersionName = { -> def version @@ -17,7 +17,7 @@ android { defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.irkit" minSdkVersion 14 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName getVersionName() } @@ -48,6 +48,11 @@ android { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } repositories { @@ -59,5 +64,5 @@ repositories { dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.1' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' } diff --git a/dConnectDevicePlugin/dConnectDeviceIRKit/app/src/main/java/org/deviceconnect/android/deviceplugin/irkit/IRKitDeviceService.java b/dConnectDevicePlugin/dConnectDeviceIRKit/app/src/main/java/org/deviceconnect/android/deviceplugin/irkit/IRKitDeviceService.java index 4ba8b43b93..b995d0fccf 100755 --- a/dConnectDevicePlugin/dConnectDeviceIRKit/app/src/main/java/org/deviceconnect/android/deviceplugin/irkit/IRKitDeviceService.java +++ b/dConnectDevicePlugin/dConnectDeviceIRKit/app/src/main/java/org/deviceconnect/android/deviceplugin/irkit/IRKitDeviceService.java @@ -133,7 +133,7 @@ public void onCreate() { super.onCreate(); EventManager.INSTANCE.setController(new MemoryCacheController()); - mDBHelper = new IRKitDBHelper(getContext()); + mDBHelper = new IRKitDBHelper(this); for (VirtualDeviceData device : mDBHelper.getVirtualDevices(null)) { VirtualService vDevice = new VirtualService(device, mDBHelper, getServiceProvider()); diff --git a/dConnectDevicePlugin/dConnectDeviceIRKit/app/src/main/java/org/deviceconnect/android/deviceplugin/irkit/IRKitManager.java b/dConnectDevicePlugin/dConnectDeviceIRKit/app/src/main/java/org/deviceconnect/android/deviceplugin/irkit/IRKitManager.java index 39d829215d..c0fc436e19 100755 --- a/dConnectDevicePlugin/dConnectDeviceIRKit/app/src/main/java/org/deviceconnect/android/deviceplugin/irkit/IRKitManager.java +++ b/dConnectDevicePlugin/dConnectDeviceIRKit/app/src/main/java/org/deviceconnect/android/deviceplugin/irkit/IRKitManager.java @@ -12,7 +12,6 @@ import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.net.wifi.WifiManager.MulticastLock; -import android.support.v4.BuildConfig; import android.telephony.TelephonyManager; import android.util.Log; diff --git a/dConnectDevicePlugin/dConnectDeviceLinking/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceLinking/app/build.gradle index 46c0a32863..4dc76e02a1 100644 --- a/dConnectDevicePlugin/dConnectDeviceLinking/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceLinking/app/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 28 + compileSdkVersion 29 def getVersionName = { -> def version @@ -16,7 +16,7 @@ android { defaultConfig { minSdkVersion 21 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName getVersionName() testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -53,6 +53,11 @@ android { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } repositories { maven { url 'https://raw.githubusercontent.com/DeviceConnect/DeviceConnect-Android/master/dConnectSDK/dConnectSDKForAndroid/repository/' } @@ -64,7 +69,7 @@ repositories { dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.6.1' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' implementation 'com.android.support:design:28.0.0' androidTestImplementation 'com.android.support.test:testing-support-lib:0.1' androidTestImplementation 'org.hamcrest:hamcrest-library:1.3' diff --git a/dConnectDevicePlugin/dConnectDeviceLinking/plugin/build.gradle b/dConnectDevicePlugin/dConnectDeviceLinking/plugin/build.gradle index 3e5823dd71..54691be807 100644 --- a/dConnectDevicePlugin/dConnectDeviceLinking/plugin/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceLinking/plugin/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.linking" minSdkVersion 21 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName "1.0" @@ -19,6 +19,11 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } repositories { diff --git a/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/build.gradle b/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/build.gradle index 011e9d51a1..12da04b280 100644 --- a/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/build.gradle +++ b/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/build.gradle @@ -8,7 +8,7 @@ android { minSdkVersion 14 targetSdkVersion 29 versionCode 1 - versionName '2.7.3' + versionName '2.8.0' testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } diff --git a/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/java/org/deviceconnect/android/profile/spec/models/Paths.java b/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/java/org/deviceconnect/android/profile/spec/models/Paths.java index 7778b40142..327967583c 100644 --- a/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/java/org/deviceconnect/android/profile/spec/models/Paths.java +++ b/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/java/org/deviceconnect/android/profile/spec/models/Paths.java @@ -75,6 +75,9 @@ public Path removePath(String key) { * @return エンドポイントへの相対パスのリスト */ public Set getKeySet() { + if (mPaths == null) { + mPaths = new HashMap<>(); + } return mPaths.keySet(); } diff --git a/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/java/org/deviceconnect/android/provider/FileManager.java b/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/java/org/deviceconnect/android/provider/FileManager.java index 28ebb1e603..c5d98fd114 100755 --- a/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/java/org/deviceconnect/android/provider/FileManager.java +++ b/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/java/org/deviceconnect/android/provider/FileManager.java @@ -180,7 +180,7 @@ public File getBasePath() { mLocation = FileLocationParser.parse(getContext(), mFileProviderClassName); } if (mLocation.getType() == FileLocationParser.TYPE_EXTERNAL_PATH) { - return new File(Environment.getExternalStorageDirectory(), mLocation.getPath()); + return new File(getContext().getExternalFilesDir(null), mLocation.getPath()); } else { return new File(getContext().getFilesDir(), mLocation.getPath()); } diff --git a/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/java/org/deviceconnect/android/provider/FileProvider.java b/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/java/org/deviceconnect/android/provider/FileProvider.java index 5c2536caf7..2362dffa81 100755 --- a/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/java/org/deviceconnect/android/provider/FileProvider.java +++ b/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/java/org/deviceconnect/android/provider/FileProvider.java @@ -116,7 +116,7 @@ public File getBasePath() { mLocation = FileLocationParser.parse(context, this.getClass().getName()); } if (mLocation.getType() == FileLocationParser.TYPE_EXTERNAL_PATH) { - return new File(Environment.getExternalStorageDirectory(), mLocation.getPath()); + return new File(context.getExternalFilesDir(null), mLocation.getPath()); } else { return new File(context.getFilesDir(), mLocation.getPath()); } diff --git a/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/res/xml/pluginsdk.xml b/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/res/xml/pluginsdk.xml index 22896375b7..fb23a380e0 100644 --- a/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/res/xml/pluginsdk.xml +++ b/dConnectDevicePlugin/dConnectDevicePluginSDK/dconnect-device-plugin-sdk/src/main/res/xml/pluginsdk.xml @@ -1,4 +1,4 @@ - 2.7.2 + 2.8.0 diff --git a/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.aar b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.aar new file mode 100644 index 0000000000..8614d665f0 Binary files /dev/null and b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.aar differ diff --git a/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.aar.md5 b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.aar.md5 new file mode 100644 index 0000000000..292a11ea5c --- /dev/null +++ b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.aar.md5 @@ -0,0 +1 @@ +344ae51b3cc4f58b45ab21291f0402ef \ No newline at end of file diff --git a/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.aar.sha1 b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.aar.sha1 new file mode 100644 index 0000000000..1c7dd66ee5 --- /dev/null +++ b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.aar.sha1 @@ -0,0 +1 @@ +33122491e1d36cb6e71dcc9e8061c52845e3088c \ No newline at end of file diff --git a/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.pom b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.pom new file mode 100644 index 0000000000..90038fd83a --- /dev/null +++ b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.pom @@ -0,0 +1,29 @@ + + + 4.0.0 + org.deviceconnect + dconnect-device-plugin-sdk + 2.8.0 + aar + + + org.deviceconnect + dconnect-sdk-for-android + 2.3.1 + compile + + + com.android.support + support-v4 + 28.0.0 + compile + + + org.bouncycastle + bcprov-jdk15on + 1.46 + compile + + + diff --git a/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.pom.md5 b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.pom.md5 new file mode 100644 index 0000000000..7c27f11ca1 --- /dev/null +++ b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.pom.md5 @@ -0,0 +1 @@ +0154c40c11f7e0fce41467b86387cf42 \ No newline at end of file diff --git a/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.pom.sha1 b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.pom.sha1 new file mode 100644 index 0000000000..a282258697 --- /dev/null +++ b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/2.8.0/dconnect-device-plugin-sdk-2.8.0.pom.sha1 @@ -0,0 +1 @@ +7dca5649635d666a6fb87c9e4d83d31cd7033994 \ No newline at end of file diff --git a/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/maven-metadata.xml b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/maven-metadata.xml index a3d802aa98..87d49b1c0e 100644 --- a/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/maven-metadata.xml +++ b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/maven-metadata.xml @@ -3,7 +3,7 @@ org.deviceconnect dconnect-device-plugin-sdk - 2.7.3 + 2.8.0 1.0.0 1.0.1 @@ -27,7 +27,8 @@ 2.7.1 2.7.2 2.7.3 + 2.8.0 - 20190709074053 + 20191024010144 diff --git a/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/maven-metadata.xml.md5 b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/maven-metadata.xml.md5 index 5559836148..fe67e2dc5a 100644 --- a/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/maven-metadata.xml.md5 +++ b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/maven-metadata.xml.md5 @@ -1 +1 @@ -33693ca48d11078bd79e06ff3b4ca93a \ No newline at end of file +af8bbbda758a48ccf22b004ef3ca9210 \ No newline at end of file diff --git a/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/maven-metadata.xml.sha1 b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/maven-metadata.xml.sha1 index 1c21b3b612..da8cb02b10 100644 --- a/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/maven-metadata.xml.sha1 +++ b/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/org/deviceconnect/dconnect-device-plugin-sdk/maven-metadata.xml.sha1 @@ -1 +1 @@ -d4823e7f783f77faa439518524e4aa5eeab3ffb7 \ No newline at end of file +2ec70309923c4e1e95815b89b16a417c49493e9f \ No newline at end of file diff --git a/dConnectDevicePlugin/dConnectDeviceSphero/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceSphero/app/build.gradle index 06c638d2bd..48d29e1811 100644 --- a/dConnectDevicePlugin/dConnectDeviceSphero/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceSphero/app/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 def getVersionName = { -> def version @@ -16,7 +16,7 @@ android { defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.sphero" minSdkVersion 18 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName getVersionName() } @@ -55,6 +55,11 @@ android { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } repositories { @@ -66,5 +71,5 @@ repositories { dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.1' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' } diff --git a/dConnectDevicePlugin/dConnectDeviceSphero/app/src/main/java/org/deviceconnect/android/deviceplugin/sphero/SpheroDeviceService.java b/dConnectDevicePlugin/dConnectDeviceSphero/app/src/main/java/org/deviceconnect/android/deviceplugin/sphero/SpheroDeviceService.java index f9cadb51bd..044b543f46 100755 --- a/dConnectDevicePlugin/dConnectDeviceSphero/app/src/main/java/org/deviceconnect/android/deviceplugin/sphero/SpheroDeviceService.java +++ b/dConnectDevicePlugin/dConnectDeviceSphero/app/src/main/java/org/deviceconnect/android/deviceplugin/sphero/SpheroDeviceService.java @@ -195,7 +195,7 @@ private void disconnectingSpheroService(String id) { mHandler.post(new Runnable() { @Override public void run() { - Toast.makeText(getContext(), "Disconnect to " + service.getName(), + Toast.makeText(getApplicationContext(), "Disconnect to " + service.getName(), Toast.LENGTH_SHORT).show(); } }); @@ -229,7 +229,7 @@ public void run() { mHandler.post(new Runnable() { @Override public void run() { - Toast.makeText(getContext(), "Connect to " + info.getDevice().getRobot().getName(), + Toast.makeText(getApplicationContext(), "Connect to " + info.getDevice().getRobot().getName(), Toast.LENGTH_SHORT).show(); } }); diff --git a/dConnectDevicePlugin/dConnectDeviceTag/plugin/build.gradle b/dConnectDevicePlugin/dConnectDeviceTag/plugin/build.gradle index ccbaebcec2..b3ed203214 100644 --- a/dConnectDevicePlugin/dConnectDeviceTag/plugin/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceTag/plugin/build.gradle @@ -6,24 +6,25 @@ dependencies { exclude module: 'animated-vector-drawable' exclude module: 'support-media-compat' } - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.2' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' implementation 'com.google.zxing:core:3.3.2' } repositories { maven { url 'https://raw.githubusercontent.com/DeviceConnect/DeviceConnect-Android/master/dConnectSDK/dConnectSDKForAndroid/repository/' } maven { url 'https://raw.githubusercontent.com/DeviceConnect/DeviceConnect-Android/master/dConnectDevicePlugin/dConnectDevicePluginSDK/repository/' } + maven { url 'file://' + rootDir + '/../../dConnectSDK/dConnectSDKForAndroid/repository/' } + maven { url 'file://' + rootDir + '/../../dConnectDevicePlugin/dConnectDevicePluginSDK/repository/' } } android { - compileSdkVersion 28 - buildToolsVersion '28.0.3' + compileSdkVersion 29 defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.tag" minSdkVersion 19 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName '1.0.0' } diff --git a/dConnectDevicePlugin/dConnectDeviceTest/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceTest/app/build.gradle index c4ae9fe9a7..8b2e11b93e 100644 --- a/dConnectDevicePlugin/dConnectDeviceTest/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceTest/app/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 def getVersionName = { -> def version @@ -16,8 +16,8 @@ android { defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.test" - minSdkVersion 14 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 29 versionCode 1 versionName getVersionName() } @@ -49,6 +49,10 @@ android { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } } repositories { maven { url 'https://raw.githubusercontent.com/DeviceConnect/DeviceConnect-Android/master/dConnectSDK/dConnectSDKForAndroid/repository/' } @@ -59,6 +63,5 @@ repositories { dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.1' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' } diff --git a/dConnectDevicePlugin/dConnectDeviceTest/app/src/main/java/org/deviceconnect/android/deviceplugin/test/UnitTestDeviceService.java b/dConnectDevicePlugin/dConnectDeviceTest/app/src/main/java/org/deviceconnect/android/deviceplugin/test/UnitTestDeviceService.java index 60905805f6..df6530bd70 100755 --- a/dConnectDevicePlugin/dConnectDeviceTest/app/src/main/java/org/deviceconnect/android/deviceplugin/test/UnitTestDeviceService.java +++ b/dConnectDevicePlugin/dConnectDeviceTest/app/src/main/java/org/deviceconnect/android/deviceplugin/test/UnitTestDeviceService.java @@ -41,17 +41,15 @@ public class UnitTestDeviceService extends DConnectMessageService { @Override public void onCreate() { super.onCreate(); - setUseLocalOAuth(false); - mFileManager = new FileManager(this); // テスト用データ作成 createTestData(); getServiceProvider().addService(new UnitTestService(SERVICE_ID, - DEVICE_NAME, getPluginSpec())); + DEVICE_NAME)); getServiceProvider().addService(new UnitTestService(SERVICE_ID_SPECIAL_CHARACTERS, - DEVICE_NAME_SPECIAL_CHARACTERS, getPluginSpec())); + DEVICE_NAME_SPECIAL_CHARACTERS)); } @Override @@ -70,15 +68,6 @@ public int onStartCommand(final Intent intent, final int flags, final int startI return super.onStartCommand(intent, flags, startId); } - @Override - public void onRequest(final Intent request, final Intent response) { - boolean timeout = request.hasExtra("_timeout"); - if (timeout) { - return; - } - super.onRequest(request, response); - } - @Override protected SystemProfile getSystemProfile() { return new TestSystemProfile(); diff --git a/dConnectDevicePlugin/dConnectDeviceTest/app/src/main/java/org/deviceconnect/android/deviceplugin/test/service/UnitTestService.java b/dConnectDevicePlugin/dConnectDeviceTest/app/src/main/java/org/deviceconnect/android/deviceplugin/test/service/UnitTestService.java index 0abf5421eb..17a36c4c57 100644 --- a/dConnectDevicePlugin/dConnectDeviceTest/app/src/main/java/org/deviceconnect/android/deviceplugin/test/service/UnitTestService.java +++ b/dConnectDevicePlugin/dConnectDeviceTest/app/src/main/java/org/deviceconnect/android/deviceplugin/test/service/UnitTestService.java @@ -17,15 +17,7 @@ import org.deviceconnect.android.deviceplugin.test.profile.unique.TestJSONConversionProfile; import org.deviceconnect.android.deviceplugin.test.profile.unique.TestUniqueProfile; import org.deviceconnect.android.message.MessageUtils; -import org.deviceconnect.android.profile.AuthorizationProfile; import org.deviceconnect.android.profile.DConnectProfile; -import org.deviceconnect.android.profile.ServiceDiscoveryProfile; -import org.deviceconnect.android.profile.ServiceInformationProfile; -import org.deviceconnect.android.profile.SystemProfile; -import org.deviceconnect.android.profile.api.DConnectApi; -import org.deviceconnect.android.profile.spec.DConnectApiSpec; -import org.deviceconnect.android.profile.spec.DConnectPluginSpec; -import org.deviceconnect.android.profile.spec.DConnectProfileSpec; import org.deviceconnect.android.service.DConnectService; import org.deviceconnect.message.DConnectMessage; @@ -45,68 +37,11 @@ public class UnitTestService extends DConnectService { private Map mEventSenders = new HashMap(); - public UnitTestService(final String id, final String name, final DConnectPluginSpec pluginSpec) { + public UnitTestService(final String id, final String name) { super(id); setName(name); setOnline(true); - Map profileSpecs = pluginSpec.getProfileSpecs(); - for (Map.Entry entry : profileSpecs.entrySet()) { - final String profileName = entry.getKey(); - if (AuthorizationProfile.PROFILE_NAME.equalsIgnoreCase(profileName) - || ServiceDiscoveryProfile.PROFILE_NAME.equalsIgnoreCase(profileName) - || ServiceInformationProfile.PROFILE_NAME.equalsIgnoreCase(profileName) - || SystemProfile.PROFILE_NAME.equalsIgnoreCase(profileName)) { - continue; - } - - final DConnectProfileSpec profileSpec = entry.getValue(); - final DConnectProfile profile = new DConnectProfile() { - @Override - public String getProfileName() { - return profileName; - } - }; - for (final DConnectApiSpec apiSpec : profileSpec.getApiSpecList()) { - DConnectApi api = new DConnectApi() { - @Override - public Method getMethod() { - return apiSpec.getMethod(); - } - - @Override - public String getInterface() { - return apiSpec.getInterfaceName(); - } - - @Override - public String getAttribute() { - return apiSpec.getAttributeName(); - } - - @Override - public boolean onRequest(final Intent request, final Intent response) { - DConnectProfile.setResult(response, DConnectMessage.RESULT_OK); - if (apiSpec.getType() == Type.EVENT) { - switch (apiSpec.getMethod()) { - case PUT: - startEventBroadcast(request); - break; - case DELETE: - stopEventSender(request); - break; - default: - break; - } - } - return true; - } - }; - profile.addApi(api); - } - addProfile(profile); - } - addProfile(new TestSystemProfile()); addProfile(new TestUniqueProfile()); addProfile(new TestJSONConversionProfile()); diff --git a/dConnectDevicePlugin/dConnectDeviceTheta/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceTheta/app/build.gradle index 5d178930ed..e007d58a8a 100644 --- a/dConnectDevicePlugin/dConnectDeviceTheta/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceTheta/app/build.gradle @@ -69,8 +69,8 @@ repositories { dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.1' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' implementation 'com.squareup.okhttp3:okhttp:3.10.0' - implementation 'com.android.support:support-v4:26.1.0' + implementation 'com.android.support:support-v4:28.0.0' implementation 'com.burgstaller:okhttp-digest:1.16' } diff --git a/dConnectDevicePlugin/dConnectDeviceTheta/app/src/main/java/org/deviceconnect/android/deviceplugin/theta/data/ThetaObjectStorage.java b/dConnectDevicePlugin/dConnectDeviceTheta/app/src/main/java/org/deviceconnect/android/deviceplugin/theta/data/ThetaObjectStorage.java index 6515ffa086..e6db9781b5 100644 --- a/dConnectDevicePlugin/dConnectDeviceTheta/app/src/main/java/org/deviceconnect/android/deviceplugin/theta/data/ThetaObjectStorage.java +++ b/dConnectDevicePlugin/dConnectDeviceTheta/app/src/main/java/org/deviceconnect/android/deviceplugin/theta/data/ThetaObjectStorage.java @@ -310,7 +310,7 @@ private ContentValues makeContentValue(final ThetaObject object) { private String saveThetaImage(final String cacheFoldar, final String originalFileName, final byte[] thetaImage) { - String root = Environment.getExternalStorageDirectory().getPath() + "/" + String root = mContext.getExternalFilesDir(null) + "/" + mContext.getPackageName() + "/" + cacheFoldar + "/"; File dir = new File(root); if (!dir.exists()) { diff --git a/dConnectDevicePlugin/dConnectDeviceTheta/app/src/main/java/org/deviceconnect/android/deviceplugin/theta/fragment/ThetaVRModeFragment.java b/dConnectDevicePlugin/dConnectDeviceTheta/app/src/main/java/org/deviceconnect/android/deviceplugin/theta/fragment/ThetaVRModeFragment.java index 21601b6325..d9daa8569e 100644 --- a/dConnectDevicePlugin/dConnectDeviceTheta/app/src/main/java/org/deviceconnect/android/deviceplugin/theta/fragment/ThetaVRModeFragment.java +++ b/dConnectDevicePlugin/dConnectDeviceTheta/app/src/main/java/org/deviceconnect/android/deviceplugin/theta/fragment/ThetaVRModeFragment.java @@ -378,7 +378,7 @@ public void run() { }); return; } - String root = Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera/"; + String root = getContext().getExternalFilesDir(null).getPath() + "/Camera/"; File dir = new File(root); if (!dir.exists()) { dir.mkdir(); diff --git a/dConnectDevicePlugin/dConnectDeviceUVC/app/build.gradle b/dConnectDevicePlugin/dConnectDeviceUVC/app/build.gradle index 7de5398c41..c90f89d8d6 100644 --- a/dConnectDevicePlugin/dConnectDeviceUVC/app/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceUVC/app/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 def getVersionName = { -> def version @@ -17,7 +17,7 @@ android { defaultConfig { applicationId "org.deviceconnect.android.deviceplugin.uvc" minSdkVersion 15 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName getVersionName() } @@ -49,6 +49,10 @@ android { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } } repositories { @@ -60,7 +64,7 @@ repositories { dependencies { implementation fileTree(include: '*.jar', dir: 'libs') - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.5.1' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' implementation project(':libuvccamera') implementation project(':libstreaming') } diff --git a/dConnectDevicePlugin/dConnectDeviceUVC/libuvccamera/build.gradle b/dConnectDevicePlugin/dConnectDeviceUVC/libuvccamera/build.gradle index 0901ea02ea..e7b7f9a55c 100644 --- a/dConnectDevicePlugin/dConnectDeviceUVC/libuvccamera/build.gradle +++ b/dConnectDevicePlugin/dConnectDeviceUVC/libuvccamera/build.gradle @@ -2,11 +2,11 @@ apply plugin: 'com.android.library' import org.apache.tools.ant.taskdefs.condition.Os android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { minSdkVersion 14 - targetSdkVersion 28 + targetSdkVersion 29 } buildTypes { @@ -21,7 +21,6 @@ android { jni.srcDirs = [] } } - } dependencies { diff --git a/dConnectManager/dConnectManager/dconnect-manager-app-things/build.gradle b/dConnectManager/dConnectManager/dconnect-manager-app-things/build.gradle index 93a8ecadae..d75fcad844 100644 --- a/dConnectManager/dConnectManager/dconnect-manager-app-things/build.gradle +++ b/dConnectManager/dConnectManager/dconnect-manager-app-things/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { applicationId "org.deviceconnect.android.manager" minSdkVersion 24 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" diff --git a/dConnectManager/dConnectManager/dconnect-manager-app/build.gradle b/dConnectManager/dConnectManager/dconnect-manager-app/build.gradle index 798af52564..20fbbae0f5 100644 --- a/dConnectManager/dConnectManager/dconnect-manager-app/build.gradle +++ b/dConnectManager/dConnectManager/dconnect-manager-app/build.gradle @@ -17,7 +17,7 @@ android { defaultConfig { applicationId "org.deviceconnect.android.manager" minSdkVersion 21 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName getVersionName() testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -85,7 +85,7 @@ dependencies { implementation 'com.android.support:design:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'com.android.support:support-annotations:28.0.0' - implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.7.3' + implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.0' implementation project(':dconnect-manager-core') implementation project(':dconnect-server-nano-httpd') implementation project(':dconnect-device-plugin-host') diff --git a/dConnectManager/dConnectManager/dconnect-manager-app/src/androidTest/java/org/deviceconnect/android/manager/test/JSONConversionTest.java b/dConnectManager/dConnectManager/dconnect-manager-app/src/androidTest/java/org/deviceconnect/android/manager/test/JSONConversionTest.java index 944157568d..f63da3222e 100644 --- a/dConnectManager/dConnectManager/dconnect-manager-app/src/androidTest/java/org/deviceconnect/android/manager/test/JSONConversionTest.java +++ b/dConnectManager/dConnectManager/dconnect-manager-app/src/androidTest/java/org/deviceconnect/android/manager/test/JSONConversionTest.java @@ -9,8 +9,6 @@ import android.os.Bundle; import android.support.test.runner.AndroidJUnit4; -import junit.framework.Assert; - import org.deviceconnect.android.profile.restful.test.RESTfulDConnectTestCase; import org.deviceconnect.message.DConnectMessage; import org.deviceconnect.message.DConnectResponseMessage; @@ -20,8 +18,11 @@ import org.junit.Test; import org.junit.runner.RunWith; +import static junit.framework.TestCase.assertFalse; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; @@ -54,53 +55,52 @@ public void testConversion() throws JSONException { DConnectResponseMessage response = mDConnectSDK.get(builder.toString()); assertThat(response, is(notNullValue())); - DConnectMessage root = response.getMessage("extra"); - Assert.assertNotNull("root is null.", root); - Assert.assertFalse(root.containsKey(IntentDConnectMessage.EXTRA_REQUEST_CODE)); - Assert.assertEquals("http://localhost:8080", root.getString("uri")); - Assert.assertEquals(0, root.getInt("byte")); - Assert.assertEquals('0', root.getInt("char")); - Assert.assertEquals(0, root.getInt("int")); - Assert.assertEquals(0L, root.getLong("long")); - Assert.assertEquals(0.0, root.getDouble("float"), TEST_FLOATING_VALUE); - Assert.assertEquals(0.0, root.getDouble("double"), TEST_FLOATING_VALUE); - Assert.assertEquals(false, root.getBoolean("boolean")); - Assert.assertEquals(0, root.getInt(Byte.class.getName())); - Assert.assertEquals('0', root.getInt(Character.class.getName())); - Assert.assertEquals(0, root.getInt(Integer.class.getName())); - Assert.assertEquals(0L, root.getLong(Long.class.getName())); - Assert.assertEquals(0.0, root.getDouble(Float.class.getName()), TEST_FLOATING_VALUE); - Assert.assertEquals(0.0, root.getDouble(Double.class.getName()), TEST_FLOATING_VALUE); - Assert.assertEquals(false, root.getBoolean(Boolean.class.getName())); - Assert.assertEquals(String.class.getName(), root.getString(String.class.getName())); - Assert.assertEquals(1, root.getList(int[].class.getName()).size()); - Assert.assertEquals(0, root.getList(int[].class.getName()).get(0)); - Assert.assertEquals(1, root.getList(long[].class.getName()).size()); - Assert.assertEquals(0, root.getList(long[].class.getName()).get(0)); - Assert.assertEquals(1, root.getList(float[].class.getName()).size()); - Assert.assertEquals(0.0f, ((Integer)root.getList(float[].class.getName()).get(0)).floatValue(), TEST_FLOATING_VALUE); - Assert.assertEquals(1, root.getList(double[].class.getName()).size()); - Assert.assertEquals(0.0d, ((Integer)root.getList(double[].class.getName()).get(0)).doubleValue(), TEST_FLOATING_VALUE); - Assert.assertEquals(1, root.getList(boolean[].class.getName()).size()); - Assert.assertEquals(false, root.getList(boolean[].class.getName()).get(0)); - Assert.assertEquals(1, root.getList(Integer[].class.getName()).size()); - Assert.assertEquals(0, root.getList(Integer[].class.getName()).get(0)); - Assert.assertEquals(1, root.getList(Long[].class.getName()).size()); - Assert.assertEquals(0, root.getList(Long[].class.getName()).get(0)); - Assert.assertEquals(1, root.getList(Float[].class.getName()).size()); - Assert.assertEquals(0.0f, ((Integer) root.getList(Float[].class.getName()).get(0)).floatValue(), TEST_FLOATING_VALUE); - Assert.assertEquals(1, root.getList(Double[].class.getName()).size()); - Assert.assertEquals(0.0d, ((Integer)root.getList(Double[].class.getName()).get(0)).doubleValue(), TEST_FLOATING_VALUE); - Assert.assertEquals(1, root.getList(Boolean[].class.getName()).size()); - Assert.assertEquals(false, root.getList(Boolean[].class.getName()).get(0)); - Assert.assertEquals(1, root.getList(String[].class.getName()).size()); - Assert.assertEquals("String", root.getList(String[].class.getName()).get(0)); - Assert.assertNotNull(root.getMessage(Bundle.class.getName())); - Assert.assertEquals(1, root.getList(Bundle[].class.getName()).size()); - Assert.assertNotNull(root.getList(Bundle[].class.getName()).get(0)); - Assert.assertEquals(1, root.getList("ArrayList").size()); - Assert.assertEquals(0, root.getList("ArrayList").get(0)); + assertNotNull("root is null.", root); + assertFalse(root.containsKey(IntentDConnectMessage.EXTRA_REQUEST_CODE)); + assertEquals("http://localhost:8080", root.getString("uri")); + assertEquals(0, root.getInt("byte")); + assertEquals('0', root.getInt("char")); + assertEquals(0, root.getInt("int")); + assertEquals(0L, root.getLong("long")); + assertEquals(0.0, root.getDouble("float"), TEST_FLOATING_VALUE); + assertEquals(0.0, root.getDouble("double"), TEST_FLOATING_VALUE); + assertEquals(false, root.getBoolean("boolean")); + assertEquals(0, root.getInt(Byte.class.getName())); + assertEquals('0', root.getInt(Character.class.getName())); + assertEquals(0, root.getInt(Integer.class.getName())); + assertEquals(0L, root.getLong(Long.class.getName())); + assertEquals(0.0, root.getDouble(Float.class.getName()), TEST_FLOATING_VALUE); + assertEquals(0.0, root.getDouble(Double.class.getName()), TEST_FLOATING_VALUE); + assertEquals(false, root.getBoolean(Boolean.class.getName())); + assertEquals(String.class.getName(), root.getString(String.class.getName())); + assertEquals(1, root.getList(int[].class.getName()).size()); + assertEquals(0, root.getList(int[].class.getName()).get(0)); + assertEquals(1, root.getList(long[].class.getName()).size()); + assertEquals(0, root.getList(long[].class.getName()).get(0)); + assertEquals(1, root.getList(float[].class.getName()).size()); + assertEquals(0.0f, ((Integer)root.getList(float[].class.getName()).get(0)).floatValue(), TEST_FLOATING_VALUE); + assertEquals(1, root.getList(double[].class.getName()).size()); + assertEquals(0.0d, ((Integer)root.getList(double[].class.getName()).get(0)).doubleValue(), TEST_FLOATING_VALUE); + assertEquals(1, root.getList(boolean[].class.getName()).size()); + assertEquals(false, root.getList(boolean[].class.getName()).get(0)); + assertEquals(1, root.getList(Integer[].class.getName()).size()); + assertEquals(0, root.getList(Integer[].class.getName()).get(0)); + assertEquals(1, root.getList(Long[].class.getName()).size()); + assertEquals(0, root.getList(Long[].class.getName()).get(0)); + assertEquals(1, root.getList(Float[].class.getName()).size()); + assertEquals(0.0f, ((Integer) root.getList(Float[].class.getName()).get(0)).floatValue(), TEST_FLOATING_VALUE); + assertEquals(1, root.getList(Double[].class.getName()).size()); + assertEquals(0.0d, ((Integer)root.getList(Double[].class.getName()).get(0)).doubleValue(), TEST_FLOATING_VALUE); + assertEquals(1, root.getList(Boolean[].class.getName()).size()); + assertEquals(false, root.getList(Boolean[].class.getName()).get(0)); + assertEquals(1, root.getList(String[].class.getName()).size()); + assertEquals("String", root.getList(String[].class.getName()).get(0)); + assertNotNull(root.getMessage(Bundle.class.getName())); + assertEquals(1, root.getList(Bundle[].class.getName()).size()); + assertNotNull(root.getList(Bundle[].class.getName()).get(0)); + assertEquals(1, root.getList("ArrayList").size()); + assertEquals(0, root.getList("ArrayList").get(0)); } } diff --git a/dConnectManager/dConnectManager/dconnect-manager-app/src/androidTest/java/org/deviceconnect/android/profile/restful/test/NormalEventProfileTestCase.java b/dConnectManager/dConnectManager/dconnect-manager-app/src/androidTest/java/org/deviceconnect/android/profile/restful/test/NormalEventProfileTestCase.java index 47a7cb77ab..cb5674d1cf 100644 --- a/dConnectManager/dConnectManager/dconnect-manager-app/src/androidTest/java/org/deviceconnect/android/profile/restful/test/NormalEventProfileTestCase.java +++ b/dConnectManager/dConnectManager/dconnect-manager-app/src/androidTest/java/org/deviceconnect/android/profile/restful/test/NormalEventProfileTestCase.java @@ -47,7 +47,7 @@ public class NormalEventProfileTestCase extends RESTfulDConnectTestCase { */ @Test public void testEvent() throws Exception { - String uri = "http://localhost:4035/gotapi/deviceOrientation/onDeviceOrientation"; + String uri = "http://localhost:4035/gotapi/unique/event"; uri += "?serviceId=" + URLEncoder.encode(getServiceId(), "UTF-8"); uri += "&accessToken=" + URLEncoder.encode(getAccessToken(), "UTF-8"); @@ -100,8 +100,8 @@ public void onResponse(DConnectResponseMessage response) { DConnectEventMessage e = event.get(); assertThat(e, is(notNullValue())); assertThat(e.getString("serviceId"), is(getServiceId())); - assertThat(e.getString("profile"), is(equalToIgnoringCase("deviceOrientation"))); - assertThat(e.getString("attribute"), is(equalToIgnoringCase("onDeviceOrientation"))); + assertThat(e.getString("profile"), is(equalToIgnoringCase("unique"))); + assertThat(e.getString("attribute"), is(equalToIgnoringCase("event"))); } finally { mDConnectSDK.removeEventListener(uri); mDConnectSDK.disconnectWebSocket(); diff --git a/dConnectManager/dConnectManager/dconnect-manager-app/src/main/java/org/deviceconnect/android/manager/setting/SettingsFragment.java b/dConnectManager/dConnectManager/dconnect-manager-app/src/main/java/org/deviceconnect/android/manager/setting/SettingsFragment.java index f655b38c64..22f5d9eac9 100755 --- a/dConnectManager/dConnectManager/dconnect-manager-app/src/main/java/org/deviceconnect/android/manager/setting/SettingsFragment.java +++ b/dConnectManager/dConnectManager/dconnect-manager-app/src/main/java/org/deviceconnect/android/manager/setting/SettingsFragment.java @@ -174,7 +174,7 @@ public void onCreate(final Bundle savedInstanceState) { // ドキュメントルート String docRootPath = sp.getString(getString(R.string.key_settings_web_server_document_root_path), null); if (docRootPath == null || docRootPath.length() <= 0) { - File file = new File(Environment.getExternalStorageDirectory(), getActivity().getPackageName()); + File file = new File(getActivity().getExternalFilesDir(null), getActivity().getPackageName()); docRootPath = file.getPath(); } diff --git a/dConnectManager/dConnectManager/dconnect-manager-core/build.gradle b/dConnectManager/dConnectManager/dconnect-manager-core/build.gradle index dbeca740d6..535e0c6aed 100644 --- a/dConnectManager/dConnectManager/dconnect-manager-core/build.gradle +++ b/dConnectManager/dConnectManager/dconnect-manager-core/build.gradle @@ -1,10 +1,10 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { minSdkVersion 14 - targetSdkVersion 28 + targetSdkVersion 29 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } diff --git a/dConnectManager/dConnectManager/dconnect-manager-core/src/main/java/org/deviceconnect/android/manager/core/DConnectSettings.java b/dConnectManager/dConnectManager/dconnect-manager-core/src/main/java/org/deviceconnect/android/manager/core/DConnectSettings.java index ce40328a5b..e7142c2fb5 100755 --- a/dConnectManager/dConnectManager/dconnect-manager-core/src/main/java/org/deviceconnect/android/manager/core/DConnectSettings.java +++ b/dConnectManager/dConnectManager/dconnect-manager-core/src/main/java/org/deviceconnect/android/manager/core/DConnectSettings.java @@ -214,7 +214,7 @@ public void setHost(final String host) { * @return ドキュメントルートパス */ public String getDocumentRootPath() { - File file = new File(Environment.getExternalStorageDirectory(), mContext.getPackageName()); + File file = new File(mContext.getExternalFilesDir(null), mContext.getPackageName()); if (!file.exists()) { if (!file.mkdirs()) { throw new RuntimeException("Cannot make a folder. path=" + file.getPath()); diff --git a/dConnectSDK/dConnectDemoLib/dconnect-demo-lib/build.gradle b/dConnectSDK/dConnectDemoLib/dconnect-demo-lib/build.gradle index 21abda4d38..e5cb08d9b1 100644 --- a/dConnectSDK/dConnectDemoLib/dconnect-demo-lib/build.gradle +++ b/dConnectSDK/dConnectDemoLib/dconnect-demo-lib/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { minSdkVersion 14 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName "0.9.0" diff --git a/dConnectSDK/dConnectDemoLib/dconnect-demo-lib/src/main/java/org/deviceconnect/android/deviceplugin/demo/DemoInstaller.java b/dConnectSDK/dConnectDemoLib/dconnect-demo-lib/src/main/java/org/deviceconnect/android/deviceplugin/demo/DemoInstaller.java index 0eb92e3592..6574509775 100644 --- a/dConnectSDK/dConnectDemoLib/dconnect-demo-lib/src/main/java/org/deviceconnect/android/deviceplugin/demo/DemoInstaller.java +++ b/dConnectSDK/dConnectDemoLib/dconnect-demo-lib/src/main/java/org/deviceconnect/android/deviceplugin/demo/DemoInstaller.java @@ -194,12 +194,12 @@ public File getDemoDirOnStorage() { } private File getDemoRootDir() { - File documentDir = getDocumentDir(); + File documentDir = getDocumentDir(mContext); return new File(documentDir, mPluginPackageName); } - private static File getDocumentDir() { - File rootDir = Environment.getExternalStorageDirectory(); + private static File getDocumentDir(final Context context) { + File rootDir = context.getExternalFilesDir(null); return new File(rootDir, DOCUMENT_DIR_NAME); } diff --git a/dConnectSDK/dConnectLibStreaming/libstreaming/build.gradle b/dConnectSDK/dConnectLibStreaming/libstreaming/build.gradle index 78dc860e80..9c0829ee2f 100644 --- a/dConnectSDK/dConnectLibStreaming/libstreaming/build.gradle +++ b/dConnectSDK/dConnectLibStreaming/libstreaming/build.gradle @@ -1,12 +1,11 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 28 - buildToolsVersion '28.0.3' + compileSdkVersion 29 defaultConfig { minSdkVersion 14 - targetSdkVersion 28 + targetSdkVersion 29 ndk { // Specifies the ABI configurations of your native @@ -42,4 +41,9 @@ android { path 'CMakeLists.txt' } } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } diff --git a/dConnectSDK/dConnectLibStreaming/libstreaming/src/main/java/net/majorkernelpanic/streaming/audio/AACStream.java b/dConnectSDK/dConnectLibStreaming/libstreaming/src/main/java/net/majorkernelpanic/streaming/audio/AACStream.java index dbe329e860..8aca2f94a4 100644 --- a/dConnectSDK/dConnectLibStreaming/libstreaming/src/main/java/net/majorkernelpanic/streaming/audio/AACStream.java +++ b/dConnectSDK/dConnectLibStreaming/libstreaming/src/main/java/net/majorkernelpanic/streaming/audio/AACStream.java @@ -32,6 +32,7 @@ import net.majorkernelpanic.streaming.rtp.AACLATMPacketizer; import net.majorkernelpanic.streaming.rtp.MediaCodecInputStream; import android.annotation.SuppressLint; +import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.media.AudioFormat; @@ -91,9 +92,10 @@ public class AACStream extends AudioStream { private AudioRecord mAudioRecord = null; private Thread mThread = null; private boolean muted = true; //default true - public AACStream() { + private Context mContext; + public AACStream(final Context context) { super(); - + mContext = context; if (!AACStreamingSupported()) { Log.e(TAG,"AAC not supported on this phone"); throw new RuntimeException("AAC not supported by this phone !"); @@ -313,7 +315,7 @@ private void testADTS() throws IllegalStateException, IOException { } } - final String TESTFILE = Environment.getExternalStorageDirectory().getPath()+"/spydroid-test.adts"; + final String TESTFILE = mContext.getExternalFilesDir(null).getPath()+"/spydroid-test.adts"; if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { throw new IllegalStateException("No external storage or external storage not ready !"); diff --git a/readme.en.md b/readme.en.md index e1705120f7..774d269509 100755 --- a/readme.en.md +++ b/readme.en.md @@ -33,10 +33,10 @@ Download DeviceConnect-Android source code. $ git clone https://github.com/DeviceConnect/DeviceConnect-Android.git ``` -Before building, make sure the path to AndroidSDK is set to the ANDROID_HOME environment variable. +Before building, make sure the path to AndroidSDK is set to the ANDROID_SDK_ROOT environment variable. ``` -$ echo 'export ANDROID_HOME=' >> ~/.bash_profile +$ echo 'export ANDROID_SDK_ROOT=' >> ~/.bash_profile ``` For <path>, please specify the path to Android SDK. @@ -51,7 +51,7 @@ $ ./gradlew assembleDebug Install Device Connect Manager. ``` -$ adb install app/build/outputs/apk/app-debug.apk +$ adb install dconnect-manager-app/build/outputs/apk/debug/dconnect-manager-app-debug.apk ```