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

Commit 30163c52 authored by Rakesh Pallerla's avatar Rakesh Pallerla Committed by Linux Build Service Account
Browse files

Telephony(MSIM): Add support for MultiSim

- Changes to make class members to protected so that base
  classes can be extended for MultiSim.
  1. Add support for multiple rild in RIL.
  2. Overload methods in several modules to include sub info.
  3. Add MSIM SMS and MSIM Phonebook aidl files.

- MSimTelephonyManager, MSimSMSManager SDK implementation.

- CallManager changes for msim framework support
  1. Audio related changes to control audio on two subs.
  2. LCH support and setaudio parameter support for IMS calls.
  3. support to receive the sub specific vsid from Modem and
     use it while setting the audio states.
  4. Overload CallManager methods with subscription parameter
     to support DSDA PhoneApp functionality.
  5. Support to handle IMS calls from ExtCallManager.

Change-Id: I340cf22e99a42ae324f601ef7a808f13e550a6cf
parent aa0d5533
Loading
Loading
Loading
Loading
+150 −6
Original line number Diff line number Diff line
/*
 * Copyright (C) 2006 The Android Open Source Project
 * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved.
 *
 * Not a Contribution.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -25,11 +28,13 @@ import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SqliteWrapper;
import android.net.Uri;
import android.telephony.MSimSmsManager;
import android.telephony.SmsMessage;
import android.text.TextUtils;
import android.telephony.Rlog;
import android.util.Patterns;

import com.android.internal.telephony.MSimConstants;

import java.util.HashSet;
import java.util.Set;
@@ -162,6 +167,12 @@ public final class Telephony {
         */
        public static final String LOCKED = "locked";

        /**
         * The sub_id to which the message belongs to
         * <p>Type: INTEGER</p>
         */
        public static final String SUB_ID = "sub_id";

        /**
         * Error code associated with sending or receiving this message
         * <P>Type: INTEGER</P>
@@ -217,7 +228,29 @@ public final class Telephony {
                Uri uri, String address, String body, String subject,
                Long date, boolean read, boolean deliveryReport) {
            return addMessageToUri(resolver, uri, address, body, subject,
                    date, read, deliveryReport, -1L);
                    date, read, deliveryReport, -1L,
                    MSimSmsManager.getDefault().getPreferredSmsSubscription());
        }

        /**
         * Add an SMS to the given URI.
         *
         * @param resolver the content resolver to use
         * @param uri the URI to add the message to
         * @param address the address of the sender
         * @param body the body of the message
         * @param subject the psuedo-subject of the message
         * @param date the timestamp for the message
         * @param read true if the message has been read, false if not
         * @param deliveryReport true if a delivery report was requested, false if not
         * @param subId the sub_id which the message belongs to
         * @return the URI for the new message
         */
        public static Uri addMessageToUri(ContentResolver resolver,
                Uri uri, String address, String body, String subject,
                Long date, boolean read, boolean deliveryReport, int subId) {
            return addMessageToUri(resolver, uri, address, body, subject,
                    date, read, deliveryReport, -1L, subId);
        }

        /**
@@ -237,8 +270,33 @@ public final class Telephony {
        public static Uri addMessageToUri(ContentResolver resolver,
                Uri uri, String address, String body, String subject,
                Long date, boolean read, boolean deliveryReport, long threadId) {
            ContentValues values = new ContentValues(7);
            return addMessageToUri(resolver, uri, address, body, subject,
                    date, read, deliveryReport, threadId,
                    MSimSmsManager.getDefault().getPreferredSmsSubscription());
        }

        /**
         * Add an SMS to the given URI with thread_id specified.
         *
         * @param resolver the content resolver to use
         * @param uri the URI to add the message to
         * @param address the address of the sender
         * @param body the body of the message
         * @param subject the psuedo-subject of the message
         * @param date the timestamp for the message
         * @param read true if the message has been read, false if not
         * @param deliveryReport true if a delivery report was requested, false if not
         * @param threadId the thread_id of the message
         * @param subId the sub_id which the message belongs to
         * @return the URI for the new message
         */
        public static Uri addMessageToUri(ContentResolver resolver,
                Uri uri, String address, String body, String subject,
                Long date, boolean read, boolean deliveryReport, long threadId, int subId) {
            ContentValues values = new ContentValues(8);
            Rlog.v(TAG,"Telephony addMessageToUri sub id: " + subId);

            values.put(SUB_ID, subId);
            values.put(ADDRESS, address);
            if (date != null) {
                values.put(DATE, date);
@@ -342,7 +400,27 @@ public final class Telephony {
                    String address, String body, String subject, Long date,
                    boolean read) {
                return addMessageToUri(resolver, CONTENT_URI, address, body,
                        subject, date, read, false);
                        subject, date, read, false,
                        MSimSmsManager.getDefault().getPreferredSmsSubscription());
            }

            /**
             * Add an SMS to the Draft box.
             *
             * @param resolver the content resolver to use
             * @param address the address of the sender
             * @param body the body of the message
             * @param subject the psuedo-subject of the message
             * @param date the timestamp for the message
             * @param read true if the message has been read, false if not
             * @param subId the sub_id which the message belongs to
             * @return the URI for the new message
             */
            public static Uri addMessage(ContentResolver resolver,
                    String address, String body, String subject, Long date,
                    boolean read, int subId) {
                return addMessageToUri(resolver, CONTENT_URI, address, body,
                        subject, date, read, false, subId);
            }
        }

