mirror of
https://github.com/nextcloud/android.git
synced 2024-11-24 06:05:42 +03:00
- fix one NPE
- outdated server warning toggable for brander Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
87379285aa
commit
f592845cca
3 changed files with 16 additions and 10 deletions
|
@ -1419,7 +1419,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|||
mServerInfo = (GetServerInfoOperation.ServerInfo) (result.getData().get(0));
|
||||
|
||||
// show outdated warning
|
||||
if (mServerInfo.mVersion.compareTo(MainApp.OUTDATED_SERVER_VERSION) < 0) {
|
||||
if (getResources().getBoolean(R.bool.show_outdated_server_warning) &&
|
||||
mServerInfo.mVersion.compareTo(MainApp.OUTDATED_SERVER_VERSION) < 0) {
|
||||
DisplayUtils.showServerOutdatedSnackbar(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -357,20 +357,24 @@ public class FileDisplayActivity extends HookActivity
|
|||
}
|
||||
|
||||
private void checkOutdatedServer() {
|
||||
ArbitraryDataProvider arbitraryDataProvider = new ArbitraryDataProvider(getContentResolver());
|
||||
Account account = getAccount();
|
||||
|
||||
int lastSeenVersion = arbitraryDataProvider.getIntegerValue(account, WhatsNewActivity.KEY_LAST_SEEN_VERSION_CODE);
|
||||
if (getResources().getBoolean(R.bool.show_outdated_server_warning) && account != null) {
|
||||
ArbitraryDataProvider arbitraryDataProvider = new ArbitraryDataProvider(getContentResolver());
|
||||
|
||||
if (MainApp.getVersionCode() > lastSeenVersion) {
|
||||
OwnCloudVersion serverVersion = AccountUtils.getServerVersionForAccount(account, this);
|
||||
int lastSeenVersion = arbitraryDataProvider.getIntegerValue(account,
|
||||
WhatsNewActivity.KEY_LAST_SEEN_VERSION_CODE);
|
||||
|
||||
if (serverVersion.compareTo(MainApp.OUTDATED_SERVER_VERSION) < 0) {
|
||||
DisplayUtils.showServerOutdatedSnackbar(this);
|
||||
if (MainApp.getVersionCode() > lastSeenVersion) {
|
||||
OwnCloudVersion serverVersion = AccountUtils.getServerVersionForAccount(account, this);
|
||||
|
||||
if (serverVersion.compareTo(MainApp.OUTDATED_SERVER_VERSION) < 0) {
|
||||
DisplayUtils.showServerOutdatedSnackbar(this);
|
||||
}
|
||||
|
||||
arbitraryDataProvider.storeOrUpdateKeyValue(account.name, WhatsNewActivity.KEY_LAST_SEEN_VERSION_CODE,
|
||||
String.valueOf(MainApp.getVersionCode()));
|
||||
}
|
||||
|
||||
arbitraryDataProvider.storeOrUpdateKeyValue(account.name, WhatsNewActivity.KEY_LAST_SEEN_VERSION_CODE,
|
||||
String.valueOf(MainApp.getVersionCode()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
<bool name="share_via_link_feature">true</bool>
|
||||
<bool name="share_with_users_feature">true</bool>
|
||||
<bool name="show_external_links">true</bool>
|
||||
<bool name="show_outdated_server_warning">true</bool>
|
||||
|
||||
<!-- Contacts backup -->
|
||||
<bool name="contacts_backup">true</bool>
|
||||
|
|
Loading…
Reference in a new issue