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 lots of java APIs needed for Whatsapp
This commit is contained in:
@@ -22,4 +22,8 @@ public class ConnectivityManager {
|
||||
public native boolean isActiveNetworkMetered();
|
||||
|
||||
protected native boolean nativeGetNetworkAvailable();
|
||||
|
||||
public NetworkInfo[] getAllNetworkInfo() {
|
||||
return new NetworkInfo[] { getActiveNetworkInfo() };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
9
src/api-impl/android/net/SSLSessionCache.java
Normal file
9
src/api-impl/android/net/SSLSessionCache.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package android.net;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class SSLSessionCache {
|
||||
|
||||
public SSLSessionCache(File cacheDir) {}
|
||||
|
||||
}
|
||||
@@ -2,4 +2,6 @@ package android.net;
|
||||
|
||||
public class TrafficStats {
|
||||
public static void setThreadStatsTag(int dummy) {}
|
||||
|
||||
public static void clearThreadStatsTag() {}
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
13
src/api-impl/android/net/UrlQuerySanitizer.java
Normal file
13
src/api-impl/android/net/UrlQuerySanitizer.java
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user