misc stubbing

This commit is contained in:
Mis012
2022-11-24 23:10:27 +01:00
parent 9db07691fe
commit 52ba443401
16 changed files with 114 additions and 30 deletions

View File

@@ -1,5 +1,9 @@
package android.content;
public class ContentResolver {
import android.net.Uri;
import android.database.ContentObserver;
public class ContentResolver {
public final void registerContentObserver(Uri uri, boolean notifyForDescendants, ContentObserver observer) {
}
}

View File

@@ -42,6 +42,7 @@ public class Context extends Object {
static DisplayMetrics dm;
static Configuration config;
static Resources r;
static ApplicationInfo application_info;
static String apk_path = "/tmp/APK_PATH_SHOULD_HAVE_BEEN_FILLED_IN_BY_CODE_IN_main.c/";
@@ -59,14 +60,21 @@ public class Context extends Object {
config = new Configuration();
r = new Resources(assets, dm, config);
this_application = new Application(); // TODO: the application context is presumably not identical to the Activity context, what is the difference for us though?
application_info = new ApplicationInfo();
}
public Context() {
System.out.println("new Context! this one is: " + this);
}
public Resources.Theme getTheme() {
return r.newTheme();
}
public ApplicationInfo getApplicationInfo () {
return new ApplicationInfo();
// TODO: do this somewhere saner?
application_info.nativeLibraryDir = (new File(getDataDirFile(), "lib")).getAbsolutePath();
return application_info;
}
public Context getApplicationContext() {

View File

@@ -114,8 +114,19 @@ public class Intent {
return this; //??
}
public Intent setClass (Context packageContext, Class<?> cls) {
public Intent setClass(Context packageContext, Class<?> cls) {
return this; //??
}
public String getStringExtra(String name) {
return null;
}
public Uri getData() {
return null;
}
public boolean getBooleanExtra(String name, boolean defaultValue) {
return defaultValue;
}
}

View File

@@ -1258,8 +1258,8 @@ public class Resources {
int len = attrs.length;
TypedArray array = getCachedStyledAttributes(len);
array.mRsrcs = attrs;
AssetManager.applyStyle(mTheme, 0, 0, 0, attrs,
array.mData, array.mIndices);
/* AssetManager.applyStyle(mTheme, 0, 0, 0, attrs,
array.mData, array.mIndices);*/
return array;
}
@@ -1288,7 +1288,7 @@ public class Resources {
int len = attrs.length;
TypedArray array = getCachedStyledAttributes(len);
array.mRsrcs = attrs;
/*
AssetManager.applyStyle(mTheme, 0, resid, 0, attrs,
array.mData, array.mIndices);
if (false) {
@@ -1316,7 +1316,7 @@ public class Resources {
+ "=" + value;
}
System.out.println(s);
}
}*/
return array;
}
@@ -1372,7 +1372,7 @@ public class Resources {
int[] attrs, int defStyleAttr, int defStyleRes) {
int len = attrs.length;
TypedArray array = getCachedStyledAttributes(len);
/*
// XXX note that for now we only work with compiled XML files.
// To support generic XML files we will need to manually parse
// out the attributes from the XML file (applying type information
@@ -1414,7 +1414,7 @@ public class Resources {
}
System.out.println(s);
}
*/
return array;
}
@@ -1465,7 +1465,7 @@ public class Resources {
/*package*/ Theme() {
mAssets = Resources.this.mAssets;
mTheme = mAssets.createTheme();
mTheme = 0/*mAssets.createTheme()*/;
}
private final AssetManager mAssets;