You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
add more APIs needed for NewPipe
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
11
src/api-impl/android/net/NetworkRequest.java
Normal file
11
src/api-impl/android/net/NetworkRequest.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package android.net;
|
||||
|
||||
public class NetworkRequest {
|
||||
|
||||
public class Builder {
|
||||
|
||||
public NetworkRequest build() {
|
||||
return new NetworkRequest();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user