Decrease intentFilter

This commit is contained in:
Mygod
2018-05-09 16:00:56 -07:00
parent a5fa9d8801
commit 99d6090ee4
4 changed files with 6 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
package be.mygod.vpnhotspot
import android.content.Intent
import android.content.IntentFilter
import android.net.wifi.WifiManager
import android.os.Binder
import android.support.annotation.RequiresApi
@@ -10,7 +11,6 @@ import be.mygod.vpnhotspot.net.IpNeighbourMonitor
import be.mygod.vpnhotspot.net.TetheringManager
import be.mygod.vpnhotspot.util.broadcastReceiver
import be.mygod.vpnhotspot.util.debugLog
import be.mygod.vpnhotspot.util.intentFilter
@RequiresApi(26)
class LocalOnlyHotspotService : IpNeighbourMonitoringService() {
@@ -65,7 +65,7 @@ class LocalOnlyHotspotService : IpNeighbourMonitoringService() {
if (reservation == null) onFailed(-2) else {
this@LocalOnlyHotspotService.reservation = reservation
if (!receiverRegistered) {
registerReceiver(receiver, intentFilter(TetheringManager.ACTION_TETHER_STATE_CHANGED))
registerReceiver(receiver, IntentFilter(TetheringManager.ACTION_TETHER_STATE_CHANGED))
receiverRegistered = true
}
}