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

@@ -95,18 +95,6 @@ class RepeaterService : Service(), WifiP2pManager.ChannelListener, SharedPrefere
fun shutdown() {
if (active) removeGroup()
}
fun resetCredentials() {
val channel = channel
if (channel == null) SmartSnackbar.make(R.string.repeater_failure_disconnected).show()
else p2pManager.deletePersistentGroup(channel, (group ?: return).netId,
object : WifiP2pManager.ActionListener {
override fun onSuccess() = SmartSnackbar.make(R.string.repeater_reset_credentials_success)
.shortToast().show()
override fun onFailure(reason: Int) = SmartSnackbar.make(
formatReason(R.string.repeater_reset_credentials_failure, reason)).show()
})
}
}
private val p2pManager get() = RepeaterService.p2pManager!!