Merge tag 'LA.UM.8.1.r1-14300-sm8150.0' of https://source.codeaurora.org/quic/la/platform/vendor/codeaurora/telephony into lineage-17.1

"LA.UM.8.1.r1-14300-sm8150.0"

Change-Id: I2a3660c79dc4a37d3e5de04cfa9ca427c96866c5
diff --git a/ims/src/org/codeaurora/ims/QtiCallConstants.java b/ims/src/org/codeaurora/ims/QtiCallConstants.java
index f52da96..ca662de 100644
--- a/ims/src/org/codeaurora/ims/QtiCallConstants.java
+++ b/ims/src/org/codeaurora/ims/QtiCallConstants.java
@@ -244,6 +244,12 @@
 
     public static final String EXTRA_PHONE_ID = "phoneId";
 
+    //holds the call fail cause because of which redial is attempted
+    public static final String EXTRA_RETRY_CALL_FAIL_REASON = "RetryCallFailReason";
+    //holds the radiotech on which lower layers may try attempting redial
+    public static final String EXTRA_RETRY_CALL_FAIL_RADIOTECH = "RetryCallFailRadioTech";
+
+
    /**
      * Whether RTT visibility is on or off
      * The value 1 - enable, 0 - disable
diff --git a/ims/src/org/codeaurora/ims/QtiCarrierConfigs.java b/ims/src/org/codeaurora/ims/QtiCarrierConfigs.java
index 32980f7..1386f43 100644
--- a/ims/src/org/codeaurora/ims/QtiCarrierConfigs.java
+++ b/ims/src/org/codeaurora/ims/QtiCarrierConfigs.java
@@ -128,4 +128,10 @@
      */
     public static final String KEY_CARRIER_CANCEL_MODIFY_CALL_SUPPORTED =
             "support_cancel_modify_call";
+
+    /* Config to determine if carrier supports accepting MT video call as one way
+     * true if user can accept MT video call as one way else false
+     */
+    public static final String ALLOW_ONE_WAY_ACCEPT_FOR_VIDEO_CALL =
+            "allow_one_way_accept_video_call";
 }
diff --git a/ims/src/org/codeaurora/ims/QtiImsExtBase.java b/ims/src/org/codeaurora/ims/QtiImsExtBase.java
index 95423ed..9cf2548 100644
--- a/ims/src/org/codeaurora/ims/QtiImsExtBase.java
+++ b/ims/src/org/codeaurora/ims/QtiImsExtBase.java
@@ -157,6 +157,14 @@
         public void setAnswerExtras(int phoneId, Bundle extras) {
             onSetAnswerExtras(phoneId, extras);
         }
+
+        @Override
+        public void setCallBarring(int phoneId, boolean operationType, String facilityType,
+                String[] cbNumListInfo, String password, int serviceClass,
+                IQtiImsExtListener listener) {
+            onSetCallBarring(phoneId, operationType, facilityType, cbNumListInfo, password,
+                    serviceClass, listener);
+        }
     };
 
     private QtiImsExtBinder mQtiImsExtBinder;
@@ -250,4 +258,12 @@
     protected void onSetAnswerExtras(int phoneId, Bundle extras) {
         // no-op
     }
+    /**
+     * To activate/deactive the call barring request with password.
+     */
+    protected void onSetCallBarring(int phoneId, boolean operationType, String facilityType,
+            String[] cbNumListInfo, String password, int serviceClass,
+            IQtiImsExtListener listener) {
+        // no-op
+    }
 }
diff --git a/ims/src/org/codeaurora/ims/QtiImsExtListenerBaseImpl.java b/ims/src/org/codeaurora/ims/QtiImsExtListenerBaseImpl.java
index daf9779..170cd04 100644
--- a/ims/src/org/codeaurora/ims/QtiImsExtListenerBaseImpl.java
+++ b/ims/src/org/codeaurora/ims/QtiImsExtListenerBaseImpl.java
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-2017, 2019 The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -97,5 +97,13 @@
     public void onUssdFailed(int phoneId, int type, int errorCode,
             String errorMessage) {
     }
+
+    /**
+     * This API is invoked when setCallBarring with password is success to notify to clients.
+     * onUTReqFailed API will be invoked in case of any failure in setCallBarring with password.
+     */
+    @Override
+    public void onSetCallBarring() {
+    }
 }
 
diff --git a/ims/src/org/codeaurora/ims/QtiImsExtManager.java b/ims/src/org/codeaurora/ims/QtiImsExtManager.java
index 908bf68..5f416db 100644
--- a/ims/src/org/codeaurora/ims/QtiImsExtManager.java
+++ b/ims/src/org/codeaurora/ims/QtiImsExtManager.java
@@ -352,6 +352,31 @@
         }
     }
 
