mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 15:15:34 +03:00
do not attempt autofill on android 4.4
This commit is contained in:
parent
d4f3577f5e
commit
3a5378d201
5 changed files with 25 additions and 5 deletions
|
@ -70,7 +70,11 @@ namespace Bit.Android
|
|||
public override void OnAccessibilityEvent(AccessibilityEvent e)
|
||||
{
|
||||
var powerManager = (PowerManager)GetSystemService(PowerService);
|
||||
if(!powerManager.IsInteractive)
|
||||
if(Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch && !powerManager.IsInteractive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if(Build.VERSION.SdkInt < BuildVersionCodes.Lollipop && !powerManager.IsScreenOn)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -337,11 +341,15 @@ namespace Bit.Android
|
|||
intent.SetFlags(ActivityFlags.NewTask | ActivityFlags.SingleTop | ActivityFlags.ClearTop);
|
||||
var pendingIntent = PendingIntent.GetActivity(this, 0, intent, PendingIntentFlags.UpdateCurrent);
|
||||
|
||||
var notificationContent = Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch ?
|
||||
App.Resources.AppResources.BitwardenAutofillServiceNotificationContent :
|
||||
App.Resources.AppResources.BitwardenAutofillServiceNotificationContentOld;
|
||||
|
||||
var builder = new Notification.Builder(this);
|
||||
builder.SetSmallIcon(Resource.Drawable.notification_sm)
|
||||
.SetContentTitle(App.Resources.AppResources.BitwardenAutofillService)
|
||||
.SetContentText(App.Resources.AppResources.BitwardenAutofillServiceNotificationContent)
|
||||
.SetTicker(App.Resources.AppResources.BitwardenAutofillServiceNotificationContent)
|
||||
.SetContentText(notificationContent)
|
||||
.SetTicker(notificationContent)
|
||||
.SetWhen(now)
|
||||
.SetContentIntent(pendingIntent);
|
||||
|
||||
|
|
|
@ -205,7 +205,7 @@ namespace Bit.App.Pages
|
|||
return;
|
||||
}
|
||||
|
||||
if(Uri.StartsWith("http") && _deviceInfoService.Version < 21)
|
||||
if(_deviceInfoService.Version < 21)
|
||||
{
|
||||
MoreClickedAsync(login);
|
||||
}
|
||||
|
|
|
@ -403,7 +403,7 @@ namespace Bit.App.Pages
|
|||
}
|
||||
else if(selection == AppResources.Autofill)
|
||||
{
|
||||
if(Uri.StartsWith("http") && _deviceInfoService.Version < 21)
|
||||
if(_deviceInfoService.Version < 21)
|
||||
{
|
||||
MoreClickedAsync(login);
|
||||
}
|
||||
|
|
9
src/App/Resources/AppResources.Designer.cs
generated
9
src/App/Resources/AppResources.Designer.cs
generated
|
@ -439,6 +439,15 @@ namespace Bit.App.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Tap this notification to view logins from your vault..
|
||||
/// </summary>
|
||||
public static string BitwardenAutofillServiceNotificationContentOld {
|
||||
get {
|
||||
return ResourceManager.GetString("BitwardenAutofillServiceNotificationContentOld", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Open Accessibility Settings.
|
||||
/// </summary>
|
||||
|
|
|
@ -1027,4 +1027,7 @@
|
|||
<data name="WebVaultUrl" xml:space="preserve">
|
||||
<value>Web Vault Server URL</value>
|
||||
</data>
|
||||
<data name="BitwardenAutofillServiceNotificationContentOld" xml:space="preserve">
|
||||
<value>Tap this notification to view logins from your vault.</value>
|
||||
</data>
|
||||
</root>
|
Loading…
Reference in a new issue