api-impl: add misc stubs/impls

This commit is contained in:
Mis012
2024-06-13 21:00:06 +02:00
parent 725df91af9
commit 81797c2667
13 changed files with 92 additions and 8 deletions

View File

@@ -41,6 +41,7 @@ public class Activity extends ContextWrapper implements Window.Callback {
private boolean paused = false; private boolean paused = false;
private CharSequence title = null; private CharSequence title = null;
List<Fragment> fragments = new ArrayList<>(); List<Fragment> fragments = new ArrayList<>();
boolean destroyed = false;
/** /**
* Helper function to be called from native code to construct main activity * Helper function to be called from native code to construct main activity
@@ -204,6 +205,7 @@ public class Activity extends ContextWrapper implements Window.Callback {
fragment.onDestroy(); fragment.onDestroy();
} }
destroyed = true;
return; return;
} }
@@ -482,6 +484,10 @@ public class Activity extends ContextWrapper implements Window.Callback {
return true; // FIXME? return true; // FIXME?
} }
public boolean isDestroyed() {
return destroyed;
}
private native void nativeFinish(long native_window); private native void nativeFinish(long native_window);
public static native void nativeRecreateActivity(Activity activity); public static native void nativeRecreateActivity(Activity activity);
public static native void nativeStartActivity(Activity activity); public static native void nativeStartActivity(Activity activity);

View File

@@ -9,9 +9,10 @@ import android.media.AudioAttributes;
import android.media.session.MediaSession; import android.media.session.MediaSession;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Parcelable;
import android.widget.RemoteViews; import android.widget.RemoteViews;
public class Notification { public class Notification implements Parcelable {
public static final AudioAttributes AUDIO_ATTRIBUTES_DEFAULT = new AudioAttributes(); public static final AudioAttributes AUDIO_ATTRIBUTES_DEFAULT = new AudioAttributes();

View File

@@ -22,4 +22,7 @@ public abstract class Service extends Context {
System.out.println("stopForeground(" + remove + ") called"); System.out.println("stopForeground(" + remove + ") called");
} }
public Application getApplication() {
return this_application;
}
} }

View File

@@ -8,4 +8,5 @@ public class Shader {
REPEAT REPEAT
} }
public void setLocalMatrix(Matrix matrix) {}
} }

View File

@@ -1804,7 +1804,8 @@ public final class MotionEvent extends InputEvent {
* a stream of position events. * a stream of position events.
*/ */
public final long getDownTime() { public final long getDownTime() {
return nativeGetDownTimeNanos(mNativePtr) / NS_PER_MS; return getEventTime(); // FIXME?
// return nativeGetDownTimeNanos(mNativePtr) / NS_PER_MS;
} }
/** /**

View File

@@ -1489,11 +1489,6 @@ public class View implements Drawable.Callback {
public void clearFocus() {} public void clearFocus() {}
public void setRotation(float rotation) {}
public void setScaleX(float scaleX) {}
public void setScaleY(float scaleY) {}
public static View inflate(Context context, int resource, ViewGroup root) { public static View inflate(Context context, int resource, ViewGroup root) {
LayoutInflater factory = LayoutInflater.from(context); LayoutInflater factory = LayoutInflater.from(context);
return factory.inflate(resource, root); return factory.inflate(resource, root);
@@ -1734,20 +1729,32 @@ public class View implements Drawable.Callback {
public void getWindowVisibleDisplayFrame(Rect rect) {} public void getWindowVisibleDisplayFrame(Rect rect) {}
public void setRotation(float rotation) {}
public void setRotationX(float deg) {} public void setRotationX(float deg) {}
public void setRotationY(float deg) {} public void setRotationY(float deg) {}
public float getRotationX() {return 0.f;} public float getRotationX() {return 0.f;}
public float getRotationY() {return 0.f;} public float getRotationY() {return 0.f;}
public void setScaleX(float scaleX) {}
public void setScaleY(float scaleY) {}
public float getScaleX() {return 1.f;} public float getScaleX() {return 1.f;}
public float getScaleY() {return 1.f;} public float getScaleY() {return 1.f;}
public void setPivotX(float pivot_x) {}
public void setPivotY(float pivot_y) {}
public float getPivotX() {return 0.f;} public float getPivotX() {return 0.f;}
public float getPivotY() {return 0.f;} public float getPivotY() {return 0.f;}
public float getTranslationZ() {return 0.f;} public float getTranslationZ() {return 0.f;}
public void setTranslationZ(float translationZ) {} public void setTranslationZ(float translationZ) {}
public int getWindowSystemUiVisibility() {
return 0;
}
public void setScrollIndicators(int indicators, int mask) {}
} }

View File

@@ -0,0 +1,5 @@
package android.view;
public class ViewAnimationUtils {
}

View File

@@ -106,4 +106,5 @@ public class Window {
return new WindowManagerImpl(); return new WindowManagerImpl();
} }
public void setSoftInputMode(int dummy) {}
} }

View File

@@ -15,4 +15,48 @@ public class WindowInsets {
public WindowInsets consumeSystemWindowInsets() { public WindowInsets consumeSystemWindowInsets() {
return this; return this;
} }
public WindowInsets replaceSystemWindowInsets(int left, int top, int right, int bottom) {
return this;
}
public int getSystemWindowInsetLeft() {
return 0;
}
public int getSystemWindowInsetTop() {
return 0;
}
public int getSystemWindowInsetRight() {
return 0;
}
public int getSystemWindowInsetBottom() {
return 0;
}
public int getStableInsetLeft() {
return 0;
}
public int getStableInsetTop() {
return 0;
}
public int getStableInsetRight() {
return 0;
}
public int getStableInsetBottom() {
return 0;
}
public boolean isRound() {
return false;
}
public boolean isConsumed() {
return false;
}
} }

View File

@@ -2,6 +2,7 @@ package android.widget;
import android.content.Context; import android.content.Context;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.View;
public class ExpandableListView extends ListView { public class ExpandableListView extends ListView {
@@ -16,4 +17,10 @@ public class ExpandableListView extends ListView {
public static int getPackedPositionGroup(long packedPosition) { public static int getPackedPositionGroup(long packedPosition) {
return 0; return 0;
} }
public void setHeaderDividersEnabled(boolean enabled) {}
public static interface OnChildClickListener {
abstract boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id);
}
} }

View File

@@ -17,4 +17,5 @@ public class HorizontalScrollView extends FrameLayout {
public void smoothScrollTo(int x, int y) {} public void smoothScrollTo(int x, int y) {}
public void setFillViewport(boolean fillViewport) {}
} }

View File

@@ -262,4 +262,10 @@ public class TextView extends View {
public Drawable[] getCompoundDrawablesRelative() {return new Drawable[4];} public Drawable[] getCompoundDrawablesRelative() {return new Drawable[4];}
public Drawable[] getCompoundDrawables() {return new Drawable[4];} public Drawable[] getCompoundDrawables() {return new Drawable[4];}
public void setTextAppearance(int dummy) {}
public int length() {
return getText().length();
}
} }

View File

@@ -372,6 +372,7 @@ hax_jar = jar('hax', [
'android/util/XmlPullAttributes.java', 'android/util/XmlPullAttributes.java',
'android/view/AbsSavedState.java', 'android/view/AbsSavedState.java',
'android/view/ActionMode.java', 'android/view/ActionMode.java',
'android/view/ViewAnimationUtils.java',
'android/view/Choreographer.java', 'android/view/Choreographer.java',
'android/view/ContextThemeWrapper.java', 'android/view/ContextThemeWrapper.java',
'android/view/Display.java', 'android/view/Display.java',