mirror of
https://github.com/bitwarden/mobile
synced 2025-12-30 15:13:24 +00:00
log any exceptions
This commit is contained in:
@@ -23,6 +23,7 @@ namespace Bit.Android
|
|||||||
private const string SystemUiPackage = "com.android.systemui";
|
private const string SystemUiPackage = "com.android.systemui";
|
||||||
private const string BitwardenPackage = "com.x8bit.bitwarden";
|
private const string BitwardenPackage = "com.x8bit.bitwarden";
|
||||||
private const string BitwardenWebsite = "bitwarden.com";
|
private const string BitwardenWebsite = "bitwarden.com";
|
||||||
|
private const string BitwardenAccessibilityTag = "bw_access";
|
||||||
|
|
||||||
private static Dictionary<string, Browser> SupportedBrowsers => new List<Browser>
|
private static Dictionary<string, Browser> SupportedBrowsers => new List<Browser>
|
||||||
{
|
{
|
||||||
@@ -73,6 +74,12 @@ namespace Bit.Android
|
|||||||
_appSettings = Resolver.Resolve<IAppSettingsService>();
|
_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)
|
public override void OnAccessibilityEvent(AccessibilityEvent e)
|
||||||
{
|
{
|
||||||
var powerManager = (PowerManager)GetSystemService(PowerService);
|
var powerManager = (PowerManager)GetSystemService(PowerService);
|
||||||
@@ -84,7 +91,7 @@ namespace Bit.Android
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var root = RootInActiveWindow;
|
var root = RootInActiveWindow;
|
||||||
@@ -207,7 +214,10 @@ namespace Bit.Android
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
// Suppress exceptions so that service doesn't crash
|
// Suppress exceptions so that service doesn't crash
|
||||||
catch { }
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
Log("Exception occurred: " + ex.Message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnInterrupt()
|
public override void OnInterrupt()
|
||||||
|
|||||||
Reference in New Issue
Block a user