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
api-impl: add stubs / simple stuff for OsmAnd
without native libs present, launches and renders white square in map view; with native libs present, segfaults in bundled skia
This commit is contained in:
@@ -6,6 +6,7 @@ import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.net.Uri;
|
||||
@@ -451,6 +452,20 @@ public class Activity extends ContextWrapper implements Window.Callback {
|
||||
}
|
||||
}
|
||||
|
||||
public String getLocalClassName() {
|
||||
final String pkg = getPackageName();
|
||||
final String cls = this.getClass().getName();
|
||||
int packageLen = pkg.length();
|
||||
if (!cls.startsWith(pkg) || cls.length() <= packageLen || cls.charAt(packageLen) != '.') {
|
||||
return cls;
|
||||
}
|
||||
return cls.substring(packageLen+1);
|
||||
}
|
||||
|
||||
public SharedPreferences getPreferences(int mode) {
|
||||
return getSharedPreferences(getLocalClassName(), mode);
|
||||
}
|
||||
|
||||
private native void nativeFinish(long native_window);
|
||||
public static native void nativeRecreateActivity(Activity activity);
|
||||
public static native void nativeStartActivity(Activity activity);
|
||||
|
||||
Reference in New Issue
Block a user