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
98534dc0
Commit
98534dc0
authored
11 years ago
by
Ken Wakasa
Browse files
Options
Downloads
Patches
Plain Diff
Add missing null checks for getOwnerInstance()
It may just return null. Change-Id: I778fb48262ef8af28a4af50b70bb94ace75a488c
parent
5c7c538f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/LatinIME.java
+33
-11
33 additions, 11 deletions
java/src/com/android/inputmethod/latin/LatinIME.java
with
33 additions
and
11 deletions
java/src/com/android/inputmethod/latin/LatinIME.java
+
33
−
11
View file @
98534dc0
...
...
@@ -172,7 +172,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
public
void
onCreate
()
{
final
Resources
res
=
getOwnerInstance
().
getResources
();
final
LatinIME
latinIme
=
getOwnerInstance
();
if
(
latinIme
==
null
)
{
return
;
}
final
Resources
res
=
latinIme
.
getResources
();
mDelayUpdateSuggestions
=
res
.
getInteger
(
R
.
integer
.
config_delay_update_suggestions
);
mDelayUpdateShiftState
=
res
.
getInteger
(
R
.
integer
.
config_delay_update_shift_state
);
mDoubleSpacePeriodTimeout
=
...
...
@@ -182,6 +186,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@Override
public
void
handleMessage
(
final
Message
msg
)
{
final
LatinIME
latinIme
=
getOwnerInstance
();
if
(
latinIme
==
null
)
{
return
;
}
final
KeyboardSwitcher
switcher
=
latinIme
.
mKeyboardSwitcher
;
switch
(
msg
.
what
)
{
case
MSG_UPDATE_SUGGESTION_STRIP:
...
...
@@ -239,7 +246,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
public
void
postResumeSuggestions
()
{
if
(!
getOwnerInstance
().
mSettings
.
getCurrent
().
isSuggestionStripVisible
())
{
final
LatinIME
latinIme
=
getOwnerInstance
();
if
(
latinIme
==
null
)
{
return
;
}
if
(!
latinIme
.
mSettings
.
getCurrent
().
isSuggestionStripVisible
())
{
return
;
}
removeMessages
(
MSG_RESUME_SUGGESTIONS
);
...
...
@@ -326,6 +337,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
resetPendingImsCallback
();
mIsOrientationChanging
=
true
;
final
LatinIME
latinIme
=
getOwnerInstance
();
if
(
latinIme
==
null
)
{
return
;
}
if
(
latinIme
.
isInputViewShown
())
{
latinIme
.
mKeyboardSwitcher
.
saveKeyboardState
();
}
...
...
@@ -362,8 +376,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mPendingSuccessiveImsCallback
=
true
;
}
final
LatinIME
latinIme
=
getOwnerInstance
();
executePendingImsCallback
(
latinIme
,
editorInfo
,
restarting
);
latinIme
.
onStartInputInternal
(
editorInfo
,
restarting
);
if
(
latinIme
!=
null
)
{
executePendingImsCallback
(
latinIme
,
editorInfo
,
restarting
);
latinIme
.
onStartInputInternal
(
editorInfo
,
restarting
);
}
}
}
...
...
@@ -381,9 +397,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
PENDING_IMS_CALLBACK_DURATION
);
}
final
LatinIME
latinIme
=
getOwnerInstance
();
executePendingImsCallback
(
latinIme
,
editorInfo
,
restarting
);
latinIme
.
onStartInputViewInternal
(
editorInfo
,
restarting
);
mAppliedEditorInfo
=
editorInfo
;
if
(
latinIme
!=
null
)
{
executePendingImsCallback
(
latinIme
,
editorInfo
,
restarting
);
latinIme
.
onStartInputViewInternal
(
editorInfo
,
restarting
);
mAppliedEditorInfo
=
editorInfo
;
}
}
}
...
...
@@ -393,8 +411,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mHasPendingFinishInputView
=
true
;
}
else
{
final
LatinIME
latinIme
=
getOwnerInstance
();
latinIme
.
onFinishInputViewInternal
(
finishingInput
);
mAppliedEditorInfo
=
null
;
if
(
latinIme
!=
null
)
{
latinIme
.
onFinishInputViewInternal
(
finishingInput
);
mAppliedEditorInfo
=
null
;
}
}
}
...
...
@@ -404,8 +424,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mHasPendingFinishInput
=
true
;
}
else
{
final
LatinIME
latinIme
=
getOwnerInstance
();
executePendingImsCallback
(
latinIme
,
null
,
false
);
latinIme
.
onFinishInputInternal
();
if
(
latinIme
!=
null
)
{
executePendingImsCallback
(
latinIme
,
null
,
false
);
latinIme
.
onFinishInputInternal
();
}
}
}
}
...
...
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