Skip to content

Commit ad841f2

Browse files
committed
Fix some more Kotlin warnings
1 parent ea4ac06 commit ad841f2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

app/src/main/java/tech/httptoolkit/android/HttpToolkitApplication.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class HttpToolkitApplication : Application() {
124124
// Get & return the actual referrer and return it
125125
Log.i(TAG, "Getting first run referrer...")
126126
return suspendCoroutine { cont ->
127-
var wasResumed = AtomicBoolean()
127+
val wasResumed = AtomicBoolean()
128128
val resume = { value: String? ->
129129
if (wasResumed.getAndSet(true)) {
130130
cont.resume(value)

app/src/main/java/tech/httptoolkit/android/ProxyVpnService.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class ProxyVpnService : VpnService(), IProtectSocket {
9898

9999
override fun onRevoke() {
100100
super.onRevoke()
101-
app!!.trackEvent("VPN", "vpn-revoked")
101+
app.trackEvent("VPN", "vpn-revoked")
102102
Log.i(TAG, "onRevoke called")
103103
stopVpn()
104104
}
@@ -151,8 +151,8 @@ class ProxyVpnService : VpnService(), IProtectSocket {
151151

152152
if (this.vpnInterface != null) return false // The VPN is already running, somehow? Do nothing
153153

154-
app!!.pauseEvents() // Try not to send events while the VPN is active, it's unnecessary noise
155-
app!!.trackEvent("VPN", "vpn-started")
154+
app.pauseEvents() // Try not to send events while the VPN is active, it's unnecessary noise
155+
app.trackEvent("VPN", "vpn-started")
156156
val vpnInterface = Builder()
157157
.addAddress(VPN_IP_ADDRESS, 32)
158158
.addRoute(ALL_ROUTES, 0)
@@ -225,8 +225,8 @@ class ProxyVpnService : VpnService(), IProtectSocket {
225225
Log.i(TAG, "VPN stopping..")
226226

227227
if (vpnRunnable != null) {
228-
app!!.trackEvent("VPN", "vpn-stopped")
229-
app!!.resumeEvents()
228+
app.trackEvent("VPN", "vpn-stopped")
229+
app.resumeEvents()
230230

231231
vpnRunnable!!.stop()
232232
vpnRunnable = null

0 commit comments

Comments
 (0)