Merge "Don't cache resource value that depends on orientation"

main
Tadashi G. Takaoka 2012-01-15 19:27:58 -08:00 committed by Android (Google) Code Review
commit d82fd6c3cc
2 changed files with 8 additions and 3 deletions

View File

@ -1019,7 +1019,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
@Override @Override
public boolean onEvaluateFullscreenMode() { public boolean onEvaluateFullscreenMode() {
return super.onEvaluateFullscreenMode() && mSettingsValues.mUseFullScreenMode; // Reread resource value here, because this method is called by framework anytime as needed.
final boolean isFullscreenModeAllowed =
mSettingsValues.isFullscreenModeAllowed(getResources());
return super.onEvaluateFullscreenMode() && isFullscreenModeAllowed;
} }
@Override @Override

View File

@ -41,7 +41,6 @@ public class SettingsValues {
private final String mSymbolsExcludedFromWordSeparators; private final String mSymbolsExcludedFromWordSeparators;
public final String mWordSeparators; public final String mWordSeparators;
public final CharSequence mHintToSaveText; public final CharSequence mHintToSaveText;
public final boolean mUseFullScreenMode;
// From preferences, in the same order as xml/prefs.xml: // From preferences, in the same order as xml/prefs.xml:
public final boolean mAutoCap; public final boolean mAutoCap;
@ -107,7 +106,6 @@ public class SettingsValues {
mWordSeparators = createWordSeparators(mMagicSpaceStrippers, mMagicSpaceSwappers, mWordSeparators = createWordSeparators(mMagicSpaceStrippers, mMagicSpaceSwappers,
mSymbolsExcludedFromWordSeparators, res); mSymbolsExcludedFromWordSeparators, res);
mHintToSaveText = context.getText(R.string.hint_add_to_dictionary); mHintToSaveText = context.getText(R.string.hint_add_to_dictionary);
mUseFullScreenMode = res.getBoolean(R.bool.config_use_fullscreen_mode);
// Get the settings preferences // Get the settings preferences
mAutoCap = prefs.getBoolean(Settings.PREF_AUTO_CAP, true); mAutoCap = prefs.getBoolean(Settings.PREF_AUTO_CAP, true);
@ -294,6 +292,10 @@ public class SettingsValues {
return mVoiceKeyOnMain; return mVoiceKeyOnMain;
} }
public boolean isFullscreenModeAllowed(Resources res) {
return res.getBoolean(R.bool.config_use_fullscreen_mode);
}
// Accessed from the settings interface, hence public // Accessed from the settings interface, hence public
public static float getCurrentKeypressSoundVolume(final SharedPreferences sp, public static float getCurrentKeypressSoundVolume(final SharedPreferences sp,
final Resources res) { final Resources res) {