add lots of java APIs needed for Whatsapp

This commit is contained in:
Julian Winkler
2024-06-15 22:32:01 +02:00
parent b81f53e4b2
commit bb50bbfa91
61 changed files with 383 additions and 71 deletions

View File

@@ -22,4 +22,8 @@ public class ConnectivityManager {
public native boolean isActiveNetworkMetered();
protected native boolean nativeGetNetworkAvailable();
public NetworkInfo[] getAllNetworkInfo() {
return new NetworkInfo[] { getActiveNetworkInfo() };
}
}

View File

@@ -31,4 +31,20 @@ public class NetworkInfo {
public boolean isConnectedOrConnecting() {
return false;
}
public int getSubtype() {
return 0; // NETWORK_TYPE_UNKNOWN
}
public boolean isRoaming() {
return false;
}
public String getTypeName() {
return "UNKNOWN";
}
public String getSubtypeName() {
return "UNKNOWN";
}
}

View File

@@ -0,0 +1,9 @@
package android.net;
import java.io.File;
public class SSLSessionCache {
public SSLSessionCache(File cacheDir) {}
}

View File

@@ -2,4 +2,6 @@ package android.net;
public class TrafficStats {
public static void setThreadStatsTag(int dummy) {}
public static void clearThreadStatsTag() {}
}

View File

@@ -184,6 +184,11 @@ public class Uri implements Parcelable {
return this;
}
public Builder path(String path) {
this.path = "/" + path;
return this;
}
public Uri build() throws URISyntaxException {
if ("content".equals(scheme)) { // hack: content providers not yet supported
scheme = "file";

View File

@@ -0,0 +1,13 @@
package android.net;
import java.util.Collections;
import java.util.Set;
public class UrlQuerySanitizer {
public UrlQuerySanitizer(String url) {}
public Set<String> getParameterSet() {
return Collections.emptySet();
}
}