add more APIs needed for NewPipe

This commit is contained in:
Julian Winkler
2024-03-16 12:49:28 +01:00
parent b3c0023a45
commit 276b5ca7ef
40 changed files with 768 additions and 50 deletions

View File

@@ -9,6 +9,12 @@ public class ConnectivityManager {
}
public NetworkInfo getActiveNetworkInfo() {
return null; // there is no active network, because there isn't any network at all
return new NetworkInfo();
}
public void registerNetworkCallback(NetworkRequest request, NetworkCallback callback) {}
public boolean isActiveNetworkMetered() {
return false;
}
}

View File

@@ -17,4 +17,8 @@ public class NetworkInfo {
public int getType() {
return 0x8; // where did you even get a NetworkInfo object... there is no network
}
public boolean isConnected() {
return true;
}
}

View File

@@ -0,0 +1,11 @@
package android.net;
public class NetworkRequest {
public class Builder {
public NetworkRequest build() {
return new NetworkRequest();
}
}
}

View File

@@ -7,7 +7,9 @@ import java.io.File;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
public class Uri {
import android.os.Parcelable;
public class Uri implements Parcelable {
public static final Uri EMPTY = new Uri();

View File

@@ -1,5 +1,19 @@
package android.net.wifi;
public class WifiManager {
public class WifiLock {
public void setReferenceCounted(boolean referenceCounted) {}
public void release() {}
public void acquire() {}
public boolean isHeld() { return false; }
}
public WifiLock createWifiLock(int lockType, String tag) {
return new WifiLock();
}
}