Skip to content

Commit

Permalink
Make mImsPhone static. DO NOT MERGE ANYWHERE
Browse files Browse the repository at this point in the history
This change is fixing cases when unnecessary ImsPhone object
was created causing missing updates from IMS stack.

Bug: 20077297
Change-Id: I58d0166767998c16c71fd86bf2b08a90bf80f8ce
  • Loading branch information
Pavel Zhamaitsiak authored and The Android Automerger committed Apr 7, 2015
1 parent 47ca8fb commit 610bafc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
9 changes: 5 additions & 4 deletions src/java/com/android/internal/telephony/CallManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,11 @@ public void unregisterPhone(Phone phone) {
phone.getPhoneName() + " " + phone + ")");
}

Phone vPhone = basePhone.getImsPhone();
if (vPhone != null) {
unregisterPhone(vPhone);
}
// ImsPhone is unregistered in PhoneBase.updateImsPhone()
//Phone vPhone = basePhone.getImsPhone();
//if (vPhone != null) {
// unregisterPhone(vPhone);
//}

mPhones.remove(basePhone);
mRingingCalls.remove(basePhone.getRingingCall());
Expand Down
13 changes: 7 additions & 6 deletions src/java/com/android/internal/telephony/PhoneBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ protected static class NetworkSelectMessage {

private final Object mImsLock = new Object();
private boolean mImsServiceReady = false;
protected ImsPhone mImsPhone = null;
protected static ImsPhone mImsPhone = null;

protected int mRadioAccessFamily = RadioAccessFamily.RAF_UNKNOWN;

Expand Down Expand Up @@ -460,11 +460,12 @@ public void dispose() {
mTelephonyTester.dispose();
}

ImsPhone imsPhone = mImsPhone;
if (imsPhone != null) {
imsPhone.unregisterForSilentRedial(this);
imsPhone.dispose();
}
// No deed to dispose static object
//ImsPhone imsPhone = mImsPhone;
//if (imsPhone != null) {
// imsPhone.unregisterForSilentRedial(this);
// imsPhone.dispose();
//}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ public void dispose() {
//Force all referenced classes to unregister their former registered events
}

@Override
public Phone getImsPhone() {
return null;
}

@Override
public void removeReferences() {
Rlog.d(LOG_TAG, "removeReferences");
Expand Down

0 comments on commit 610bafc

Please sign in to comment.