@@ -374,7 +452,25 @@ public final class Telephony {
            public static Uri addMessage(ContentResolver resolver,
                    String address, String body, String subject, Long date) {
                return addMessageToUri(resolver, CONTENT_URI, address, body,
                        subject, date, true, false);
                        subject, date, true, false,
                        MSimSmsManager.getDefault().getPreferredSmsSubscription());
            }

            /**
             * Add an SMS to the Draft box.
             *
             * @param resolver the content resolver to use
             * @param address the address of the sender
             * @param body the body of the message
             * @param subject the psuedo-subject of the message
             * @param date the timestamp for the message
             * @param subId the sub_id which the message belongs to
             * @return the URI for the new message
             */
            public static Uri addMessage(ContentResolver resolver,
                    String address, String body, String subject, Long date, int subId) {
                return addMessageToUri(resolver, CONTENT_URI, address, body,
                        subject, date, true, false, subId);
            }
        }

@@ -406,7 +502,25 @@ public final class Telephony {
            public static Uri addMessage(ContentResolver resolver,
                    String address, String body, String subject, Long date) {
                return addMessageToUri(resolver, CONTENT_URI, address, body,
                        subject, date, true, false);
                        subject, date, true, false,
                        MSimSmsManager.getDefault().getPreferredSmsSubscription());
            }

            /**
             * Add an SMS to the Draft box.
             *
             * @param resolver the content resolver to use
             * @param address the address of the sender
             * @param body the body of the message
             * @param subject the psuedo-subject of the message
             * @param date the timestamp for the message
             * @param subId the sub_id which the message belongs to
             * @return the URI for the new message
             */
            public static Uri addMessage(ContentResolver resolver,
                    String address, String body, String subject, Long date, int subId) {
                return addMessageToUri(resolver, CONTENT_URI, address, body,
                        subject, date, true, false, subId);
            }

            /**
@@ -455,8 +569,28 @@ public final class Telephony {
            public static Uri addMessage(ContentResolver resolver,
                    String address, String body, String subject, Long date,
                    boolean deliveryReport, long threadId) {
                return addMessageToUri(resolver, CONTENT_URI, address, body, subject, date,
                        true, deliveryReport, threadId,
                        MSimSmsManager.getDefault().getPreferredSmsSubscription());
            }

            /**
             * Add an SMS to the Out box.
             *
             * @param resolver the content resolver to use
             * @param address the address of the sender
             * @param body the body of the message
             * @param subject the psuedo-subject of the message
             * @param date the timestamp for the message
             * @param deliveryReport whether a delivery report was requested for the message
             * @param subId the sub_id which the message belongs to
             * @return the URI for the new message
             */
            public static Uri addMessage(ContentResolver resolver,
                    String address, String body, String subject, Long date,
                    boolean deliveryReport, long threadId, int subId) {
                return addMessageToUri(resolver, CONTENT_URI, address, body,
                        subject, date, true, deliveryReport, threadId);
                        subject, date, true, deliveryReport, threadId, subId);
            }
        }

@@ -685,6 +819,9 @@ public final class Telephony {
                Object[] messages = (Object[]) intent.getSerializableExtra("pdus");
                String format = intent.getStringExtra("format");
                byte[][] pduObjs = new byte[messages.length][];
                int subId = intent.getIntExtra(MSimConstants.SUBSCRIPTION_KEY, 0);

                Rlog.v(TAG, " getMessagesFromIntent sub_id : " + subId);

                for (int i = 0; i < messages.length; i++) {
                    pduObjs[i] = (byte[]) messages[i];
@@ -695,6 +832,7 @@ public final class Telephony {
                for (int i = 0; i < pduCount; i++) {
                    pdus[i] = pduObjs[i];
                    msgs[i] = SmsMessage.createFromPdu(pdus[i], format);
                    msgs[i].setSubId(subId);
                }
                return msgs;
            }
@@ -1156,6 +1294,12 @@ public final class Telephony {
         */
        public static final String LOCKED = "locked";

        /**
         * The sub id to which message belongs to
         * <p>Type: INTEGER</p>
         */
        public static final String SUB_ID = "sub_id";

        /**
         * Meta data used externally.
         * <P>Type: TEXT</P>
Loading