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

Commit 53757cff authored by Jüri Schultz's avatar Jüri Schultz Committed by codeworkx
Browse files

telephony: update stk service functionality for Samsung phones

Change-Id: I16015d29a969dfe6ed6dac118db39230b1b77ea1
parent 0dac9bf8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -835,4 +835,7 @@
         kill the foreground app. -->
    <integer name="config_backKillTimeout">2000</integer>

    <!--Boolean to enable stk functionality on Samsung phones-->
    <bool name="config_samsung_stk">false</bool>

</resources>
+7 −0
Original line number Diff line number Diff line
@@ -1652,4 +1652,11 @@ public interface CommandsInterface {
     * CM-specific: Ask the RIL about the presence of back-compat flags
     */
    public boolean needsOldRilFeature(String feature);
    /**
     * @hide
     * samsung stk service implementation - set up registrant for sending
     * sms send result from modem(RIL) to catService
     */
    void setOnCatSendSmsResult(Handler h, int what, Object obj);
    void unSetOnCatSendSmsResult(Handler h);
}
+13 −0
Original line number Diff line number Diff line
@@ -212,6 +212,19 @@ public abstract class IccSmsInterfaceManager extends ISms.Stub {
        return data;
    }

    /**
     * stk send sms Samsung way
     * @param smsc
     * @param pdu
     * @param sentIntent
     * @param deliveryIntent
     */
    public void sendRawPduSat(byte[] smsc, byte[] pdu, PendingIntent sentIntent,
            PendingIntent deliveryIntent) {
        mPhone.getContext();
        mDispatcher.sendRawPdu(smsc, pdu, sentIntent, deliveryIntent);
    }

    protected abstract void log(String msg);

}
+37 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import android.os.Message;
import android.os.Parcel;
import android.os.PowerManager;
import android.os.SystemProperties;
import android.os.Registrant;
import android.os.PowerManager.WakeLock;
import android.telephony.NeighboringCellInfo;
import android.telephony.PhoneNumberUtils;
@@ -267,6 +268,26 @@ public class RIL extends BaseCommands implements CommandsInterface {
        }
    };

    protected Registrant mCatSendSmsResultRegistrant;
    /**
     * samsung stk service implementation - set up registrant for sending
     * sms send result from modem(RIL) to catService
     * @param h
     * @param what
     * @param obj
     */
    public void setOnCatSendSmsResult(Handler h, int what, Object obj) {
        mCatSendSmsResultRegistrant = new Registrant(h, what, obj);
    }

    /**
     *
     * @param h
     */
    public void unSetOnCatSendSmsResult(Handler h) {
        mCatSendSmsResultRegistrant.clear();
    }

    class RILSender extends Handler implements Runnable {
        public RILSender(Looper looper) {
            super(looper);
@@ -2467,6 +2488,8 @@ public class RIL extends BaseCommands implements CommandsInterface {
            case RIL_UNSOL_CDMA_PRL_CHANGED: ret = responseInts(p); break;
            case RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE: ret = responseVoid(p); break;
            case RIL_UNSOL_RIL_CONNECTED: ret = responseInts(p); break;
            //samsung stk service implementation
            case RIL_UNSOL_STK_SEND_SMS_RESULT: ret = responseInts(p); break;

            default:
                throw new RuntimeException("Unrecognized unsol response: " + response);
@@ -2812,6 +2835,19 @@ public class RIL extends BaseCommands implements CommandsInterface {
                notifyRegistrantsRilConnectionChanged(((int[])ret)[0]);
                break;
            }

            //samsung stk service implementation
            case RIL_UNSOL_STK_SEND_SMS_RESULT:
                if (Resources.getSystem().
                        getBoolean(com.android.internal.R.bool.config_samsung_stk)) {
                    if (RILJ_LOGD) unsljLogRet(response, ret);

                    if (mCatSendSmsResultRegistrant != null) {
                        mCatSendSmsResultRegistrant.notifyRegistrant(
                                new AsyncResult (null, ret, null));
                    }
                }
                break;
        }
    }

@@ -3608,6 +3644,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
            case RIL_UNSOL_CDMA_PRL_CHANGED: return "UNSOL_CDMA_PRL_CHANGED";
            case RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE: return "UNSOL_EXIT_EMERGENCY_CALLBACK_MODE";
            case RIL_UNSOL_RIL_CONNECTED: return "UNSOL_RIL_CONNECTED";
            case RIL_UNSOL_STK_SEND_SMS_RESULT: return "RIL_UNSOL_STK_SEND_SMS_RESULT";
            default: return "<unknown response: "+request+">";
        }
    }
+1 −0
Original line number Diff line number Diff line
@@ -300,4 +300,5 @@ cat include/telephony/ril.h | \
    int RIL_UNSOL_CDMA_PRL_CHANGED = 1032;
    int RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE = 1033;
    int RIL_UNSOL_RIL_CONNECTED = 1034;
    int RIL_UNSOL_STK_SEND_SMS_RESULT = 11002; /* Samsung specific */
}
Loading