Deprecation notice for Android versions below 5.1

Closes #535
This commit is contained in:
Jakob Nixdorf 2020-05-07 20:51:07 +02:00
parent 8c01eb54b8
commit 1b2a036704
No known key found for this signature in database
GPG key ID: BE99BF86574A7DBC
4 changed files with 35 additions and 0 deletions

View file

@ -131,6 +131,21 @@ public class MainActivity extends BaseActivity
startActivityForResult(introIntent, Constants.INTENT_MAIN_INTRO);
}
private void showAndroid21DeprecationNotice() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.dialog_title_android21_depreaction)
.setMessage(R.string.dialog_msg_android21_deprecation)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
settings.setAndroid21DeprecationNoticeShown(true);
}
})
.setCancelable(false)
.create()
.show();
}
public void authenticate(int messageId) {
AuthMethod authMethod = settings.getAuthMethod();
@ -207,6 +222,10 @@ public class MainActivity extends BaseActivity
showFirstTimeWarning();
}
if (!settings.getAndroid21DeprecationNoticeShown()) {
showAndroid21DeprecationNotice();
}
speedDial = findViewById(R.id.speedDial);
speedDial.inflate(R.menu.menu_fab);

View file

@ -376,6 +376,14 @@ public class Settings {
setBoolean(R.string.settings_key_security_backup_warning, value);
}
public boolean getAndroid21DeprecationNoticeShown() {
return getBoolean(R.string.settings_key_android21_deprecation_notice_shown, false);
}
public void setAndroid21DeprecationNoticeShown(boolean value) {
setBoolean(R.string.settings_key_android21_deprecation_notice_shown, value);
}
public boolean getSpecialFeatures() {
return getBoolean(R.string.settings_key_special_features, false);
}

View file

@ -63,6 +63,7 @@
<string name="settings_key_clear_keystore" translatable="false">pref_clear_keystore</string>
<string name="settings_key_last_used_dialog_shown" translatable="false">pref_last_used_dialog_shown</string>
<string name="settings_key_android21_deprecation_notice_shown" translatable="false">pref_android21_deprecation_notice_shown</string>
<!-- Default values -->
<integer name="settings_default_tap_to_reveal_timeout">30</integer>

View file

@ -85,6 +85,7 @@
<string name="dialog_title_used_tokens">Tokens usage</string>
<string name="dialog_title_keystore_error">KeyStore error</string>
<string name="dialog_title_qr_code">QR Code</string>
<string name="dialog_title_android21_depreaction">Deprecation notice</string>
<string name="dialog_title_enter_password">Enter password</string>
@ -102,6 +103,12 @@
<b>Any entries that are added will get lost.</b>\n\nTo still be able to use andOTP you can go
to the <b>Settings</b> and switch the <b>Database encryption</b> to <b>Password / PIN</b>.</string>
<string name="dialog_msg_android21_deprecation">This will be the last version of andOTP to
support Android versions below 5.1 (Lollipop). The increased effort required to maintain a
separate storage implementation just for those older versions as well as their low market
shares make a continued support infeasible for our small team.\n\nThis message will not be
shown again.</string>
<!-- Shortcuts -->
<string name="shortcut_name_scan_qr">Scan QR code</string>
<string name="shortcut_name_import_qr">Import QR code</string>