mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-06 06:40:17 +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.util.Log;
|
||||||
import android.view.inputmethod.EditorInfo;
|
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.common.StringUtils;
|
||||||
import org.dslul.openboard.inputmethod.latin.utils.InputTypeUtils;
|
import org.dslul.openboard.inputmethod.latin.utils.InputTypeUtils;
|
||||||
|
|
||||||
|
@ -104,9 +106,9 @@ public final class InputAttributes {
|
||||||
// TODO: Have a helper method in InputTypeUtils
|
// TODO: Have a helper method in InputTypeUtils
|
||||||
// Make sure that passwords are not displayed in {@link SuggestionStripView}.
|
// Make sure that passwords are not displayed in {@link SuggestionStripView}.
|
||||||
final boolean shouldSuppressSuggestions = mIsPasswordField
|
final boolean shouldSuppressSuggestions = mIsPasswordField
|
||||||
|| InputTypeUtils.isEmailVariation(variation)
|
//|| InputTypeUtils.isEmailVariation(variation)
|
||||||
|| InputType.TYPE_TEXT_VARIATION_URI == variation
|
//|| InputType.TYPE_TEXT_VARIATION_URI == variation
|
||||||
|| InputType.TYPE_TEXT_VARIATION_FILTER == variation
|
//|| InputType.TYPE_TEXT_VARIATION_FILTER == variation
|
||||||
//|| flagNoSuggestions
|
//|| flagNoSuggestions
|
||||||
|| flagAutoComplete;
|
|| flagAutoComplete;
|
||||||
mShouldShowSuggestions = !shouldSuppressSuggestions;
|
mShouldShowSuggestions = !shouldSuppressSuggestions;
|
||||||
|
@ -142,7 +144,8 @@ public final class InputAttributes {
|
||||||
&& InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS != variation
|
&& InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS != variation
|
||||||
&& InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD != 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() {
|
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.
|
// 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
|
// That's to avoid unintended additions in some sensitive fields, or fields that
|
||||||
// expect to receive non-words.
|
// expect to receive non-words.
|
||||||
if (!settingsValues.mAutoCorrectionEnabledPerUserSettings) return;
|
if (!settingsValues.mAutoCorrectionEnabledPerUserSettings
|
||||||
|
|| settingsValues.mIncognitoModeEnabled)
|
||||||
|
return;
|
||||||
if (mConnection.hasSlowInputConnection()) {
|
if (mConnection.hasSlowInputConnection()) {
|
||||||
// Since we don't unlearn when the user backspaces on a slow InputConnection,
|
// 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.
|
// 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 float mPlausibilityThreshold;
|
||||||
public final boolean mAutoCorrectionEnabledPerUserSettings;
|
public final boolean mAutoCorrectionEnabledPerUserSettings;
|
||||||
private final boolean mSuggestionsEnabledPerUserSettings;
|
private final boolean mSuggestionsEnabledPerUserSettings;
|
||||||
|
public final boolean mIncognitoModeEnabled;
|
||||||
private final AsyncResultHolder<AppWorkaroundsUtils> mAppWorkarounds;
|
private final AsyncResultHolder<AppWorkaroundsUtils> mAppWorkarounds;
|
||||||
|
|
||||||
// Debug settings
|
// Debug settings
|
||||||
|
@ -181,10 +182,11 @@ public class SettingsValues {
|
||||||
null /* default */);
|
null /* default */);
|
||||||
mGestureFloatingPreviewTextEnabled = !mInputAttributes.mDisableGestureFloatingPreviewText
|
mGestureFloatingPreviewTextEnabled = !mInputAttributes.mDisableGestureFloatingPreviewText
|
||||||
&& prefs.getBoolean(Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true);
|
&& prefs.getBoolean(Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true);
|
||||||
mAutoCorrectionEnabledPerUserSettings = mAutoCorrectEnabled
|
mAutoCorrectionEnabledPerUserSettings = mAutoCorrectEnabled;
|
||||||
&& !mInputAttributes.mInputTypeNoAutoCorrect;
|
//&& !mInputAttributes.mInputTypeNoAutoCorrect;
|
||||||
mSuggestionsEnabledPerUserSettings = !mInputAttributes.mNoLearning &&
|
mSuggestionsEnabledPerUserSettings = !mInputAttributes.mIsPasswordField &&
|
||||||
readSuggestionsEnabled(prefs);
|
readSuggestionsEnabled(prefs);
|
||||||
|
mIncognitoModeEnabled = mInputAttributes.mNoLearning;
|
||||||
mIsInternal = Settings.isInternal(prefs);
|
mIsInternal = Settings.isInternal(prefs);
|
||||||
mHasCustomKeyPreviewAnimationParams = prefs.getBoolean(
|
mHasCustomKeyPreviewAnimationParams = prefs.getBoolean(
|
||||||
DebugSettings.PREF_HAS_CUSTOM_KEY_PREVIEW_ANIMATION_PARAMS, false);
|
DebugSettings.PREF_HAS_CUSTOM_KEY_PREVIEW_ANIMATION_PARAMS, false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue