mirror of
https://github.com/xenia-project/xenia.git
synced 2026-04-04 14:17:24 +00:00
[Base] Android error reporting via SIGABRT/RuntimeException
This commit is contained in:
parent
c5e3332640
commit
d2ef8d3300
5 changed files with 71 additions and 7 deletions
|
|
@ -0,0 +1,21 @@
|
|||
package jp.xenia;
|
||||
|
||||
/**
|
||||
* Base class for all unchecked exceptions thrown by the Xenia project components.
|
||||
*/
|
||||
public class XeniaRuntimeException extends RuntimeException {
|
||||
public XeniaRuntimeException() {
|
||||
}
|
||||
|
||||
public XeniaRuntimeException(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public XeniaRuntimeException(String name, Throwable cause) {
|
||||
super(name, cause);
|
||||
}
|
||||
|
||||
public XeniaRuntimeException(Exception cause) {
|
||||
super(cause);
|
||||
}
|
||||
}
|
||||
|
|
@ -3,11 +3,10 @@ package jp.xenia.emulator;
|
|||
import android.app.Activity;
|
||||
import android.content.res.AssetManager;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import jp.xenia.XeniaRuntimeException;
|
||||
|
||||
public abstract class WindowedAppActivity extends Activity {
|
||||
private static final String TAG = "WindowedAppActivity";
|
||||
|
||||
static {
|
||||
// TODO(Triang3l): Move all demos to libxenia.so.
|
||||
System.loadLibrary("xenia-ui-window-vulkan-demo");
|
||||
|
|
@ -26,11 +25,12 @@ public abstract class WindowedAppActivity extends Activity {
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
mAppContext = initializeWindowedAppOnCreateNative(getWindowedAppIdentifier(), getAssets());
|
||||
final String windowedAppIdentifier = getWindowedAppIdentifier();
|
||||
mAppContext = initializeWindowedAppOnCreateNative(windowedAppIdentifier, getAssets());
|
||||
if (mAppContext == 0) {
|
||||
Log.e(TAG, "Error initializing the windowed app");
|
||||
finish();
|
||||
return;
|
||||
throw new XeniaRuntimeException(
|
||||
"Error initializing the windowed app " + windowedAppIdentifier);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue