api-impl: stubs and fixes for Shosetsu

This commit is contained in:
Julian Winkler
2025-10-04 13:57:53 +02:00
committed by Mis012
parent 8dcaf3e1ef
commit e58d8d2065
18 changed files with 77 additions and 22 deletions

View File

@@ -568,9 +568,7 @@ public class Activity extends ContextThemeWrapper implements Window.Callback, La
public void overridePendingTransition(int enterAnim, int exitAnim) {}
public boolean isTaskRoot() {
return false;
}
public native boolean isTaskRoot();
public void postponeEnterTransition() {}

View File

@@ -0,0 +1,4 @@
package android.content;
public class AbstractThreadedSyncAdapter {
}

View File

@@ -12,6 +12,7 @@ import org.xmlpull.v1.XmlPullParser;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Objects;
import java.util.Set;
public class Intent implements Parcelable {
@@ -416,4 +417,11 @@ public class Intent implements Parcelable {
public Intent getSelector() {
return selector;
}
public boolean filterEquals(Intent other) {
return Objects.equals(this.action, other.action)
&& Objects.equals(this.component, other.component)
&& Objects.equals(this.data, other.data)
&& Objects.equals(this.type, other.type);
}
}

View File

@@ -0,0 +1,4 @@
package android.content;
public class Loader {
}

View File

@@ -521,17 +521,17 @@ public class Canvas {
}
public boolean clipRect(RectF rect) {
Log.w("Canvas", "STUB: clipRect");
Log.v("Canvas", "STUB: clipRect");
return false;
}
public boolean clipRect(float left, float top, float right, float bottom, Region.Op op) {
Log.w("Canvas", "STUB: clipRect");
Log.v("Canvas", "STUB: clipRect");
return false;
}
public boolean clipRect(RectF rect, Region.Op op) {
Log.w("Canvas", "STUB: clipRect");
Log.v("Canvas", "STUB: clipRect");
return false;
}
@@ -550,4 +550,8 @@ public class Canvas {
public void drawPicture(Picture picture) {
Log.w("Canvas", "STUB: drawPicture");
}
public void drawPoint(float x, float y, Paint paint) {
Log.w("Canvas", "STUB: drawPoint");
}
}

View File

@@ -86,7 +86,8 @@ public class Region {
* Set the region to the specified rectangle
*/
public boolean set(Rect r) {
return nativeSetRect(mNativeRegion, r.left, r.top, r.right, r.bottom);
// return nativeSetRect(mNativeRegion, r.left, r.top, r.right, r.bottom);
return false;
}
/**
@@ -107,7 +108,9 @@ public class Region {
/**
* Return true if this region is empty
*/
public native boolean isEmpty();
public /*native*/ boolean isEmpty() {
return false;
}
/**
* Return true if the region contains a single rectangle
@@ -124,7 +127,7 @@ public class Region {
*/
public Rect getBounds() {
Rect r = new Rect();
nativeGetBounds(mNativeRegion, r);
// nativeGetBounds(mNativeRegion, r);
return r;
}
@@ -264,8 +267,9 @@ public class Region {
* regions. Return true if the result is not empty.
*/
public boolean op(Region region1, Region region2, Op op) {
return nativeOp(mNativeRegion, region1.mNativeRegion,
region2.mNativeRegion, op.nativeInt);
// return nativeOp(mNativeRegion, region1.mNativeRegion,
// region2.mNativeRegion, op.nativeInt);
return false;
}
public String toString() {
return nativeToString(mNativeRegion);

View File

@@ -23,7 +23,7 @@ public class NetworkInfo {
}
public int getType() {
return 0x8; // TYPE_DUMMY
return state == State.CONNECTED ? /*TYPE_WIFI*/0x1 : 0x0;
}
public boolean isConnected() {

View File

@@ -20,9 +20,17 @@ public class TextToSpeech {
return ERROR;
}
public int setOnUtteranceProgressListener(UtteranceProgressListener listener) {
return ERROR;
}
public void shutdown() {
}
public int stop() {
return ERROR;
}
public static interface OnInitListener {
abstract void onInit(int status);
}

View File

@@ -0,0 +1,4 @@
package android.speech.tts;
public class UtteranceProgressListener {
}

View File

@@ -23,4 +23,10 @@ public class CookieManager {
public void removeSessionCookies(ValueCallback callback) {}
public void flush() {}
public String getCookie(String url) {
return "";
}
public void setCookie(String url, String value) {}
}

View File

@@ -54,4 +54,6 @@ public class WebSettings {
public void setBlockNetworkLoads(boolean block) {}
public void setMixedContentMode(int mode) {}
public void setBlockNetworkImage(boolean block) {}
}

View File

@@ -96,6 +96,8 @@ public class WebView extends ViewGroup {
loadDataWithBaseURL("about:blank", data, mimeType, encoding, "about:blank");
}
public void evaluateJavascript(String script, ValueCallback resultCallback) {}
@Override
protected native long native_constructor(Context context, AttributeSet attrs);
private native void native_loadDataWithBaseURL(long widget, String baseUrl, String data, String mimeType, String encoding);

View File

@@ -75,6 +75,7 @@ srcs = [
'android/bluetooth/BluetoothManager.java',
'android/bluetooth/BluetoothProfile.java',
'android/bluetooth/le/ScanCallback.java',
'android/content/AbstractThreadedSyncAdapter.java',
'android/content/ActivityNotFoundException.java',
'android/content/AsyncQueryHandler.java',
'android/content/ATLMediaContentProvider.java',
@@ -94,6 +95,7 @@ srcs = [
'android/content/Intent.java',
'android/content/IntentFilter.java',
'android/content/IntentSender.java',
'android/content/Loader.java',
'android/content/OperationApplicationException.java',
'android/content/RestrictionsManager.java',
'android/content/SearchRecentSuggestionsProvider.java',
@@ -383,6 +385,7 @@ srcs = [
'android/security/keystore/KeyGenParameterSpec.java',
'android/service/media/MediaBrowserService.java',
'android/speech/tts/TextToSpeech.java',
'android/speech/tts/UtteranceProgressListener.java',
'android/telecom/ConnectionService.java',
'android/telecom/TelecomManager.java',
'android/telephony/CellLocation.java',