1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-10-06 05:17:59 +02:00

log any exceptions

This commit is contained in:
Kyle Spearrin 2018-02-01 15:54:39 -05:00
parent a8eeb12325
commit 854ef7e645

View File

@ -23,6 +23,7 @@ namespace Bit.Android
private const string SystemUiPackage = "com.android.systemui";
private const string BitwardenPackage = "com.x8bit.bitwarden";
private const string BitwardenWebsite = "bitwarden.com";
private const string BitwardenAccessibilityTag = "bw_access";
private static Dictionary<string, Browser> SupportedBrowsers => new List<Browser>
{
@ -73,6 +74,12 @@ namespace Bit.Android
_appSettings = Resolver.Resolve<IAppSettingsService>();
}
private void Log(string message)
{
global::Android.Util.Log.WriteLine(global::Android.Util.LogPriority.Info,
BitwardenAccessibilityTag, message);
}
public override void OnAccessibilityEvent(AccessibilityEvent e)
{
var powerManager = (PowerManager)GetSystemService(PowerService);
@ -207,7 +214,10 @@ namespace Bit.Android
*/
}
// Suppress exceptions so that service doesn't crash
catch { }
catch(Exception ex)
{
Log("Exception occurred: " + ex.Message);
}
}
public override void OnInterrupt()