add more stubs

This commit is contained in:
Julian Winkler
2023-11-08 21:40:39 +01:00
parent 9f74ab811e
commit 72a8b3a047
21 changed files with 128 additions and 34 deletions

View File

@@ -73,14 +73,6 @@ JNIEXPORT void JNICALL Java_android_content_res_AssetManager_setLocale
JNIEXPORT jobjectArray JNICALL Java_android_content_res_AssetManager_getLocales
(JNIEnv *, jobject);
/*
* Class: android_content_res_AssetManager
* Method: getResourceEntryName
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_AssetManager_getResourceEntryName
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: openAsset

View File

@@ -0,0 +1,5 @@
package android.animation;
public class ArgbEvaluator {
}

View File

@@ -8,6 +8,10 @@ public class ValueAnimator extends Animator {
return new ValueAnimator();
}
public static ValueAnimator ofObject(TypeEvaluator evaluator, Object[] values) {
return new ValueAnimator();
}
public ValueAnimator setDuration(long duration) {
return this;
}
@@ -33,6 +37,7 @@ public class ValueAnimator extends Animator {
public void setIntValues(int[] values) {}
public void setRepeatCount(int value) {}
public void setRepeatMode(int value) {}
public void cancel() {}
/**
* Implementors of this interface can add themselves as update listeners

View File

@@ -223,6 +223,9 @@ public final class AssetManager {
}
return getResourceText(resValue.getData());
}
if (resValue.getValueType() == ValueType.INT_COLOR_RGB8) {
return String.format("#%08x", resValue.getData());
}
return resValue.getDataAsPoolString().get();
}
@@ -869,7 +872,9 @@ public final class AssetManager {
/*package*/ /*native*/ final String getResourceTypeName(int resid) {
return tableBlockSearch(resid).pickOne().getTypeName();
}
/*package*/ native final String getResourceEntryName(int resid);
/*package*/ /*native*/ final String getResourceEntryName(int resid) {
return tableBlockSearch(resid).pickOne().getName();
}
private native final int openAsset(String fileName, int accessMode);
private final native ParcelFileDescriptor openAssetFd(String fileName,

View File

@@ -402,7 +402,11 @@ public class CursorWindow extends SQLiteClosable implements Parcelable {
* @return The value of the field as a <code>long</code>.
*/
public long getLong(int row, int column) {
return (Long)rows.get(row - startPos)[column];
Long field = (Long)rows.get(row - startPos)[column];
if (field == null) {
return 0L;
}
return field.longValue();
}
/**

View File

@@ -381,7 +381,8 @@ public class Matrix {
* M' = T(dx, dy) * M
*/
public boolean postTranslate(float dx, float dy) {
return native_postTranslate(native_instance, dx, dy);
// return native_postTranslate(native_instance, dx, dy);
return true;
}
/**
* Postconcats the matrix with the specified scale.
@@ -396,14 +397,16 @@ public class Matrix {
* M' = S(sx, sy) * M
*/
public boolean postScale(float sx, float sy) {
return native_postScale(native_instance, sx, sy);
// return native_postScale(native_instance, sx, sy);
return true;
}
/**
* Postconcats the matrix with the specified rotation.
* M' = R(degrees, px, py) * M
*/
public boolean postRotate(float degrees, float px, float py) {
return native_postRotate(native_instance, degrees, px, py);
// return native_postRotate(native_instance, degrees, px, py);
return true;
}
/**
* Postconcats the matrix with the specified rotation.

View File

@@ -50,4 +50,8 @@ public class Typeface {
}
private static native long native_create(CharSequence family_name, int style);
public int getStyle() {
return 0;
}
}

View File

@@ -79,4 +79,12 @@ public abstract class Drawable {
public int getIntrinsicHeight() {return 0;}
public void setTintList (ColorStateList tint) {}
public void setTint(int tint) {}
public boolean isStateful() {
return false;
}
public void setTintMode(PorterDuff.Mode tintMode) {}
}

View File

@@ -1,6 +1,7 @@
package android.graphics.drawable;
import android.graphics.Canvas;
import android.graphics.Rect;
public class InsetDrawable extends Drawable {
@@ -13,5 +14,7 @@ public class InsetDrawable extends Drawable {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'draw'");
}
public boolean getPadding(Rect padding) { return false; }
}

View File

@@ -40,4 +40,8 @@ public class AudioManager {
public int requestAudioFocus(OnAudioFocusChangeListener listener, int streamType, int durationHint) {
return /*AUDIOFOCUS_REQUEST_GRANTED*/1;
}
public int abandonAudioFocus(OnAudioFocusChangeListener listener) {
return /*AUDIOFOCUS_REQUEST_GRANTED*/1;
}
}

