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

Commit 42249c24 authored by Andalam Parthasarathi's avatar Andalam Parthasarathi Committed by Gerrit - the friendly Code Review server
Browse files

Telephony plugin for GsmServiceStateTracker

 - Add makeGsmServiceStateTracker method in TelephonyPlugin
      to have  provision of extending it from proprietary space.
 - Added telephony delegate function and created QtiGsmServiceStateTracker
   in proprietary jar file

Change-Id: If048d14a4cc614e34afdbe1e1bf41023702a5cb1
CRs-Fixed: 902503
parent edb37773
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import com.android.internal.telephony.cdma.CDMALTEPhone;
import com.android.internal.telephony.dataconnection.DcTracker;
import com.android.internal.telephony.dataconnection.DctController;
import com.android.internal.telephony.gsm.GSMPhone;
import com.android.internal.telephony.gsm.GsmServiceStateTracker;

public abstract class TelephonyPluginBase implements TelephonyPluginInterface {
    private String TAG = "TelephonyPluginBase";
@@ -86,4 +87,9 @@ public abstract class TelephonyPluginBase implements TelephonyPluginInterface {
    public void initExtTelephonyClasses(Context context,
            Phone[] phoneProxy, CommandsInterface[] commandsInterfaces) {
    }

    @Override
    public GsmServiceStateTracker makeGsmServiceStateTracker(GSMPhone phone) {
        return new GsmServiceStateTracker(phone);
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@ import android.telephony.Rlog;

import com.android.internal.telephony.dataconnection.DcTracker;
import com.android.internal.telephony.dataconnection.DctController;
import com.android.internal.telephony.gsm.GSMPhone;
import com.android.internal.telephony.gsm.GsmServiceStateTracker;
import com.android.internal.telephony.TelephonyPluginBase;
import com.android.internal.telephony.DefaultTelephonyPlugin;
import com.android.internal.R;
@@ -133,4 +135,8 @@ public class TelephonyPluginDelegate {
            Phone[] phoneProxy, CommandsInterface[] commandsInterfaces) {
        sPlugin.initExtTelephonyClasses(context, phoneProxy, commandsInterfaces);
    }

    public GsmServiceStateTracker makeGsmServiceStateTracker(GSMPhone phone) {
        return sPlugin.makeGsmServiceStateTracker(phone);
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@ import android.content.Context;

import com.android.internal.telephony.dataconnection.DcTracker;
import com.android.internal.telephony.dataconnection.DctController;
import com.android.internal.telephony.gsm.GSMPhone;
import com.android.internal.telephony.gsm.GsmServiceStateTracker;


public interface TelephonyPluginInterface {

@@ -56,4 +59,6 @@ public interface TelephonyPluginInterface {

    public void initExtTelephonyClasses(Context context,
            Phone[] phoneProxy, CommandsInterface[] commandsInterfaces);

    public GsmServiceStateTracker makeGsmServiceStateTracker(GSMPhone phone);
}
+2 −2
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ public class GSMPhone extends PhoneBase {
        mCi.setPhoneType(PhoneConstants.PHONE_TYPE_GSM);
        mCT = new GsmCallTracker(this);

        mSST = new GsmServiceStateTracker(this);
        mSST = TelephonyPluginDelegate.getInstance().makeGsmServiceStateTracker(this);
        mDcTracker = TelephonyPluginDelegate.getInstance().makeDcTracker(this);

        if (!unitTestMode) {
@@ -191,7 +191,7 @@ public class GSMPhone extends PhoneBase {
        mCi.setPhoneType(PhoneConstants.PHONE_TYPE_GSM);
        mCT = new GsmCallTracker(this);

        mSST = new GsmServiceStateTracker(this);
        mSST = TelephonyPluginDelegate.getInstance().makeGsmServiceStateTracker(this);
        mDcTracker = TelephonyPluginDelegate.getInstance().makeDcTracker(this);

        if (!unitTestMode) {
+11 −11
Original line number Diff line number Diff line
@@ -91,20 +91,20 @@ import java.util.TimeZone;
/**
 * {@hide}
 */
final class GsmServiceStateTracker extends ServiceStateTracker {
public class GsmServiceStateTracker extends ServiceStateTracker {
    static final String LOG_TAG = "GsmSST";
    static final boolean VDBG = false;
    //CAF_MSIM make it private ??
    private static final int EVENT_ALL_DATA_DISCONNECTED = 1001;
    private GSMPhone mPhone;
    GsmCellLocation mCellLoc;
    GsmCellLocation mNewCellLoc;
    protected GSMPhone mPhone;
    protected GsmCellLocation mCellLoc;
    protected GsmCellLocation mNewCellLoc;
    int mPreferredNetworkType;

    private int mMaxDataCalls = 1;
    private int mNewMaxDataCalls = 1;
    protected int mNewMaxDataCalls = 1;
    private int mReasonDataDenied = -1;
    private int mNewReasonDataDenied = -1;
    protected int mNewReasonDataDenied = -1;

    private static final String ACTION_MANAGED_ROAMING_IND =
            "codeaurora.intent.action.ACTION_MANAGED_ROAMING_IND";
@@ -119,12 +119,12 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
     * Data roaming status solely based on TS 27.007 10.1.19 CGREG. Only used by
     * handlePollStateResult to store CGREG roaming result.
     */
    private boolean mDataRoaming = false;
    protected boolean mDataRoaming = false;

    /**
     * Mark when service state is in emergency call only mode
     */
    private boolean mEmergencyOnly = false;
    protected boolean mEmergencyOnly = false;

    /**
     * Sometimes we get the NITZ time before we know what country we
@@ -1055,7 +1055,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
        }
    }

    private void pollStateDone() {
    protected void pollStateDone() {
        if (Build.IS_DEBUGGABLE && SystemProperties.getBoolean(PROP_FORCE_ROAMING, false)) {
            mNewSS.setVoiceRoaming(true);
            mNewSS.setDataRoaming(true);
@@ -1546,7 +1546,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
    }

    /** code is registration state 0-5 from TS 27.007 7.2 */
    private int regCodeToServiceState(int code) {
    protected int regCodeToServiceState(int code) {
        switch (code) {
            case 0:
            case 2: // 2 is "searching"
@@ -1576,7 +1576,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
     * code is registration state 0-5 from TS 27.007 7.2
     * returns true if registered roam, false otherwise
     */
    private boolean regCodeIsRoaming (int code) {
    protected boolean regCodeIsRoaming (int code) {
        return ServiceState.RIL_REG_STATE_ROAMING == code;
    }