diff options
Diffstat (limited to 'backends/platform/android')
-rw-r--r-- | backends/platform/android/android.cpp | 20 | ||||
-rw-r--r-- | backends/platform/android/android.h | 3 | ||||
-rw-r--r-- | backends/platform/android/android.mk | 4 | ||||
-rw-r--r-- | backends/platform/android/events.cpp | 12 |
4 files changed, 35 insertions, 4 deletions
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index 6bb6de7289..69b3f1e084 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -27,6 +27,7 @@ #include <sys/time.h> #include <sys/resource.h> +#include <sys/system_properties.h> #include <time.h> #include <unistd.h> @@ -131,6 +132,11 @@ OSystem_Android::OSystem_Android(int audio_sample_rate, int audio_buffer_size) : _touchpad_scale(66), _dpad_scale(4), _trackball_scale(2) { + LOGI("Running on: [%s] [%s] SDK:%s ABI:%s", + getSystemProperty("ro.build.fingerprint").c_str(), + getSystemProperty("ro.build.display.id").c_str(), + getSystemProperty("ro.build.version.sdk").c_str(), + getSystemProperty("ro.product.cpu.abi").c_str()); } OSystem_Android::~OSystem_Android() { @@ -548,6 +554,20 @@ void OSystem_Android::logMessage(LogMessageType::Type type, } } +Common::String OSystem_Android::getSystemLanguage() const { + return Common::String::format("%s_%s", + getSystemProperty("persist.sys.language").c_str(), + getSystemProperty("persist.sys.country").c_str()); +} + +Common::String OSystem_Android::getSystemProperty(const char *name) const { + char value[PROP_VALUE_MAX]; + + int len = __system_property_get(name, value); + + return Common::String(value, len); +} + #ifdef DYNAMIC_MODULES void AndroidPluginProvider::addCustomDirectories(Common::FSList &dirs) const { ((OSystem_Android *)g_system)->addPluginDirectories(dirs); diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h index 839b3f01c1..eb05dbd390 100644 --- a/backends/platform/android/android.h +++ b/backends/platform/android/android.h @@ -144,6 +144,8 @@ private: FilesystemFactory *_fsFactory; timeval _startTime; + Common::String getSystemProperty(const char *name) const; + void initSurface(); void deinitSurface(); void initViewport(); @@ -280,6 +282,7 @@ public: virtual void logMessage(LogMessageType::Type type, const char *message); virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); + virtual Common::String getSystemLanguage() const; }; #endif diff --git a/backends/platform/android/android.mk b/backends/platform/android/android.mk index cb39f8acfe..01ebf73a81 100644 --- a/backends/platform/android/android.mk +++ b/backends/platform/android/android.mk @@ -22,6 +22,8 @@ JAVA_FILES_GEN = \ PATH_DIST = $(srcdir)/dists/android PATH_RESOURCES = $(PATH_DIST)/res +PORT_DISTFILES = $(PATH_DIST)/README.Android + RESOURCES = \ $(PATH_RESOURCES)/values/strings.xml \ $(PATH_RESOURCES)/layout/main.xml \ @@ -178,7 +180,7 @@ androidtest: $(APK_MAIN) $(APK_PLUGINS) androiddistdebug: all $(MKDIR) debug $(CP) $(APK_MAIN) $(APK_PLUGINS) debug/ - for i in $(DIST_FILES_DOCS); do \ + for i in $(DIST_FILES_DOCS) $(PORT_DISTFILES); do \ sed 's/$$/\r/' < $$i > debug/`basename $$i`.txt; \ done diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp index 5fc10b2161..c969068d70 100644 --- a/backends/platform/android/events.cpp +++ b/backends/platform/android/events.cpp @@ -352,14 +352,20 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3, } if (arg2 < 1 || arg2 > ARRAYSIZE(jkeymap)) { - LOGE("received invalid keycode: %d (%d)", arg2, arg3); - return; + if (arg3 < 1) { + LOGE("received invalid keycode: %d (%d)", arg2, arg3); + return; + } else { + // lets bet on the ascii code + e.kbd.keycode = Common::KEYCODE_INVALID; + } + } else { + e.kbd.keycode = jkeymap[arg2]; } if (arg5 > 0) e.synthetic = true; - e.kbd.keycode = jkeymap[arg2]; e.kbd.ascii = arg3; if (arg4 & JMETA_SHIFT) |