mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-30 19:04:54 +01:00
Add privacy setting to disable personalized learning by the keyboard
This commit is contained in:
parent
d0bff7495d
commit
79e4a435da
1
changelog.d/6633.feature
Normal file
1
changelog.d/6633.feature
Normal file
@ -0,0 +1 @@
|
||||
Add privacy setting to disable personalized learning by the keyboard
|
@ -2578,6 +2578,9 @@
|
||||
<string name="settings_security_prevent_screenshots_title">Prevent screenshots of the application</string>
|
||||
<string name="settings_security_prevent_screenshots_summary">Enabling this setting adds the FLAG_SECURE to all Activities. Restart the application for the change to take effect.</string>
|
||||
|
||||
<string name="settings_security_incognito_keyboard_title">Incognito keyboard</string>
|
||||
<string name="settings_security_incognito_keyboard_summary">Request that the keyboard should not update any personalized data such as typing history and dictionary based on what the user typed. Some keyboards may not respect this setting.</string>
|
||||
|
||||
<string name="error_saving_media_file">Could not save media file</string>
|
||||
<string name="change_password_summary">Set a new account password…</string>
|
||||
|
||||
|
@ -1536,6 +1536,8 @@ class TimelineFragment :
|
||||
|
||||
observerUserTyping()
|
||||
|
||||
composerEditText.setUseIncognitoKeyboard(vectorPreferences.useIncognitoKeyboard())
|
||||
|
||||
if (vectorPreferences.sendMessageWithEnter()) {
|
||||
// imeOptions="actionSend" only works with single line, so we remove multiline inputType
|
||||
composerEditText.inputType = composerEditText.inputType and EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE.inv()
|
||||
|
@ -79,6 +79,11 @@ class ComposerEditText @JvmOverloads constructor(
|
||||
return ic
|
||||
}
|
||||
|
||||
/** Set whether the keyboard should disable personalized learning. */
|
||||
fun setUseIncognitoKeyboard(useIncognitoKeyboard: Boolean) {
|
||||
imeOptions = if (useIncognitoKeyboard) imeOptions or INCOGNITO_KEYBOARD_IME else imeOptions and INCOGNITO_KEYBOARD_IME.inv()
|
||||
}
|
||||
|
||||
init {
|
||||
addTextChangedListener(
|
||||
object : SimpleTextWatcher() {
|
||||
@ -116,4 +121,8 @@ class ComposerEditText @JvmOverloads constructor(
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val INCOGNITO_KEYBOARD_IME = EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING
|
||||
}
|
||||
}
|
||||
|
@ -87,6 +87,7 @@ class VectorPreferences @Inject constructor(
|
||||
const val SETTINGS_INTEGRATION_MANAGER_UI_URL_KEY = "SETTINGS_INTEGRATION_MANAGER_UI_URL_KEY"
|
||||
const val SETTINGS_SECURE_MESSAGE_RECOVERY_PREFERENCE_KEY = "SETTINGS_SECURE_MESSAGE_RECOVERY_PREFERENCE_KEY"
|
||||
const val SETTINGS_PERSISTED_SPACE_BACKSTACK = "SETTINGS_PERSISTED_SPACE_BACKSTACK"
|
||||
const val SETTINGS_SECURITY_INCOGNITO_KEYBOARD_PREFERENCE_KEY = "SETTINGS_SECURITY_INCOGNITO_KEYBOARD_PREFERENCE_KEY"
|
||||
|
||||
const val SETTINGS_CRYPTOGRAPHY_HS_ADMIN_DISABLED_E2E_DEFAULT = "SETTINGS_CRYPTOGRAPHY_HS_ADMIN_DISABLED_E2E_DEFAULT"
|
||||
// const val SETTINGS_SECURE_BACKUP_RESET_PREFERENCE_KEY = "SETTINGS_SECURE_BACKUP_RESET_PREFERENCE_KEY"
|
||||
@ -288,6 +289,7 @@ class VectorPreferences @Inject constructor(
|
||||
|
||||
SETTINGS_USE_RAGE_SHAKE_KEY,
|
||||
SETTINGS_SECURITY_USE_FLAG_SECURE,
|
||||
SETTINGS_SECURITY_INCOGNITO_KEYBOARD_PREFERENCE_KEY,
|
||||
|
||||
ShortcutsHandler.SHARED_PREF_KEY,
|
||||
)
|
||||
@ -969,6 +971,11 @@ class VectorPreferences @Inject constructor(
|
||||
return defaultPrefs.getBoolean(SETTINGS_SECURITY_USE_FLAG_SECURE, false)
|
||||
}
|
||||
|
||||
/** Whether the keyboard should disable personalized learning. */
|
||||
fun useIncognitoKeyboard(): Boolean {
|
||||
return defaultPrefs.getBoolean(SETTINGS_SECURITY_INCOGNITO_KEYBOARD_PREFERENCE_KEY, false)
|
||||
}
|
||||
|
||||
/**
|
||||
* The user enable protecting app access with pin code.
|
||||
* Currently we use the pin code store to know if the pin is enabled, so this is not used
|
||||
|
@ -141,6 +141,12 @@
|
||||
android:summary="@string/settings_security_application_protection_summary"
|
||||
android:title="@string/settings_security_application_protection_title" />
|
||||
|
||||
<im.vector.app.core.preference.VectorSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="SETTINGS_SECURITY_INCOGNITO_KEYBOARD_PREFERENCE_KEY"
|
||||
android:summary="@string/settings_security_incognito_keyboard_summary"
|
||||
android:title="@string/settings_security_incognito_keyboard_title" />
|
||||
|
||||
<im.vector.app.core.preference.VectorSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="SETTINGS_SECURITY_USE_FLAG_SECURE"
|
||||
|
Loading…
x
Reference in New Issue
Block a user