Improve error logs on Android Q beta
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
package be.mygod.vpnhotspot.net
|
||||
|
||||
import android.system.ErrnoException
|
||||
import android.system.OsConstants
|
||||
import androidx.core.os.BuildCompat
|
||||
import be.mygod.vpnhotspot.room.macToLong
|
||||
import be.mygod.vpnhotspot.util.parseNumericAddress
|
||||
import timber.log.Timber
|
||||
import java.io.File
|
||||
import java.io.FileNotFoundException
|
||||
import java.io.IOException
|
||||
import java.lang.NumberFormatException
|
||||
import java.net.InetAddress
|
||||
@@ -94,7 +98,8 @@ data class IpNeighbour(val ip: InetAddress, val dev: String, val lladdr: Long, v
|
||||
.filter { it.size >= 6 && mac.matcher(it[ARP_HW_ADDRESS]).matches() }
|
||||
.toList()
|
||||
} catch (e: IOException) {
|
||||
Timber.w(e)
|
||||
if (e !is FileNotFoundException || !BuildCompat.isAtLeastQ() ||
|
||||
(e.cause as? ErrnoException)?.errno != OsConstants.EACCES) Timber.w(e)
|
||||
}
|
||||
return arpCache
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user