mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-02 21:02:13 +00:00
add incognito mode
This commit is contained in:
parent
6de199cbcf
commit
a6d7e2d3ac
3 changed files with 15 additions and 8 deletions
|
@ -20,6 +20,8 @@ import android.text.InputType;
|
|||
import android.util.Log;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
|
||||
import androidx.core.view.inputmethod.EditorInfoCompat;
|
||||
|
||||
import org.dslul.openboard.inputmethod.latin.common.StringUtils;
|
||||
import org.dslul.openboard.inputmethod.latin.utils.InputTypeUtils;
|
||||
|
||||
|
@ -104,9 +106,9 @@ public final class InputAttributes {
|
|||
// TODO: Have a helper method in InputTypeUtils
|
||||
// Make sure that passwords are not displayed in {@link SuggestionStripView}.
|
||||
final boolean shouldSuppressSuggestions = mIsPasswordField
|
||||
|| InputTypeUtils.isEmailVariation(variation)
|
||||
|| InputType.TYPE_TEXT_VARIATION_URI == variation
|
||||
|| InputType.TYPE_TEXT_VARIATION_FILTER == variation
|
||||
//|| InputTypeUtils.isEmailVariation(variation)
|
||||
//|| InputType.TYPE_TEXT_VARIATION_URI == variation
|
||||
//|| InputType.TYPE_TEXT_VARIATION_FILTER == variation
|
||||
//|| flagNoSuggestions
|
||||
|| flagAutoComplete;
|
||||
mShouldShowSuggestions = !shouldSuppressSuggestions;
|
||||
|
@ -142,7 +144,8 @@ public final class InputAttributes {
|
|||
&& InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS != variation
|
||||
&& InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD != variation;
|
||||
|
||||
mNoLearning = (editorInfo.imeOptions & EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING) != 0;
|
||||
|
||||
mNoLearning = flagNoSuggestions || (editorInfo.imeOptions & EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING) != 0;
|
||||
}
|
||||
|
||||
public boolean isTypeNull() {
|
||||
|
|
|
@ -1425,7 +1425,9 @@ public final class InputLogic {
|
|||
// If correction is not enabled, we don't add words to the user history dictionary.
|
||||
// That's to avoid unintended additions in some sensitive fields, or fields that
|
||||
// expect to receive non-words.
|
||||
if (!settingsValues.mAutoCorrectionEnabledPerUserSettings) return;
|
||||
if (!settingsValues.mAutoCorrectionEnabledPerUserSettings
|
||||
|| settingsValues.mIncognitoModeEnabled)
|
||||
return;
|
||||
if (mConnection.hasSlowInputConnection()) {
|
||||
// Since we don't unlearn when the user backspaces on a slow InputConnection,
|
||||
// turn off learning to guard against adding typos that the user later deletes.
|
||||
|
|
|
@ -106,6 +106,7 @@ public class SettingsValues {
|
|||
public final float mPlausibilityThreshold;
|
||||
public final boolean mAutoCorrectionEnabledPerUserSettings;
|
||||
private final boolean mSuggestionsEnabledPerUserSettings;
|
||||
public final boolean mIncognitoModeEnabled;
|
||||
private final AsyncResultHolder<AppWorkaroundsUtils> mAppWorkarounds;
|
||||
|
||||
// Debug settings
|
||||
|
@ -181,10 +182,11 @@ public class SettingsValues {
|
|||
null /* default */);
|
||||
mGestureFloatingPreviewTextEnabled = !mInputAttributes.mDisableGestureFloatingPreviewText
|
||||
&& prefs.getBoolean(Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true);
|
||||
mAutoCorrectionEnabledPerUserSettings = mAutoCorrectEnabled
|
||||
&& !mInputAttributes.mInputTypeNoAutoCorrect;
|
||||
mSuggestionsEnabledPerUserSettings = !mInputAttributes.mNoLearning &&
|
||||
mAutoCorrectionEnabledPerUserSettings = mAutoCorrectEnabled;
|
||||
//&& !mInputAttributes.mInputTypeNoAutoCorrect;
|
||||
mSuggestionsEnabledPerUserSettings = !mInputAttributes.mIsPasswordField &&
|
||||
readSuggestionsEnabled(prefs);
|
||||
mIncognitoModeEnabled = mInputAttributes.mNoLearning;
|
||||
mIsInternal = Settings.isInternal(prefs);
|
||||
mHasCustomKeyPreviewAnimationParams = prefs.getBoolean(
|
||||
DebugSettings.PREF_HAS_CUSTOM_KEY_PREVIEW_ANIMATION_PARAMS, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue