Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
6f9c6f2c
Commit
6f9c6f2c
authored
11 years ago
by
Satoshi Kataoka
Browse files
Options
Downloads
Patches
Plain Diff
Fix a possible NPE
Bug: 9301208 Change-Id: Id120c99ab9ef698d16cf7b8beea30c98c95d23a1
parent
9c440d13
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/Settings.java
+8
-0
8 additions, 0 deletions
java/src/com/android/inputmethod/latin/Settings.java
with
8 additions
and
0 deletions
java/src/com/android/inputmethod/latin/Settings.java
+
8
−
0
View file @
6f9c6f2c
...
@@ -21,6 +21,7 @@ import android.content.SharedPreferences;
...
@@ -21,6 +21,7 @@ import android.content.SharedPreferences;
import
android.content.pm.ApplicationInfo
;
import
android.content.pm.ApplicationInfo
;
import
android.content.res.Resources
;
import
android.content.res.Resources
;
import
android.preference.PreferenceManager
;
import
android.preference.PreferenceManager
;
import
android.util.Log
;
import
com.android.inputmethod.latin.LocaleUtils.RunInLocale
;
import
com.android.inputmethod.latin.LocaleUtils.RunInLocale
;
...
@@ -28,6 +29,7 @@ import java.util.HashMap;
...
@@ -28,6 +29,7 @@ import java.util.HashMap;
import
java.util.Locale
;
import
java.util.Locale
;
public
final
class
Settings
implements
SharedPreferences
.
OnSharedPreferenceChangeListener
{
public
final
class
Settings
implements
SharedPreferences
.
OnSharedPreferenceChangeListener
{
private
static
final
String
TAG
=
Settings
.
class
.
getSimpleName
();
// In the same order as xml/prefs.xml
// In the same order as xml/prefs.xml
public
static
final
String
PREF_GENERAL_SETTINGS
=
"general_settings"
;
public
static
final
String
PREF_GENERAL_SETTINGS
=
"general_settings"
;
public
static
final
String
PREF_AUTO_CAP
=
"auto_cap"
;
public
static
final
String
PREF_AUTO_CAP
=
"auto_cap"
;
...
@@ -114,6 +116,12 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
...
@@ -114,6 +116,12 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
@Override
@Override
public
void
onSharedPreferenceChanged
(
final
SharedPreferences
prefs
,
final
String
key
)
{
public
void
onSharedPreferenceChanged
(
final
SharedPreferences
prefs
,
final
String
key
)
{
if
(
mSettingsValues
==
null
)
{
// TODO: Introduce a static function to register this class and ensure that
// loadSettings must be called before "onSharedPreferenceChanged" is called.
Log
.
w
(
TAG
,
"onSharedPreferenceChanged called before loadSettings."
);
return
;
}
loadSettings
(
mCurrentLocale
,
mSettingsValues
.
mInputAttributes
);
loadSettings
(
mCurrentLocale
,
mSettingsValues
.
mInputAttributes
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment