Misc fixes

This commit is contained in:
Mygod
2020-01-23 10:02:00 +08:00
parent a3e954d102
commit b55ad234ac
5 changed files with 13 additions and 15 deletions

View File

@@ -112,7 +112,9 @@ object WifiP2pManagerHelper {
*
* Source: https://android.googlesource.com/platform/frameworks/base/+/android-4.2_r1/wifi/java/android/net/wifi/p2p/WifiP2pGroup.java#253
*/
private val getNetworkId by lazy { WifiP2pGroup::class.java.getDeclaredMethod("getNetworkId") }
private val getNetworkId by lazy @SuppressLint("DiscouragedPrivateApi") {
WifiP2pGroup::class.java.getDeclaredMethod("getNetworkId")
}
@Deprecated("No longer used since API 29")
val WifiP2pGroup.netId get() = getNetworkId.invoke(this) as Int
}