DO NOT MERGE ImsRegistrationListener#registrationChangeFailed
Meng Wang [Thu, 8 Dec 2016 00:27:15 +0000 (16:27 -0800)]
Bug: 33430556
Change-Id: Icea36e559f447b14c41a04cd517c12b632bc2c0c

src/java/com/android/ims/ImsConnectionStateListener.java
src/java/com/android/ims/ImsManager.java

index 1158375..f281df1 100644 (file)
@@ -34,6 +34,13 @@ public class ImsConnectionStateListener {
     }
 
     /**
+     * Called when the device is connected to the IMS network with {@param imsRadioTech}.
+     */
+    public void onImsConnected(int imsRadioTech) {
+        // no-op
+    }
+
+    /**
      * Called when the device is trying to connect to the IMS network.
      */
     public void onImsProgressing() {
@@ -83,4 +90,11 @@ public class ImsConnectionStateListener {
     public void registrationAssociatedUriChanged(Uri[] uris) {
         // no-op
     }
+
+    /**
+     * Called when IMS registration attempt on {@param imsRadioTech} failed
+     */
+    public void onRegistrationChangeFailed(int imsRadioTech, ImsReasonInfo imsReasonInfo) {
+        // no-op
+    }
 }
index 464aeed..8706f9b 100644 (file)
@@ -1483,7 +1483,7 @@ public class ImsManager {
     /**
      * Adapter class for {@link IImsRegistrationListener}.
      */
-    private class ImsRegistrationListenerProxy extends IImsRegistrationListener.Stub {
+    private static class ImsRegistrationListenerProxy extends IImsRegistrationListener.Stub {
         private int mServiceClass;
         private ImsConnectionStateListener mListener;
 
@@ -1529,6 +1529,7 @@ public class ImsManager {
 
             if (mListener != null) {
                 mListener.onImsConnected();
+                mListener.onImsConnected(imsRadioTech);
             }
         }
 
@@ -1616,6 +1617,16 @@ public class ImsManager {
                 mListener.registrationAssociatedUriChanged(uris);
             }
         }
+
+        @Override
+        public void registrationChangeFailed(int targetAccessTech, ImsReasonInfo imsReasonInfo) {
+            if (DBG) log("registrationChangeFailed :: targetAccessTech=" + targetAccessTech +
+                    ", imsReasonInfo=" + imsReasonInfo);
+
+            if (mListener != null) {
+                mListener.onRegistrationChangeFailed(targetAccessTech, imsReasonInfo);
+            }
+        }
     }
 
     /**