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
api-impl: misc stubs
This commit is contained in:
@@ -9,6 +9,8 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#undef android_view_Window_FEATURE_OPTIONS_PANEL
|
#undef android_view_Window_FEATURE_OPTIONS_PANEL
|
||||||
#define android_view_Window_FEATURE_OPTIONS_PANEL 0L
|
#define android_view_Window_FEATURE_OPTIONS_PANEL 0L
|
||||||
|
#undef android_view_Window_FEATURE_NO_TITLE
|
||||||
|
#define android_view_Window_FEATURE_NO_TITLE 1L
|
||||||
/*
|
/*
|
||||||
* Class: android_view_Window
|
* Class: android_view_Window
|
||||||
* Method: set_widget_as_root
|
* Method: set_widget_as_root
|
||||||
|
|||||||
@@ -559,4 +559,5 @@ public class Activity extends ContextThemeWrapper implements Window.Callback {
|
|||||||
public static native void nativeStartActivity(Activity activity);
|
public static native void nativeStartActivity(Activity activity);
|
||||||
public static native void nativeOpenURI(String uri);
|
public static native void nativeOpenURI(String uri);
|
||||||
public native void nativeFileChooser(int action, String type, String title, int requestCode);
|
public native void nativeFileChooser(int action, String type, String title, int requestCode);
|
||||||
|
public void reportFullyDrawn() {}
|
||||||
}
|
}
|
||||||
|
|||||||
21
src/api-impl/android/app/ActivityThread.java
Normal file
21
src/api-impl/android/app/ActivityThread.java
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
package android.app;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import android.content.pm.ConfigurationInfo;
|
||||||
|
import android.content.Context;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ActivityThread {
|
||||||
|
public static ActivityThread currentActivityThread() {
|
||||||
|
return new ActivityThread();
|
||||||
|
}
|
||||||
|
public static String currentPackageName() {
|
||||||
|
return Context.this_application.getPackageName();
|
||||||
|
}
|
||||||
|
public static Application currentApplication() {
|
||||||
|
return Context.this_application;
|
||||||
|
}
|
||||||
|
public Application getApplication() {
|
||||||
|
return Context.this_application;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -69,7 +69,8 @@ public class Context extends Object {
|
|||||||
public static final String MEDIA_ROUTER_SERVICE = "media_router";
|
public static final String MEDIA_ROUTER_SERVICE = "media_router";
|
||||||
public static final String WINDOW_SERVICE = "window";
|
public static final String WINDOW_SERVICE = "window";
|
||||||
public static final String INPUT_METHOD_SERVICE = "input";
|
public static final String INPUT_METHOD_SERVICE = "input";
|
||||||
public static final String POWER_SERVICE = "power";
|
public static final String POWER_SERVICE = "power";
|
||||||
|
public static final String VIBRATOR_SERVICE = "vibrator";
|
||||||
|
|
||||||
public static Vibrator vibrator;
|
public static Vibrator vibrator;
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
public class IntentFilter {
|
public class IntentFilter {
|
||||||
|
|
||||||
@@ -59,4 +60,8 @@ public class IntentFilter {
|
|||||||
public String getDataScheme(int index) {
|
public String getDataScheme(int index) {
|
||||||
return dataSchemes.get(index);
|
return dataSchemes.get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final Iterator<String> actionsIterator() {
|
||||||
|
return actions.iterator();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public class ConnectivityManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public NetworkInfo getNetworkInfo(int networkType) {
|
public NetworkInfo getNetworkInfo(int networkType) {
|
||||||
return null; // this means the network type is not supported, which should make properly coded apps cease any attempts to use network-related APIs
|
return new NetworkInfo(nativeGetNetworkAvailable());
|
||||||
}
|
}
|
||||||
|
|
||||||
public NetworkInfo getActiveNetworkInfo() {
|
public NetworkInfo getActiveNetworkInfo() {
|
||||||
|
|||||||
@@ -47,4 +47,8 @@ public class NetworkInfo {
|
|||||||
public String getSubtypeName() {
|
public String getSubtypeName() {
|
||||||
return "UNKNOWN";
|
return "UNKNOWN";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isAvailable () {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ public class FileObserver {
|
|||||||
|
|
||||||
public FileObserver(String path, int mask) {}
|
public FileObserver(String path, int mask) {}
|
||||||
|
|
||||||
|
public FileObserver(String path) {}
|
||||||
|
|
||||||
public void startWatching() {}
|
public void startWatching() {}
|
||||||
|
|
||||||
public void stopWatching() {}
|
public void stopWatching() {}
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ public final class StrictMode {
|
|||||||
public Builder detectAll() {
|
public Builder detectAll() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
public Builder detectNetwork() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
public Builder permitDiskReads() {
|
public Builder permitDiskReads() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -20,9 +23,6 @@ public final class StrictMode {
|
|||||||
public Builder penaltyLog() {
|
public Builder penaltyLog() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public Builder detectNetwork() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public ThreadPolicy build() {
|
public ThreadPolicy build() {
|
||||||
return new ThreadPolicy();
|
return new ThreadPolicy();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
package android.os;
|
package android.os;
|
||||||
|
|
||||||
public class UserManager {
|
public class UserManager {
|
||||||
|
public boolean isUserUnlocked() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,10 @@ public class Vibrator {
|
|||||||
fd = native_constructor();
|
fd = native_constructor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasVibrator(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public void vibrate(long millis) {
|
public void vibrate(long millis) {
|
||||||
if(fd != -1)
|
if(fd != -1)
|
||||||
native_vibrate(fd, millis);
|
native_vibrate(fd, millis);
|
||||||
|
|||||||
@@ -57,4 +57,8 @@ public class TelephonyManager {
|
|||||||
public int getCallState() {
|
public int getCallState() {
|
||||||
return 0; // CALL_STATE_IDLE
|
return 0; // CALL_STATE_IDLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDeviceId() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,8 +44,14 @@ public class LayoutInflater {
|
|||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Factory mFactory;
|
||||||
|
|
||||||
public final LayoutInflater.Factory getFactory() {
|
public final LayoutInflater.Factory getFactory() {
|
||||||
return null;
|
return mFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setFactory(LayoutInflater.Factory factory){
|
||||||
|
mFactory = factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFactory2(Factory2 factory) {
|
public void setFactory2(Factory2 factory) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.view.SurfaceHolder;
|
|||||||
|
|
||||||
public class Window {
|
public class Window {
|
||||||
public static final int FEATURE_OPTIONS_PANEL = 0;
|
public static final int FEATURE_OPTIONS_PANEL = 0;
|
||||||
|
public static final int FEATURE_NO_TITLE = 1;
|
||||||
|
|
||||||
public static interface Callback {
|
public static interface Callback {
|
||||||
public void onContentChanged();
|
public void onContentChanged();
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ public interface WindowManager {
|
|||||||
|
|
||||||
public class LayoutParams extends ViewGroup.LayoutParams {
|
public class LayoutParams extends ViewGroup.LayoutParams {
|
||||||
public static final int FLAG_KEEP_SCREEN_ON = 0;
|
public static final int FLAG_KEEP_SCREEN_ON = 0;
|
||||||
|
public static final int FLAG_DIM_BEHIND = 2;
|
||||||
|
public static final int FLAG_NOT_FOCUSABLE = 8;
|
||||||
|
|
||||||
public float screenBrightness;
|
public float screenBrightness;
|
||||||
public int softInputMode;
|
public int softInputMode;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ hax_jar = jar('hax', [
|
|||||||
'android/annotation/Widget.java',
|
'android/annotation/Widget.java',
|
||||||
'android/app/Activity.java',
|
'android/app/Activity.java',
|
||||||
'android/app/ActivityManager.java',
|
'android/app/ActivityManager.java',
|
||||||
|
'android/app/ActivityThread.java',
|
||||||
'android/app/AlarmManager.java',
|
'android/app/AlarmManager.java',
|
||||||
'android/app/AlertDialog.java',
|
'android/app/AlertDialog.java',
|
||||||
'android/app/AppGlobals.java',
|
'android/app/AppGlobals.java',
|
||||||
|
|||||||
Reference in New Issue
Block a user