|
@@ -6,6 +6,7 @@ using Android.App;
|
|
|
using Android.Content.PM;
|
|
|
using Android.OS;
|
|
|
using Android.Content;
|
|
|
+using Android.Runtime;
|
|
|
using Android.Views;
|
|
|
using InABox.Mobile;
|
|
|
using InABox.Mobile.Android;
|
|
@@ -61,6 +62,7 @@ namespace PRS.Mobile.Droid
|
|
|
|
|
|
AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
|
|
|
TaskScheduler.UnobservedTaskException += TaskSchedulerOnUnobservedTaskException;
|
|
|
+ AndroidEnvironment.UnhandledExceptionRaiser += AndroidEnvironmentUnhandledException;
|
|
|
|
|
|
CheckPermissions();
|
|
|
|
|
@@ -167,12 +169,20 @@ namespace PRS.Mobile.Droid
|
|
|
private static void TaskSchedulerOnUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs args)
|
|
|
{
|
|
|
LogUnhandledException("TaskScheduler", args.Exception?.GetType(), args.Exception);
|
|
|
+ args.SetObserved();
|
|
|
}
|
|
|
|
|
|
private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs args)
|
|
|
{
|
|
|
LogUnhandledException("CurrentDomain", args.ExceptionObject?.GetType(), args.ExceptionObject);
|
|
|
}
|
|
|
+
|
|
|
+ private void AndroidEnvironmentUnhandledException(object sender, RaiseThrowableEventArgs args)
|
|
|
+ {
|
|
|
+ LogUnhandledException("CurrentDomain", args.Exception?.GetType(), args.Exception);
|
|
|
+ args.Handled = true;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private static void LogUnhandledException(String source, Type type, object exceptionobject)
|
|
|
{
|