- fix one NPE

- outdated server warning toggable for brander

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2018-06-20 09:52:44 +02:00
parent 87379285aa
commit f592845cca
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
3 changed files with 16 additions and 10 deletions

View file

@ -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);
}

View file

@ -357,10 +357,13 @@ 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());
int lastSeenVersion = arbitraryDataProvider.getIntegerValue(account,
WhatsNewActivity.KEY_LAST_SEEN_VERSION_CODE);
if (MainApp.getVersionCode() > lastSeenVersion) {
OwnCloudVersion serverVersion = AccountUtils.getServerVersionForAccount(account, this);
@ -373,6 +376,7 @@ public class FileDisplayActivity extends HookActivity
String.valueOf(MainApp.getVersionCode()));
}
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[],

View file

@ -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>