api-impl: stubs and fixes for Open Sudoku

This commit is contained in:
Kilian "CaféHaine" Guillaume 2024-11-19 18:00:38 +01:00
parent eba9c7037c
commit 44d922baea
7 changed files with 29 additions and 13 deletions

View file

@ -217,7 +217,7 @@ public class Context extends Object {
case "accessibility":
return new AccessibilityManager();
case "layout_inflater":
return new LayoutInflater(getApplicationContext());
return new LayoutInflater(this);
case "wifi":
return new WifiManager();
case "bluetooth":

View file

@ -282,6 +282,8 @@ public class Paint {
return new FontMetricsInt();
}
public void set(Paint paint) {}
private native long native_constructor();
private native void native_set_antialias(long skia_paint, boolean aa);
private native void native_set_color(long skia_paint, int color);

View file

@ -0,0 +1,15 @@
package android.graphics.drawable;
import android.graphics.drawable.Drawable;
public class DrawableWrapper extends Drawable {
private Drawable drawable;
public DrawableWrapper(Drawable drawable) {
this.drawable = drawable;
}
public Drawable getDrawable() {
return drawable;
}
}

View file

@ -1,25 +1,17 @@
package android.graphics.drawable;
import android.graphics.Rect;
import android.graphics.drawable.DrawableWrapper;
public class InsetDrawable extends Drawable {
private Drawable drawable;
public class InsetDrawable extends DrawableWrapper {
public InsetDrawable(Drawable drawable, int insetLeft, int insetTop, int insetRight, int insetBottom) {
super();
this.drawable = drawable;
super(drawable);
}
public InsetDrawable(Drawable drawable, int inset) {
super();
this.drawable = drawable;
super(drawable);
}
public boolean getPadding(Rect padding) { return false; }
public Drawable getDrawable() {
return drawable;
}
}

View file

@ -52,4 +52,8 @@ public class AudioManager {
public void setStreamVolume(int streamType, int index, int flags) {
System.out.println("AudioManager.setStreamVolume: >" + streamType + "< >" + index + "< >" + flags + "<");
}
public boolean isStreamMute(int streamType) {
return false;
}
}

View file

@ -1947,4 +1947,6 @@ public class View implements Drawable.Callback {
public int getImportantForAutofill() {return 0;}
public void setImportantForAutofill(int flag) {}
public void setDefaultFocusHighlightEnabled(boolean enabled) {}
}

View file

@ -206,6 +206,7 @@ hax_jar = jar('hax', [
'android/graphics/drawable/ColorDrawable.java',
'android/graphics/drawable/Drawable.java',
'android/graphics/drawable/DrawableContainer.java',
'android/graphics/drawable/DrawableWrapper.java',
'android/graphics/drawable/GradientDrawable.java',
'android/graphics/drawable/InsetDrawable.java',
'android/graphics/drawable/LayerDrawable.java',