Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 755eeebd authored by Rakesh Pallerla's avatar Rakesh Pallerla Committed by Linux Build Service Account
Browse files

Add support for Flexi Mapping

* Add two new interfaces getModemCapability and updateStackBinding
   - getModemCapability, for getting modem stack capability
   - updateStackBinding, for updating the stack and sub binding
* Modified sendOemRilRequestRaw utility method to receive variable
  number of payloads
* Introduce two new classes ModemStackController and
  ModemBindingPolicyHandler.
* ModemStackController:
    - Get Modem Stack capabilities on boot up with new RIL interface.
    - Notify Stack Capabilities are available to registrants.
    - Update Stack Binding based on preferred Stack combination received
      in the request for UpdateStackBinding. UpdateStackBinding involves:
        > Deactivate all active subs
        > Send Unbind/Bind stack as per request
        > Set pref NwMode on all subs after stack binding is updated.
    - Notify registrants that stack is ready after stack binding is
	  updated.
* ModemBindingPolicyHandler:
    - Based on the Network Mode selected for the subscription, determine
      the best stack which supports maximum RATs in the selected Network
	  Mode.
    - If Stack binding update is required, send request to
	  ModemStackController with preferred Stack Ids.
    - Based on result of UpdateStackBinding, send result to user.
* Listen for Stack Ready notification in SubscriptionManager to
  initiate activation of subs on all cards as appropriate.

CRs-Fixed: 668741

Change-Id: I0ae3bf76ba8e0965bb490f98e3c8060ca89fe192
parent 20a8046c
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ public abstract class BaseCommands implements CommandsInterface {
    protected RegistrantList mHardwareConfigChangeRegistrants = new RegistrantList();
    protected RegistrantList mWwanIwlanCoexistenceRegistrants = new RegistrantList();
    protected RegistrantList mSimRefreshRegistrants = new RegistrantList();
    protected RegistrantList mModemCapRegistrants = new RegistrantList();

    protected Registrant mGsmSmsRegistrant;
    protected Registrant mCdmaSmsRegistrant;
@@ -772,6 +773,14 @@ public abstract class BaseCommands implements CommandsInterface {
        mSimRefreshRegistrants.remove(h);
    }

    public void registerForModemCapEvent(Handler h, int what, Object obj) {
        mModemCapRegistrants.addUnique(h, what, obj);
    }

    public void unregisterForModemCapEvent(Handler h) {
        mModemCapRegistrants.remove(h);
    }

    @Override
    public void getDataCallProfile(int appType, Message result) {
    }
@@ -828,6 +837,12 @@ public abstract class BaseCommands implements CommandsInterface {
    protected void onRadioAvailable() {
    }

    public void getModemCapability(Message response) {
    }

    public void updateStackBinding(int stackId, int enable, Message response) {
    }

    /**
     * {@inheritDoc}
     */
+26 −0
Original line number Diff line number Diff line
@@ -1943,6 +1943,21 @@ public interface CommandsInterface {
    // FIXME We may need to pass AID and slotid also
    public void setDataAllowed(boolean allowed, Message result);

    /**
      * Request to get modem stack capabilities
      * @param response is callback message
      */
    void getModemCapability(Message response);


    /**
      * Request to update binding status on the stack
      * @param stackId is stack to update binding
      * @param enable is to tell enable or disable binding
      * @param response is callback message
      */
    void updateStackBinding(int stackId, int enable, Message response);

    /**
     * Inform RIL that the device is shutting down
     *
@@ -1969,4 +1984,15 @@ public interface CommandsInterface {
     * @param lchStatus, true if call is in lch state
     */
    public void setLocalCallHold(int lchStatus);

    /**
     * Register/unregister for modem capability oem hook event
     *
     * @param h Handler for notification message.
     * @param what User-defined message code.
     * @param obj User object.
     */

    void registerForModemCapEvent(Handler h, int what, Object obj);
    void unregisterForModemCapEvent(Handler h);
}
+580 −0

File added.

Preview size limit exceeded, changes collapsed.

+793 −0

File added.

Preview size limit exceeded, changes collapsed.

+7 −1
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import android.telephony.Rlog;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;

import com.android.ims.ImsManager;
@@ -1293,8 +1294,13 @@ public abstract class PhoneBase extends Handler implements Phone {
     */
    @Override
    public void setPreferredNetworkType(int networkType, Message response) {
        if (TelephonyManager.getDefault().getPhoneCount() > 1) {
            ModemBindingPolicyHandler.getInstance().setPreferredNetworkType(networkType,
                    getPhoneId(),response);
        } else {
            mCi.setPreferredNetworkType(networkType, response);
        }
    }

    @Override
    public void getPreferredNetworkType(Message response) {
Loading