Merge branch 'v2.4' into q-beta
This commit is contained in:
@@ -15,7 +15,7 @@ buildscript {
|
||||
classpath 'com.android.tools.build:gradle:3.5.0-beta01'
|
||||
classpath 'com.github.ben-manes:gradle-versions-plugin:0.21.0'
|
||||
classpath 'com.google.gms:google-services:4.2.0'
|
||||
classpath 'io.fabric.tools:gradle:1.28.1'
|
||||
classpath 'io.fabric.tools:gradle:1.29.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ android {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 28
|
||||
resConfigs "ru", "zh-rCN"
|
||||
versionCode 203
|
||||
versionName "2.4.3"
|
||||
versionCode 204
|
||||
versionName '2.4.4'
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
|
||||
@@ -41,18 +41,19 @@ object WifiP2pManagerHelper {
|
||||
*
|
||||
* Source: https://android.googlesource.com/platform/frameworks/base/+/android-4.3_r0.9/wifi/java/android/net/wifi/p2p/WifiP2pManager.java#958
|
||||
*/
|
||||
private val startWps by lazy {
|
||||
@JvmStatic
|
||||
val startWps by lazy {
|
||||
try {
|
||||
WifiP2pManager::class.java.getDeclaredMethod("startWps",
|
||||
WifiP2pManager.Channel::class.java, WpsInfo::class.java, WifiP2pManager.ActionListener::class.java)
|
||||
}
|
||||
fun WifiP2pManager.startWps(c: WifiP2pManager.Channel, wps: WpsInfo, listener: WifiP2pManager.ActionListener) {
|
||||
try {
|
||||
startWps.invoke(this, c, wps, listener)
|
||||
} catch (e: NoSuchMethodException) {
|
||||
DebugHelper.logEvent("NoSuchMethod_startWps")
|
||||
listener.onFailure(UNSUPPORTED)
|
||||
null
|
||||
}
|
||||
}
|
||||
fun WifiP2pManager.startWps(c: WifiP2pManager.Channel, wps: WpsInfo, listener: WifiP2pManager.ActionListener) {
|
||||
startWps!!.invoke(this, c, wps, listener)
|
||||
}
|
||||
|
||||
/**
|
||||
* Available since Android 4.2.
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<data>
|
||||
<import type="be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper"/>
|
||||
<variable
|
||||
name="data"
|
||||
type="be.mygod.vpnhotspot.manage.RepeaterManager.Data"/>
|
||||
@@ -73,7 +74,7 @@
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
android:onClick="@{_ -> data.wps()}"
|
||||
android:visibility="@{data.serviceStarted}">
|
||||
android:visibility="@{data.serviceStarted && WifiP2pManagerHelper.startWps != null}">
|
||||
|
||||
<Space
|
||||
android:layout_width="40dp"
|
||||
|
||||
Reference in New Issue
Block a user