mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
add FilteredPackageNames
This commit is contained in:
parent
9c365ecc48
commit
5b5385c01d
1 changed files with 18 additions and 5 deletions
|
@ -20,7 +20,6 @@ namespace Bit.Android
|
||||||
private NotificationChannel _notificationChannel;
|
private NotificationChannel _notificationChannel;
|
||||||
|
|
||||||
private const int AutoFillNotificationId = 34573;
|
private const int AutoFillNotificationId = 34573;
|
||||||
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 const string BitwardenAccessibilityTag = "bw_access";
|
||||||
|
@ -65,6 +64,14 @@ namespace Bit.Android
|
||||||
new Browser("com.duckduckgo.mobile.android", "omnibarTextInput")
|
new Browser("com.duckduckgo.mobile.android", "omnibarTextInput")
|
||||||
}.ToDictionary(n => n.PackageName);
|
}.ToDictionary(n => n.PackageName);
|
||||||
|
|
||||||
|
private static HashSet<string> FilteredPackageNames => new HashSet<string>
|
||||||
|
{
|
||||||
|
"com.google.android.googlequicksearchbox",
|
||||||
|
"com.google.android.apps.nexuslauncher",
|
||||||
|
"com.google.android.launcher",
|
||||||
|
"com.android.systemui"
|
||||||
|
};
|
||||||
|
|
||||||
private readonly IAppSettingsService _appSettings;
|
private readonly IAppSettingsService _appSettings;
|
||||||
private long _lastNotificationTime = 0;
|
private long _lastNotificationTime = 0;
|
||||||
private string _lastNotificationUri = null;
|
private string _lastNotificationUri = null;
|
||||||
|
@ -94,14 +101,20 @@ namespace Bit.Android
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log(e.PackageName + " fired event " + e.EventType);
|
if(e.PackageName.Contains("logcat"))
|
||||||
|
|
||||||
if(string.IsNullOrWhiteSpace(e?.PackageName) || e.PackageName == SystemUiPackage ||
|
|
||||||
e.PackageName.Contains("launcher"))
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(string.IsNullOrWhiteSpace(e?.PackageName) || FilteredPackageNames.Contains(e.PackageName) ||
|
||||||
|
e.PackageName.Contains("launcher"))
|
||||||
|
{
|
||||||
|
Log("FILTERED - " + e.PackageName + " fired event " + e.EventType);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log(e.PackageName + " fired event " + e.EventType);
|
||||||
|
|
||||||
var root = RootInActiveWindow;
|
var root = RootInActiveWindow;
|
||||||
if(root == null || root.PackageName != e.PackageName)
|
if(root == null || root.PackageName != e.PackageName)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue