Prevent tempering with persistent groups in Android Q

This seems to cause improper persistent group deletions, but either way, I cannot seem to find where persistent groups are persisted now on Android Q.
This commit is contained in:
Mygod
2019-04-05 09:34:23 +08:00
parent 617a2dda95
commit e799fcf9ff
3 changed files with 13 additions and 4 deletions

View File

@@ -12,6 +12,7 @@ import java.lang.reflect.Proxy
object WifiP2pManagerHelper {
const val UNSUPPORTED = -2
@Deprecated("No longer used since Android Q")
const val WIFI_P2P_PERSISTENT_GROUPS_CHANGED_ACTION = "android.net.wifi.p2p.PERSISTENT_GROUPS_CHANGED"
/**
@@ -61,6 +62,7 @@ object WifiP2pManagerHelper {
WifiP2pManager::class.java.getDeclaredMethod("deletePersistentGroup",
WifiP2pManager.Channel::class.java, Int::class.java, WifiP2pManager.ActionListener::class.java)
}
@Deprecated("No longer used since Android Q")
fun WifiP2pManager.deletePersistentGroup(c: WifiP2pManager.Channel, netId: Int,
listener: WifiP2pManager.ActionListener) {
try {
@@ -87,6 +89,7 @@ object WifiP2pManagerHelper {
* @param c is the channel created at {@link #initialize}
* @param listener for callback when persistent group info list is available. Can be null.
*/
@Deprecated("No longer used since Android Q")
fun WifiP2pManager.requestPersistentGroupInfo(c: WifiP2pManager.Channel,
listener: (Collection<WifiP2pGroup>) -> Unit) {
val proxy = Proxy.newProxyInstance(interfacePersistentGroupInfoListener.classLoader,