From 610bafc0cf8f1b4435093babb985b9233e0906e9 Mon Sep 17 00:00:00 2001 From: Pavel Zhamaitsiak Date: Mon, 6 Apr 2015 14:11:36 -0700 Subject: [PATCH] Make mImsPhone static. DO NOT MERGE ANYWHERE This change is fixing cases when unnecessary ImsPhone object was created causing missing updates from IMS stack. Bug: 20077297 Change-Id: I58d0166767998c16c71fd86bf2b08a90bf80f8ce --- .../com/android/internal/telephony/CallManager.java | 9 +++++---- .../com/android/internal/telephony/PhoneBase.java | 13 +++++++------ .../internal/telephony/imsphone/ImsPhone.java | 5 +++++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/java/com/android/internal/telephony/CallManager.java b/src/java/com/android/internal/telephony/CallManager.java index 727be9699..417b0fda5 100644 --- a/src/java/com/android/internal/telephony/CallManager.java +++ b/src/java/com/android/internal/telephony/CallManager.java @@ -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()); diff --git a/src/java/com/android/internal/telephony/PhoneBase.java b/src/java/com/android/internal/telephony/PhoneBase.java index e1444ee10..763b68a54 100644 --- a/src/java/com/android/internal/telephony/PhoneBase.java +++ b/src/java/com/android/internal/telephony/PhoneBase.java @@ -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; @@ -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(); + //} } } diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhone.java b/src/java/com/android/internal/telephony/imsphone/ImsPhone.java index efc53c4dc..507346a6b 100644 --- a/src/java/com/android/internal/telephony/imsphone/ImsPhone.java +++ b/src/java/com/android/internal/telephony/imsphone/ImsPhone.java @@ -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");