View File

@@ -94,6 +94,27 @@ public class BaseBundle {
return (s == null) ? defaultValue : s;
}
/**
* Returns the value associated with the given key, or defaultValue if
* no mapping of the desired type exists for the given key.
*
* @param key a String
* @param defaultValue Value to return if key does not exist
* @return a long value
*/
public long getLong(String key, long defaultValue) {
Object o = mMap.get(key);
if (o == null) {
return defaultValue;
}
try {
return (Long)o;
} catch (ClassCastException e) {
typeWarning(key, o, "Long", defaultValue, e);
return defaultValue;
}
}
/**
* Inserts a long value into the mapping of this Bundle, replacing
* any existing value for the given key.

View File

@@ -795,27 +795,6 @@ public final class Bundle extends BaseBundle implements Cloneable {
return getLong(key, 0L);
}
/**
* Returns the value associated with the given key, or defaultValue if
* no mapping of the desired type exists for the given key.
*
* @param key a String
* @param defaultValue Value to return if key does not exist
* @return a long value
*/
public long getLong(String key, long defaultValue) {
Object o = mMap.get(key);
if (o == null) {
return defaultValue;
}
try {
return (Long)o;
} catch (ClassCastException e) {
typeWarning(key, o, "Long", defaultValue, e);
return defaultValue;
}
}
/**
* Returns the value associated with the given key, or 0.0f if
* no mapping of the desired type exists for the given key.

View File

@@ -0,0 +1,5 @@
package android.text.method;
public class LinkMovementMethod extends MovementMethod {
}

View File

@@ -2,6 +2,7 @@ package android.view;
import android.animation.StateListAnimator;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
@@ -1537,4 +1538,14 @@ public class View extends Object {
public float getZ() {return 0.f;}
protected void onSizeChanged(int w, int h, int oldw, int oldh) {}
public void setBackgroundTintList(ColorStateList tint) {}
protected int computeHorizontalScrollRange() {
return getWidth();
}
protected int computeHorizontalScrollExtent() {
return getWidth();
}
}

View File

@@ -8,4 +8,6 @@ public class Animation {
public void setInterpolator(Interpolator i) {}
public void cancel() {}
}

View File

@@ -13,4 +13,6 @@ public class CheckBox extends CompoundButton {
super(context, attributeSet);
}
public void setLines(int lines) {}
}

View File

@@ -0,0 +1,4 @@
package android.widget;
public abstract class CursorAdapter extends BaseAdapter {
}

View File

@@ -0,0 +1,4 @@
package android.widget;
public interface ListAdapter extends Adapter {
}

View File

@@ -186,6 +186,12 @@ public class TextView extends View {
public CharSequence getHint() {return "HINT";}
public int getMinHeight() {return 0;}
public int getMinWidth() {return 0;}
public void setMinHeight(int minHeight) {}
public void setHorizontallyScrolling(boolean whether) {}
public static interface OnEditorActionListener {
public abstract boolean onEditorAction(TextView v, int actionId, KeyEvent event);
}

View File

@@ -0,0 +1,22 @@
package android.widget;
import android.content.Context;
public class Toast {
private String text;
public static Toast makeText(Context context, int resId, int duration) {
return makeText(context, context.getString(resId), duration);
}
public static Toast makeText(Context context, CharSequence text, int duration) {
Toast toast = new Toast();
toast.text = String.valueOf(text);
return toast;
}
public void show() {
System.out.println("showing toast: " + text);
}
}

Some files were not shown because too many files have changed in this diff Show More