+    /**
+     * Used by clients to activate/deactivate call barring with password over IMS pipe.
+     *
+     * @param phoneId indicates the phone instance which triggered the request
+     * @param operationType is false (CommandsInterface.CF_ACTION_ENABLE) or
+                               true (CommandsInterface.CF_ACTION_DISABLE)
+     * @param facilityType type of operation same as @link ImsUtInterface.CB_*
+     * @param cbNumListInfo ICB number list
+     * @param password Password to activate/deactivate the call barring.
+     * @param serviceClass service class for call barring @link CommandsInterface.SERVICE_CLASS*
+     * @param listener an IQtiImsExtListener instance to indicate the response
+     * @return void
+     */
+    public void setCallBarring(int phoneId, boolean operationType, String facilityType,
+            String[] cbNumListInfo, String password, int serviceClass, IQtiImsExtListener listener)
+            throws QtiImsException {
+        validateInvariants(phoneId);
+        try {
+            mQtiImsExt.setCallBarring(phoneId, operationType, facilityType, cbNumListInfo, password,
+                    serviceClass, listener);
+        } catch(RemoteException e) {
+            throw new QtiImsException("Remote ImsService setCallBarring: " + e);
+        }
+    }
+
     /*package private*/
     void validateInvariants(int phoneId)  throws QtiImsException {
         checkBinder();
diff --git a/ims/src/org/codeaurora/ims/internal/IQtiImsExt.aidl b/ims/src/org/codeaurora/ims/internal/IQtiImsExt.aidl
index 1b756ef..c5feddf 100644
--- a/ims/src/org/codeaurora/ims/internal/IQtiImsExt.aidl
+++ b/ims/src/org/codeaurora/ims/internal/IQtiImsExt.aidl
@@ -285,4 +285,22 @@
      * @return void
      */
     oneway void setUssdInfoListener(int phoneId, IQtiImsExtListener listener);
+
+   /**
+     * setCallBarring
+     * Set call barring operation with password support
+     *
+     * @param phoneId indicates the phone instance which triggered the request
+     * @param operationType is false (CommandsInterface.CF_ACTION_ENABLE) or
+                               true (CommandsInterface.CF_ACTION_DISABLE)
+     * @param facilityType type of operation same as @link ImsUtInterface.CB_*
+     * @param cbNumListInfo ICB number list
+     * @param password Password to activate/deactivate the call barring.
+     * @param serviceClass service class for call barring @link CommandsInterface.SERVICE_CLASS*
+     * @param listener an IQtiImsExtListener instance to indicate the response
+     * @return void
+     */
+    oneway void setCallBarring(int phoneId, boolean operationType, String facilityType,
+            in String[] cbNumListInfo, String password, int serviceClass,
+            IQtiImsExtListener listener);
 }
diff --git a/ims/src/org/codeaurora/ims/internal/IQtiImsExtListener.aidl b/ims/src/org/codeaurora/ims/internal/IQtiImsExtListener.aidl
index a72a593..24f1739 100644
--- a/ims/src/org/codeaurora/ims/internal/IQtiImsExtListener.aidl
+++ b/ims/src/org/codeaurora/ims/internal/IQtiImsExtListener.aidl
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-2016, 2019 The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -189,4 +189,12 @@
      *
      */
    void onUssdFailed(int phoneId, int type, int errorCode, String errorMessage);
+
+   /**
+     * Notifies client that setCallBarring operation is success.
+     *
+     * onUTReqFailed API will be invoked in case of any failure in setCallBarring with password.
+     * @return void
+     */
+   void onSetCallBarring();
 }
diff --git a/ims/src/org/codeaurora/ims/utils/QtiImsExtUtils.java b/ims/src/org/codeaurora/ims/utils/QtiImsExtUtils.java
index b997c94..3b14cd2 100644
--- a/ims/src/org/codeaurora/ims/utils/QtiImsExtUtils.java
+++ b/ims/src/org/codeaurora/ims/utils/QtiImsExtUtils.java
@@ -113,6 +113,10 @@
      */
     public static final String EXTRA_SSAC = "Ssac";
 
+    /* @Deprecated
+     * Use SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX
+     * as key to carry sub id value instead
+     */
     public static final String SUBSCRIPTION_ID = "subId";
 
     /**
@@ -669,4 +673,9 @@
                 QtiCallConstants.IMS_AUTO_REJECT + phoneId,
                 QtiCallConstants.AUTO_REJECT_CALL_DISABLED);
     }
+
+    public static boolean canAcceptAsOneWayVideo(int phoneId, Context context) {
+        return (isCarrierConfigEnabled(phoneId, context,
+                QtiCarrierConfigs.ALLOW_ONE_WAY_ACCEPT_FOR_VIDEO_CALL));
+    }
 }