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

Commit 9cac4e83 authored by Anju Mathapati's avatar Anju Mathapati Committed by Linux Build Service Account
Browse files

IMS: Remove CallDetails & CallModify

-Move CallDetails & CallModify files to proprietary space
-Move constants from CallDetails to Phone

Change-Id: Idc04ed699f8044de5fcec4da9c6770b53f961b3b
parent 0421294d
Loading
Loading
Loading
Loading
+0 −186
Original line number Diff line number Diff line
/* Copyright (c) 2012, 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
 * met:
 *  * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above
 *       copyright notice, this list of conditions and the following
 *       disclaimer in the documentation and/or other materials provided
 *       with the distribution.
 *  * Neither the name of The Linux Foundation nor the names of its
 *       contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package com.android.internal.telephony;

import java.util.Map;
import java.util.Map.Entry;

/**
 * CallDetails class takes care of all the additional details like call type
 * and domain needed for IMS calls. This class is not relevant for non-IMS calls
 */
public class CallDetails {

    /*
     * Type of the call based on the media type and the direction of the media.
     */

    public static final int CALL_TYPE_VOICE = 0; /*
                                                  * Voice call-audio in both
                                                  * directions
                                                  */

    public static final int CALL_TYPE_VT_TX = 1; /*
                                                  * PS Video telephony call: one
                                                  * way TX video, two way audio
                                                  */

    public static final int CALL_TYPE_VT_RX = 2; /*
                                                  * Video telephony call: one
                                                  * way RX video, two way audio
                                                  */

    public static final int CALL_TYPE_VT = 3; /*
                                               * Video telephony call: two way
                                               * video, two way audio
                                               */

    public static final int CALL_TYPE_VT_NODIR = 4; /*
                                                     * Video telephony call: no
                                                     * direction, two way audio,
                                                     * intermediate state in a
                                                     * video call till video
                                                     * link is setup
                                                     */

    public static final int CALL_TYPE_UNKNOWN = 10; /*
                                                     * Unknown Call type, may be
                                                     * used for answering call
                                                     * with same call type as
                                                     * incoming call. This is
                                                     * only for telephony, not
                                                     * meant to be passed to RIL
                                                     */

    public static final int CALL_DOMAIN_UNKNOWN = 0; /*
                                                      * Unknown domain. Sent by
                                                      * RIL when modem has not
                                                      * yet selected a domain
                                                      * for a call
                                                      */
    public static final int CALL_DOMAIN_CS = 1; /*
                                                 * Circuit switched domain
                                                 */
    public static final int CALL_DOMAIN_PS = 2; /*
                                                 * Packet switched domain
                                                 */
    public static final int CALL_DOMAIN_AUTOMATIC = 3; /*
                                                        * Automatic domain. Sent
                                                        * by Android to indicate
                                                        * that the domain for a
                                                        * new call should be
                                                        * selected by modem
                                                        */
    public static final int CALL_DOMAIN_NOT_SET = 4; /*
                                                      * Init value used
                                                      * internally by telephony
                                                      * until domain is set
                                                      */

    public static final String EXTRAS_IS_CONFERENCE_URI = "isConferenceUri";

    public int call_type;
    public int call_domain;

    public String[] extras;

    public CallDetails() {
        call_type = CALL_TYPE_VOICE;
        call_domain = CALL_DOMAIN_NOT_SET;
        extras = null;
    }

    public CallDetails(int callType, int callDomain, String[] extraparams) {
        call_type = callType;
        call_domain = callDomain;
        extras = extraparams;
    }

    public CallDetails(CallDetails srcCall) {
        if (srcCall != null) {
            call_type = srcCall.call_type;
            call_domain = srcCall.call_domain;
            extras = srcCall.extras;
        }
    }

    public void setExtras(String[] extraparams) {
        extras = extraparams;
    }

    public static String[] getExtrasFromMap(Map<String, String> newExtras) {
        String []extras = null;

        if (newExtras == null) {
            return null;
        }

        // TODO: Merge new extras into extras. For now, just serialize and set them
        extras = new String[newExtras.size()];

        if (extras != null) {
            int i = 0;
            for (Entry<String, String> entry : newExtras.entrySet()) {
                extras[i] = "" + entry.getKey() + "=" + entry.getValue();
            }
        }
        return extras;
    }

    public void setExtrasFromMap(Map<String, String> newExtras) {
        this.extras = getExtrasFromMap(newExtras);
    }

    public String getValueForKeyFromExtras(String[] extras, String key) {
        for (int i = 0; extras != null && i < extras.length; i++) {
            if (extras[i] != null) {
                String[] currKey = extras[i].split("=");
                if (currKey.length == 2 && currKey[0].equals(key)) {
                    return currKey[1];
                }
            }
        }
        return null;
    }

