api-impl: misc stubs

This commit is contained in:
Markuss Broks
2024-10-12 14:53:30 +03:00
parent ab07fc11da
commit 24fab49a1c
16 changed files with 63 additions and 6 deletions

View File

@@ -9,6 +9,8 @@ extern "C" {
#endif
#undef android_view_Window_FEATURE_OPTIONS_PANEL
#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
* Method: set_widget_as_root

View File

@@ -559,4 +559,5 @@ public class Activity extends ContextThemeWrapper implements Window.Callback {
public static native void nativeStartActivity(Activity activity);
public static native void nativeOpenURI(String uri);
public native void nativeFileChooser(int action, String type, String title, int requestCode);
public void reportFullyDrawn() {}
}

View 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;
}
}

View File

@@ -70,6 +70,7 @@ public class Context extends Object {
public static final String WINDOW_SERVICE = "window";
public static final String INPUT_METHOD_SERVICE = "input";
public static final String POWER_SERVICE = "power";
public static final String VIBRATOR_SERVICE = "vibrator";
public static Vibrator vibrator;

View File

@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.Iterator;
public class IntentFilter {
@@ -59,4 +60,8 @@ public class IntentFilter {
public String getDataScheme(int index) {
return dataSchemes.get(index);
}
public final Iterator<String> actionsIterator() {
return actions.iterator();
}
}

View File

@@ -10,7 +10,7 @@ public class ConnectivityManager {
}
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() {

View File

@@ -47,4 +47,8 @@ public class NetworkInfo {
public String getSubtypeName() {
return "UNKNOWN";
}
public boolean isAvailable () {
return false;
}
}

View File

@@ -4,6 +4,8 @@ public class FileObserver {
public FileObserver(String path, int mask) {}
public FileObserver(String path) {}
public void startWatching() {}
public void stopWatching() {}

View File

@@ -11,6 +11,9 @@ public final class StrictMode {
public Builder detectAll() {
return this;
}
public Builder detectNetwork() {
return this;
}
public Builder permitDiskReads() {
return this;
}
@@ -20,9 +23,6 @@ public final class StrictMode {
public Builder penaltyLog() {
return this;
}
public Builder detectNetwork() {
return this;
}
public ThreadPolicy build() {
return new ThreadPolicy();
}

View File

@@ -1,4 +1,7 @@
package android.os;
public class UserManager {
public boolean isUserUnlocked() {
return true;
}
}

View File

@@ -9,6 +9,10 @@ public class Vibrator {
fd = native_constructor();
}
public boolean hasVibrator(){
return true;
}
public void vibrate(long millis) {
if(fd != -1)
native_vibrate(fd, millis);

View File

@@ -57,4 +57,8 @@ public class TelephonyManager {
public int getCallState() {
return 0; // CALL_STATE_IDLE
}
public String getDeviceId() {
return "";
}
}

View File

@@ -44,8 +44,14 @@ public class LayoutInflater {
this.context = context;
}
private Factory mFactory;
public final LayoutInflater.Factory getFactory() {
return null;
return mFactory;
}
public final void setFactory(LayoutInflater.Factory factory){
mFactory = factory;
}
public void setFactory2(Factory2 factory) {

View File

@@ -6,6 +6,7 @@ import android.view.SurfaceHolder;
public class Window {
public static final int FEATURE_OPTIONS_PANEL = 0;
public static final int FEATURE_NO_TITLE = 1;
public static interface Callback {
public void onContentChanged();

View File

@@ -5,6 +5,8 @@ public interface WindowManager {
public class LayoutParams extends ViewGroup.LayoutParams {
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 int softInputMode;

View File

@@ -22,6 +22,7 @@ hax_jar = jar('hax', [
'android/annotation/Widget.java',
'android/app/Activity.java',
'android/app/ActivityManager.java',
'android/app/ActivityThread.java',
'android/app/AlarmManager.java',
'android/app/AlertDialog.java',
'android/app/AppGlobals.java',