Fix NPE in onDestroy.
NPE can happen when calls are canceled immediately before incallservice has a chance to respond. Bug:17362107 Change-Id: I6bf318f5f7d89731b686a1523678a26764fa9bf3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user