mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-21 12:39:58 +01:00
code reformatting
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
08f5274af9
commit
cd44de757c
@ -265,12 +265,16 @@ class NextcloudTalkApplication : MultiDexApplication(), LifecycleObserver {
|
||||
val database = object : SqlCipherDatabaseSource(
|
||||
this,
|
||||
Models.DEFAULT,
|
||||
this.resources.getString(R.string.nc_app_product_name).lowercase(Locale.getDefault())
|
||||
.replace(" ", "_").trim { it <= ' ' } + ".sqlite",
|
||||
this
|
||||
.resources
|
||||
.getString(R.string.nc_app_product_name)
|
||||
.lowercase(Locale.getDefault())
|
||||
.replace(" ", "_")
|
||||
.trim { it <= ' ' } +
|
||||
".sqlite",
|
||||
this.getString(R.string.nc_talk_database_encryption_key),
|
||||
DatabaseModule.DB_VERSION
|
||||
) {
|
||||
|
||||
override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
|
||||
checkAndUpdateCipherMigrationStatus(newVersion, appPreferences)
|
||||
super.onUpgrade(db, oldVersion, newVersion)
|
||||
|
@ -1,9 +1,10 @@
|
||||
/*
|
||||
*
|
||||
* Nextcloud Talk application
|
||||
*
|
||||
* @author Andy Scherzinger
|
||||
* @author Mario Danic
|
||||
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
|
||||
* Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
|
||||
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -44,24 +45,33 @@ public class DatabaseModule {
|
||||
@Provides
|
||||
@Singleton
|
||||
public SqlCipherDatabaseSource provideSqlCipherDatabaseSource(@NonNull final Context context) {
|
||||
return new SqlCipherDatabaseSource(context, Models.DEFAULT,
|
||||
context.getResources().getString(R.string.nc_app_product_name).toLowerCase()
|
||||
.replace(" ", "_").trim() + ".sqlite",
|
||||
context.getString(R.string.nc_talk_database_encryption_key), DB_VERSION);
|
||||
return new SqlCipherDatabaseSource(
|
||||
context,
|
||||
Models.DEFAULT,
|
||||
context
|
||||
.getResources()
|
||||
.getString(R.string.nc_app_product_name)
|
||||
.toLowerCase()
|
||||
.replace(" ", "_")
|
||||
.trim()
|
||||
+ ".sqlite",
|
||||
context.getString(R.string.nc_talk_database_encryption_key),
|
||||
DB_VERSION);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
public ReactiveEntityStore<Persistable> provideDataStore(@NonNull final SqlCipherDatabaseSource sqlCipherDatabaseSource) {
|
||||
public ReactiveEntityStore<Persistable> provideDataStore(
|
||||
@NonNull final SqlCipherDatabaseSource sqlCipherDatabaseSource) {
|
||||
final Configuration configuration = sqlCipherDatabaseSource.getConfiguration();
|
||||
return ReactiveSupport.toReactiveStore(new EntityDataStore<Persistable>(configuration));
|
||||
return ReactiveSupport.toReactiveStore(new EntityDataStore<>(configuration));
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
public AppPreferences providePreferences(@NonNull final Context poContext) {
|
||||
AppPreferences p = StoreBox.create(poContext, AppPreferences.class);
|
||||
p.removeLinkPreviews();
|
||||
return p;
|
||||
AppPreferences preferences = StoreBox.create(poContext, AppPreferences.class);
|
||||
preferences.removeLinkPreviews();
|
||||
return preferences;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user