Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
packages_apps_Stk
Commits
af0dd9f0
Commit
af0dd9f0
authored
12 years ago
by
Wink Saville
Committed by
android code review
12 years ago
Browse files
Options
Download
Plain Diff
Merge "Stk: Fix crash due to race condition"
parents
71013cbd
d8e2ecdc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
src/com/android/stk/StkAppService.java
src/com/android/stk/StkAppService.java
+11
-11
No files found.
src/com/android/stk/StkAppService.java
View file @
af0dd9f0
...
...
@@ -144,20 +144,11 @@ public class StkAppService extends Service implements Runnable {
@Override
public
void
onCreate
()
{
// Initialize members
// This can return null if StkService is not yet instantiated, but it's ok
// If this is null we will do getInstance before we need to use this
mStkService
=
com
.
android
.
internal
.
telephony
.
cat
.
CatService
.
getInstance
();
// NOTE mStkService is a singleton and continues to exist even if the GSMPhone is disposed
// after the radio technology change from GSM to CDMA so the PHONE_TYPE_CDMA check is
// needed. In case of switching back from CDMA to GSM the GSMPhone constructor updates
// the instance. (TODO: test).
if
((
mStkService
==
null
)
&&
(
TelephonyManager
.
getDefault
().
getPhoneType
()
!=
TelephonyManager
.
PHONE_TYPE_CDMA
))
{
CatLog
.
d
(
this
,
" Unable to get Service handle"
);
return
;
}
mCmdsQ
=
new
LinkedList
<
DelayedCmd
>();
Thread
serviceThread
=
new
Thread
(
null
,
this
,
"Stk App Service"
);
serviceThread
.
start
();
...
...
@@ -488,6 +479,15 @@ public class StkAppService extends Service implements Runnable {
if
(
mCurrentCmd
==
null
)
{
return
;
}
if
(
mStkService
==
null
)
{
mStkService
=
com
.
android
.
internal
.
telephony
.
cat
.
CatService
.
getInstance
();
if
(
mStkService
==
null
)
{
// This should never happen (we should be responding only to a message
// that arrived from StkService). It has to exist by this time
throw
new
RuntimeException
(
"mStkService is null when we need to send response"
);
}
}
CatResponseMessage
resMsg
=
new
CatResponseMessage
(
mCurrentCmd
);
// set result code
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment