You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
misc stubbing
This commit is contained in:
@@ -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) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user