Skip to content

Commit 665208c

Browse files
committed
Cleanup
1 parent b117069 commit 665208c

File tree

3 files changed

+5
-25
lines changed

3 files changed

+5
-25
lines changed

.github/workflows/builtAndTest.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ jobs:
6666
api-level: ${{ matrix.api-level }}
6767
arch: x86_64
6868
script: ./gradlew -is connectedCheck
69-
# Uncomment to enable logs
70-
# script: |
71-
# adb logcat -c
72-
# adb logcat &
73-
# gradle -is connectedCheck
69+
# Uncomment to enable logs
70+
# script: |
71+
# adb logcat -c
72+
# adb logcat &
73+
# gradle -is connectedCheck
7474

7575
build-server:
7676
runs-on: ubuntu-latest

app/src/androidTest/java/com/pcapplusplus/toyvpn/ToyVpnServiceManagerTest.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import android.content.BroadcastReceiver
44
import android.content.Context
55
import android.content.Intent
66
import android.content.IntentFilter
7-
import android.util.Log
87
import androidx.activity.result.ActivityResultLauncher
98
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
109
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -134,19 +133,12 @@ class ToyVpnServiceManagerTest {
134133
putExtra("clientAddress", "10.0.0.1")
135134
}
136135

137-
Log.e("TestReceiveVpnStartedAndStoppedEvent", "Before sending first broadcast")
138136
context.sendBroadcast(intent)
139-
Log.e("TestReceiveVpnStartedAndStoppedEvent", "After sending first broadcast")
140137
waitFor { serviceManager.vpnServiceState.value == VpnConnectionState.CONNECTED }
141-
Log.e("TestReceiveVpnStartedAndStoppedEvent", "Passed first waitFor")
142138
waitFor { serviceManager.clientAddress.value == "10.0.0.1" }
143-
Log.e("TestReceiveVpnStartedAndStoppedEvent", "Passed second waitFor")
144139

145-
Log.e("TestReceiveVpnStartedAndStoppedEvent", "Before sending second broadcast")
146140
context.sendBroadcast(Intent(BroadcastActions.VPN_SERVICE_STOPPED))
147-
Log.e("TestReceiveVpnStartedAndStoppedEvent", "After sending second broadcast")
148141
waitFor { serviceManager.vpnServiceState.value == VpnConnectionState.DISCONNECTED }
149-
Log.e("TestReceiveVpnStartedAndStoppedEvent", "Passed third waitFor")
150142
}
151143

152144
@Test

app/src/main/java/com/pcapplusplus/toyvpn/ToyVpnServiceManager.kt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import android.content.Intent
77
import android.content.IntentFilter
88
import android.net.VpnService
99
import android.os.Build
10-
import android.util.Log
1110
import androidx.activity.result.ActivityResultLauncher
1211
import com.pcapplusplus.toyvpn.model.BroadcastActions
1312
import com.pcapplusplus.toyvpn.model.PacketData
@@ -57,24 +56,13 @@ class ToyVpnServiceManager(
5756
) {
5857
when (intent?.action) {
5958
BroadcastActions.VPN_SERVICE_STARTED -> {
60-
Log.e("TestReceiveVpnStartedAndStoppedEvent", "Got VPN_SERVICE_STARTED event")
6159
_vpnServiceState.value = VpnConnectionState.CONNECTED
6260
_clientAddress.value = intent.getStringExtra("clientAddress")
63-
Log.e("TestReceiveVpnStartedAndStoppedEvent", "VPN_SERVICE_STARTED: _clientAddress.value = ${_clientAddress.value}")
64-
Log.e(
65-
"TestReceiveVpnStartedAndStoppedEvent",
66-
"VPN_SERVICE_STARTED: _vpnServiceState.value = ${_vpnServiceState.value}",
67-
)
6861
}
6962

7063
BroadcastActions.VPN_SERVICE_STOPPED -> {
71-
Log.e("TestReceiveVpnStartedAndStoppedEvent", "Got VPN_SERVICE_STOPPED event")
7264
_vpnServiceState.value = VpnConnectionState.DISCONNECTED
7365
_clientAddress.value = null
74-
Log.e(
75-
"TestReceiveVpnStartedAndStoppedEvent",
76-
"VPN_SERVICE_STOPPED: _vpnServiceState.value = ${_vpnServiceState.value}",
77-
)
7866
}
7967

8068
BroadcastActions.VPN_SERVICE_PACKET_ARRIVED -> {

0 commit comments

Comments
 (0)