Deprecate reset credentials

Due to persistent groups no longer useful in Android Q, this feature will be removed. Users on older releases can remove remembered groups from Wi-Fi Direct settings manually.
This commit is contained in:
Mygod
2019-04-04 13:08:00 +08:00
parent 926783cc25
commit 834498b1ff
6 changed files with 10 additions and 32 deletions

View File

@@ -168,18 +168,15 @@ class RepeaterManager(private val parent: TetheringFragment) : Manager(), Servic
}
}
fun onEditResult(which: Int, data: Intent?) {
when (which) {
DialogInterface.BUTTON_POSITIVE -> try {
val master = holder.config ?: return
val config = AlertDialogFragment.getRet<WifiP2pDialogFragment.Arg>(data!!).configuration
master.update(config.SSID, config.preSharedKey)
binder!!.group = null
} catch (e: Exception) {
Timber.w(e)
SmartSnackbar.make(e).show()
}
DialogInterface.BUTTON_NEUTRAL -> binder!!.resetCredentials()
fun onEditResult(data: Intent?) {
val master = holder.config ?: return
try {
val config = AlertDialogFragment.getRet<WifiP2pDialogFragment.Arg>(data!!).configuration
master.update(config.SSID, config.preSharedKey)
binder!!.group = null
} catch (e: Exception) {
Timber.w(e)
SmartSnackbar.make(e).show()
}
holder.config = null
}

View File

@@ -133,7 +133,7 @@ class TetheringFragment : Fragment(), ServiceConnection, MenuItem.OnMenuItemClic
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) = when (requestCode) {
REPEATER_WPS -> adapter.repeaterManager.onWpsResult(resultCode, data)
REPEATER_EDIT_CONFIGURATION -> adapter.repeaterManager.onEditResult(resultCode, data)
REPEATER_EDIT_CONFIGURATION -> adapter.repeaterManager.onEditResult(data)
else -> super.onActivityResult(requestCode, resultCode, data)
}