diff options
author | 2013-10-09 05:46:15 +0000 | |
---|---|---|
committer | 2013-10-09 05:46:15 +0000 | |
commit | 83994ad66b337276c8ba18249a1c5d52540eeef3 (patch) | |
tree | 1e5f4167d065933495951bdf09d618dfcb538683 /java/src/com/android/inputmethod/latin/utils/FragmentUtils.java | |
parent | dfaec34502e214b4f6a0ce8b91ccfa57f7c8d07f (diff) | |
parent | 64f64bdf58ebcfb412c810646eb12e22b586aa87 (diff) | |
download | latinime-83994ad66b337276c8ba18249a1c5d52540eeef3.tar.gz latinime-83994ad66b337276c8ba18249a1c5d52540eeef3.tar.xz latinime-83994ad66b337276c8ba18249a1c5d52540eeef3.zip |
Merge "Fix the security related API change for PreferenceActivity"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/utils/FragmentUtils.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/utils/FragmentUtils.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/utils/FragmentUtils.java b/java/src/com/android/inputmethod/latin/utils/FragmentUtils.java new file mode 100644 index 000000000..ee2b97b2a --- /dev/null +++ b/java/src/com/android/inputmethod/latin/utils/FragmentUtils.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.inputmethod.latin.utils; + +import com.android.inputmethod.dictionarypack.DictionarySettingsFragment; +import com.android.inputmethod.latin.about.AboutPreferences; +import com.android.inputmethod.latin.settings.AdditionalSubtypeSettings; +import com.android.inputmethod.latin.settings.DebugSettings; +import com.android.inputmethod.latin.settings.SettingsFragment; +import com.android.inputmethod.latin.spellcheck.SpellCheckerSettingsFragment; +import com.android.inputmethod.latin.userdictionary.UserDictionaryAddWordFragment; +import com.android.inputmethod.latin.userdictionary.UserDictionaryList; +import com.android.inputmethod.latin.userdictionary.UserDictionaryLocalePicker; +import com.android.inputmethod.latin.userdictionary.UserDictionarySettings; +import com.android.inputmethod.research.FeedbackFragment; + +import java.util.HashSet; + +public class FragmentUtils { + private static final HashSet<String> sLatinImeFragments = new HashSet<String>(); + static { + sLatinImeFragments.add(DictionarySettingsFragment.class.getName()); + sLatinImeFragments.add(AboutPreferences.class.getName()); + sLatinImeFragments.add(AdditionalSubtypeSettings.class.getName()); + sLatinImeFragments.add(DebugSettings.class.getName()); + sLatinImeFragments.add(SettingsFragment.class.getName()); + sLatinImeFragments.add(SpellCheckerSettingsFragment.class.getName()); + sLatinImeFragments.add(UserDictionaryAddWordFragment.class.getName()); + sLatinImeFragments.add(UserDictionaryList.class.getName()); + sLatinImeFragments.add(UserDictionaryLocalePicker.class.getName()); + sLatinImeFragments.add(UserDictionarySettings.class.getName()); + sLatinImeFragments.add(FeedbackFragment.class.getName()); + } + + public static boolean isValidFragment(String fragmentName) { + return sLatinImeFragments.contains(fragmentName); + } +} |