mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-01-07 10:35:49 +01:00
fix unregisterNetworkCallback
throwing exception when the callback has not been registered
todo: squash
This commit is contained in:
parent
84257a7348
commit
dc1faa94e0
@ -330,6 +330,22 @@ public class SpoofWifiPatch {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void unregisterNetworkCallback(ConnectivityManager connectivityManager, ConnectivityManager.NetworkCallback networkCallback) {
|
||||||
|
try {
|
||||||
|
connectivityManager.unregisterNetworkCallback(networkCallback);
|
||||||
|
} catch (IllegalArgumentException ignore) {
|
||||||
|
// ignore: NetworkCallback was not registered
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void unregisterNetworkCallback(ConnectivityManager connectivityManager, PendingIntent operation) {
|
||||||
|
try {
|
||||||
|
connectivityManager.unregisterNetworkCallback(operation);
|
||||||
|
} catch (IllegalArgumentException ignore) {
|
||||||
|
// ignore: PendingIntent was not registered
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static class Utils {
|
private static class Utils {
|
||||||
private static class Option<T> {
|
private static class Option<T> {
|
||||||
private final T value;
|
private final T value;
|
||||||
|
Loading…
Reference in New Issue
Block a user