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
implement some stuff to make exaple SDL app run
NOTE: the main addition in this commit is WIP support for apps which render on an EGL surface obtained using ANativeWindow_fromSurface currently, this EGL surface is obtained by creating a 700x700 pixel window with GLFW (the 700x700 size is hardcoded in several places) and only Wayland is supported ideally, we'd want to use a wayland subsurface to position the EGL surface above the Surface widget it's associated with (and do whatever for X11)
This commit is contained in:
@@ -3,10 +3,14 @@ package android.content;
|
||||
import android.util.Log;
|
||||
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.res.AssetManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.content.Intent;
|
||||
import android.content.BroadcastReceiver;
|
||||
|
||||
import android.util.AttributeSet;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.content.SharedPreferences;
|
||||
@@ -23,6 +27,8 @@ import android.app.KeyguardManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.media.AudioManager;
|
||||
import android.app.ActivityManager;
|
||||
import android.hardware.usb.UsbManager;
|
||||
import android.os.Vibrator;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -55,6 +61,10 @@ public class Context extends Object {
|
||||
System.out.println("new Context! this one is: " + this);
|
||||
}
|
||||
|
||||
public ApplicationInfo getApplicationInfo () {
|
||||
return new ApplicationInfo();
|
||||
}
|
||||
|
||||
public Context getApplicationContext() {
|
||||
return (Context)this_application;
|
||||
}
|
||||
@@ -81,12 +91,20 @@ public class Context extends Object {
|
||||
return new AudioManager();
|
||||
case "activity":
|
||||
return new ActivityManager();
|
||||
case "usb":
|
||||
return new UsbManager();
|
||||
case "vibrator":
|
||||
return new Vibrator();
|
||||
default:
|
||||
System.out.println("!!!!!!! getSystemService: case >"+name+"< is not implemented yet");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
|
||||
return new Intent();
|
||||
}
|
||||
|
||||
public Looper getMainLooper() {
|
||||
System.out.println("returning the main Looper, most definitely doing just that!");
|
||||
return new Looper();
|
||||
|
||||
Reference in New Issue
Block a user