diff --git a/src/Android/Android.csproj b/src/Android/Android.csproj index 109b2dcbf..7f25fab87 100644 --- a/src/Android/Android.csproj +++ b/src/Android/Android.csproj @@ -746,6 +746,21 @@ + + + + + + + + + + + + + + + diff --git a/src/Android/AutofillActivity.cs b/src/Android/AutofillActivity.cs index 3022fd963..f35a6eb3d 100644 --- a/src/Android/AutofillActivity.cs +++ b/src/Android/AutofillActivity.cs @@ -22,6 +22,7 @@ namespace Bit.Android _lastQueriedUri = Intent.GetStringExtra("uri"); var intent = new Intent(this, typeof(MainActivity)); + intent.SetFlags(ActivityFlags.NewTask | ActivityFlags.ClearTop); intent.PutExtra("uri", _lastQueriedUri); StartActivityForResult(intent, 123); } diff --git a/src/Android/AutofillService.cs b/src/Android/AutofillService.cs index c79d5a32f..4792159e7 100644 --- a/src/Android/AutofillService.cs +++ b/src/Android/AutofillService.cs @@ -132,36 +132,15 @@ namespace Bit.Android intent.SetFlags(ActivityFlags.NewTask | ActivityFlags.SingleTop | ActivityFlags.ClearTop); var pendingIntent = PendingIntent.GetActivity(this, 0, intent, PendingIntentFlags.UpdateCurrent); - var targetName = uri; - if(uri.StartsWith(AndroidAppProtocol)) - { - var packageName = uri.Substring(AndroidAppProtocol.Length); - try - { - var appInfo = PackageManager.GetApplicationInfo(packageName, 0); - targetName = appInfo != null ? PackageManager.GetApplicationLabel(appInfo) : packageName; - } - catch - { - targetName = packageName; - } - } - else - { - //targetName = KeePassLib.Utility.UrlUtil.GetHost(uri); - } - - var builder = new Notification.Builder(this); - //TODO icon - //TODO plugin icon - builder.SetSmallIcon(Resource.Drawable.icon) + builder.SetSmallIcon(Resource.Drawable.notification_sm) .SetContentText("Tap this notification to autofill a login from your bitwarden vault.") .SetContentTitle("bitwarden Autofill Service") .SetWhen(Java.Lang.JavaSystem.CurrentTimeMillis()) .SetTicker("Tap this notification to autofill a login from your bitwarden vault.") .SetVisibility(NotificationVisibility.Secret) .SetContentIntent(pendingIntent); + var notificationManager = (NotificationManager)GetSystemService(NotificationService); notificationManager.Notify(AutoFillNotificationId, builder.Build()); } diff --git a/src/Android/Resources/Resource.Designer.cs b/src/Android/Resources/Resource.Designer.cs index 80193de6a..074cb2131 100644 --- a/src/Android/Resources/Resource.Designer.cs +++ b/src/Android/Resources/Resource.Designer.cs @@ -2727,41 +2727,44 @@ namespace Bit.Android // aapt resource value: 0x7f0200df public const int mr_ic_play_light = 2130837727; - // aapt resource value: 0x7f0200eb - public const int notification_template_icon_bg = 2130837739; - // aapt resource value: 0x7f0200e0 - public const int plus = 2130837728; + public const int notification_sm = 2130837728; + + // aapt resource value: 0x7f0200ec + public const int notification_template_icon_bg = 2130837740; // aapt resource value: 0x7f0200e1 - public const int refresh = 2130837729; + public const int plus = 2130837729; // aapt resource value: 0x7f0200e2 - public const int roundedbg = 2130837730; + public const int refresh = 2130837730; // aapt resource value: 0x7f0200e3 - public const int roundedbgdark = 2130837731; + public const int roundedbg = 2130837731; // aapt resource value: 0x7f0200e4 - public const int splash_screen = 2130837732; + public const int roundedbgdark = 2130837732; // aapt resource value: 0x7f0200e5 - public const int star = 2130837733; + public const int splash_screen = 2130837733; // aapt resource value: 0x7f0200e6 - public const int star_selected = 2130837734; + public const int star = 2130837734; // aapt resource value: 0x7f0200e7 - public const int tools = 2130837735; + public const int star_selected = 2130837735; // aapt resource value: 0x7f0200e8 - public const int tools_selected = 2130837736; + public const int tools = 2130837736; // aapt resource value: 0x7f0200e9 - public const int upload = 2130837737; + public const int tools_selected = 2130837737; // aapt resource value: 0x7f0200ea - public const int user = 2130837738; + public const int upload = 2130837738; + + // aapt resource value: 0x7f0200eb + public const int user = 2130837739; static Drawable() { diff --git a/src/Android/Resources/drawable-hdpi/notification_sm.png b/src/Android/Resources/drawable-hdpi/notification_sm.png new file mode 100644 index 000000000..a893ed8bf Binary files /dev/null and b/src/Android/Resources/drawable-hdpi/notification_sm.png differ diff --git a/src/Android/Resources/drawable-xhdpi/notification_sm.png b/src/Android/Resources/drawable-xhdpi/notification_sm.png new file mode 100644 index 000000000..dc65e1730 Binary files /dev/null and b/src/Android/Resources/drawable-xhdpi/notification_sm.png differ diff --git a/src/Android/Resources/drawable-xxhdpi/notification_sm.png b/src/Android/Resources/drawable-xxhdpi/notification_sm.png new file mode 100644 index 000000000..5d21ebb89 Binary files /dev/null and b/src/Android/Resources/drawable-xxhdpi/notification_sm.png differ diff --git a/src/Android/Resources/drawable-xxxhdpi/notification_sm.png b/src/Android/Resources/drawable-xxxhdpi/notification_sm.png new file mode 100644 index 000000000..760eff254 Binary files /dev/null and b/src/Android/Resources/drawable-xxxhdpi/notification_sm.png differ diff --git a/src/Android/Resources/drawable/notification_sm.png b/src/Android/Resources/drawable/notification_sm.png new file mode 100644 index 000000000..86b7c130a Binary files /dev/null and b/src/Android/Resources/drawable/notification_sm.png differ