diff options
author | Santos Cordon <santoscordon@google.com> | 2014-09-02 17:13:45 -0700 |
---|---|---|
committer | Santos Cordon <santoscordon@google.com> | 2014-09-02 17:19:03 -0700 |
commit | 619b3c0d09ff01ca163601a22973a58fd13ca64c (patch) | |
tree | 8172befe91bf9f25b11ed2f7b9652081fa283397 /telecomm | |
parent | 1611c21dfdf102fa4eadd3cab4c7bd5fda061826 (diff) | |
download | frameworks_base-619b3c0d09ff01ca163601a22973a58fd13ca64c.zip frameworks_base-619b3c0d09ff01ca163601a22973a58fd13ca64c.tar.gz frameworks_base-619b3c0d09ff01ca163601a22973a58fd13ca64c.tar.bz2 |
Fix NPE in onDestroy.
NPE can happen when calls are canceled immediately before incallservice
has a chance to respond.
Bug:17362107
Change-Id: I6bf318f5f7d89731b686a1523678a26764fa9bf3
Diffstat (limited to 'telecomm')
-rw-r--r-- | telecomm/java/android/telecomm/InCallService.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/telecomm/java/android/telecomm/InCallService.java b/telecomm/java/android/telecomm/InCallService.java index cbcee75..62a90bc 100644 --- a/telecomm/java/android/telecomm/InCallService.java +++ b/telecomm/java/android/telecomm/InCallService.java @@ -165,11 +165,13 @@ public abstract class InCallService extends Service { @Override public boolean onUnbind(Intent intent) { - Phone oldPhone = mPhone; - mPhone = null; + if (mPhone != null) { + Phone oldPhone = mPhone; + mPhone = null; - oldPhone.destroy(); - onPhoneDestroyed(oldPhone); + oldPhone.destroy(); + onPhoneDestroyed(oldPhone); + } return false; } |