    /**
     * @return string representation.
     */
    @Override
    public String toString() {
        String extrasResult = "";
        if (extras != null) {
            for (String s : extras) {
                extrasResult += s;
            }
        }
        return (" " + call_type
                + " " + call_domain
                + " " + extrasResult);
    }
}
+3 −3
Original line number Diff line number Diff line
@@ -561,7 +561,7 @@ public final class CallManager {
     * @exception CallStateException when call is not ringing or waiting
     */
    public void acceptCall(Call ringingCall) throws CallStateException {
        acceptCall(ringingCall, CallDetails.CALL_TYPE_VOICE);
        acceptCall(ringingCall, Phone.CALL_TYPE_VOICE);
    }

    /**
@@ -575,7 +575,7 @@ public final class CallManager {
     *
     * @param ringingCall The call to answer
     * @param callType The call type to use to answer the call. Values from
     *            CallDetails.RIL_CALL_TYPE
     *            Phone.RIL_CALL_TYPE
     * @exception CallStateException when call is not ringing or waiting
     */
    public void acceptCall(Call ringingCall, int callType) throws CallStateException {
@@ -810,7 +810,7 @@ public final class CallManager {
     * handled asynchronously.
     */
    public Connection dial(Phone phone, String dialString) throws CallStateException {
        return dial(phone, dialString, CallDetails.CALL_TYPE_VOICE, null);
        return dial(phone, dialString, Phone.CALL_TYPE_VOICE, null);
    }

    /**
+0 −57
Original line number Diff line number Diff line
/* Copyright (c) 2012, 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
 * met:
 *  * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above
 *       copyright notice, this list of conditions and the following
 *       disclaimer in the documentation and/or other materials provided
 *       with the distribution.
 *  * Neither the name of The Linux Foundation nor the names of its
 *       contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package com.android.internal.telephony;

public class CallModify {
    public int call_index;

    public CallDetails call_details;

    public CallModify() {
        call_index = 0;
        call_details = new CallDetails();
    }

    public CallModify(CallDetails callDetails, int callIndex) {
        call_index = callIndex;
        call_details = callDetails;
    }

    public void setCallDetails(CallDetails calldetails) {
        call_details = new CallDetails(calldetails);
    }

    /**
     * @return string representation.
     */
    @Override
    public String toString() {
        return (" " + call_index
                + " " + call_details);
    }
}
+63 −2
Original line number Diff line number Diff line
@@ -176,6 +176,67 @@ public interface Phone {
    public static final int CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED = 10;
    public static final int CDMA_OTA_PROVISION_STATUS_OTAPA_ABORTED = 11;

    /*
     * Type of the call based on the media type and the direction of the media.
     */

    public static final int CALL_TYPE_VOICE = 0; /*
                                                  * Voice call-audio in both
                                                  * directions
                                                  */

    public static final int CALL_TYPE_VT_TX = 1; /*
                                                  * PS Video telephony call: one
                                                  * way TX video, two way audio
                                                  */

    public static final int CALL_TYPE_VT_RX = 2; /*
                                                  * Video telephony call: one
                                                  * way RX video, two way audio
                                                  */

    public static final int CALL_TYPE_VT = 3; /*
                                               * Video telephony call: two way
                                               * video, two way audio
                                               */

    public static final int CALL_TYPE_VT_NODIR = 4; /*
                                                     * Video telephony call: no
                                                     * direction, two way audio,
                                                     * intermediate state in a
                                                     * video call till video
                                                     * link is setup
                                                     */

    public static final int CALL_TYPE_UNKNOWN = 10; /*
                                                     * Unknown Call type, may be
                                                     * used for answering call
                                                     * with same call type as
                                                     * incoming call. This is
                                                     * only for telephony, not
                                                     * meant to be passed to RIL
                                                     */

    public static final int CALL_DOMAIN_CS = 1; /*
                                                 * Circuit switched domain
                                                 */
    public static final int CALL_DOMAIN_PS = 2; /*
                                                 * Packet switched domain
                                                 */
    public static final int CALL_DOMAIN_AUTOMATIC = 3; /*
                                                        * Automatic domain. Sent
                                                        * by Android to indicate
                                                        * that the domain for a
                                                        * new call should be
                                                        * selected by modem
                                                        */
    public static final int CALL_DOMAIN_NOT_SET = 4; /*
                                                      * Init value used
                                                      * internally by telephony
                                                      * until domain is set
                                                      */

    public static final String EXTRAS_IS_CONFERENCE_URI = "isConferenceUri";

    /**
     * Get the current ServiceState. Use
@@ -638,7 +699,7 @@ public interface Phone {
    /**
     * Gets call type for IMS calls.
     *
     * @return one of the call types in {@link CallDetails}
     * @return one of the call types in {@link Phone}
     * @throws CallStateException
     */
    int getCallType(Call call) throws CallStateException;
@@ -646,7 +707,7 @@ public interface Phone {
    /**
     * Gets call domain for IMS calls.
     *
     * @return one of the call domains in {@link CallDetails}
     * @return one of the call domains in {@link Phone}
     * @throws CallStateException
     */
    int getCallDomain(Call call) throws CallStateException;