From f602c39e36e4312414454c4d73317b87aa631782 Mon Sep 17 00:00:00 2001 From: gaozl Date: Tue, 2 Jun 2026 15:27:17 +0800 Subject: [PATCH] fix: ci --- .idea/compiler.xml | 2 +- .idea/gradle.xml | 7 ++----- .idea/migrations.xml | 10 ++++++++++ .idea/misc.xml | 2 +- .../main/java/qianmu/container/mqtt/MQTTService.java | 4 ++++ playerview/build.gradle | 10 +++++----- .../java/com/dl7/player/ExampleInstrumentedTest.java | 6 +++--- 7 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 .idea/migrations.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 245a82c..7d7ec2e 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 5e80d59..4f8dd3a 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,10 +4,8 @@ diff --git a/.idea/migrations.xml b/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 3378229..a740c72 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,7 +5,7 @@ - + diff --git a/app/src/main/java/qianmu/container/mqtt/MQTTService.java b/app/src/main/java/qianmu/container/mqtt/MQTTService.java index 8d74a27..b7b535c 100644 --- a/app/src/main/java/qianmu/container/mqtt/MQTTService.java +++ b/app/src/main/java/qianmu/container/mqtt/MQTTService.java @@ -268,6 +268,10 @@ public class MQTTService extends Service { public void onSuccess(IMqttToken arg0) { LoggerUtil.e(TAG, "连接成功 "); isConnected = true; + try { + // 先取消旧订阅(防止重复累积) + client.unsubscribe(myTopic); + } catch (MqttException e) { /* ignore */ } try { // 订阅myTopic话题 client.subscribe(myTopic,2); diff --git a/playerview/build.gradle b/playerview/build.gradle index 49b7829..9af18d7 100644 --- a/playerview/build.gradle +++ b/playerview/build.gradle @@ -12,7 +12,7 @@ android { versionCode 4 versionName "1.0.3" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -26,13 +26,13 @@ android { dependencies { api fileTree(dir: 'libs', include: ['*.jar']) - androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test:runner:1.5.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' implementation 'com.android.support:appcompat-v7:24.2.1' implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' - // ijkplayer api 'tv.danmaku.ijk.media:ijkplayer-java:0.7.8.1' api 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.7.8.1' diff --git a/playerview/src/androidTest/java/com/dl7/player/ExampleInstrumentedTest.java b/playerview/src/androidTest/java/com/dl7/player/ExampleInstrumentedTest.java index 8696517..c3eb106 100644 --- a/playerview/src/androidTest/java/com/dl7/player/ExampleInstrumentedTest.java +++ b/playerview/src/androidTest/java/com/dl7/player/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.dl7.player; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -19,7 +19,7 @@ public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.dl7.playerview.test", appContext.getPackageName()); }