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

Commit 0dc40008 authored by Chao Liu's avatar Chao Liu Committed by Android Git Automerger
Browse files

am 6e6dff5d: Merge "Store the optional vendor cause string returned by RIL in...

am 6e6dff5d: Merge "Store the optional vendor cause string returned by RIL in telephony Connection object. We\'ll pass it to Telecom, which could be used by clients." into mnc-dev

* commit '6e6dff5d':
  Store the optional vendor cause string returned by RIL in telephony Connection object. We'll pass it to Telecom, which could be used by clients.
parents fa2bd6e5 6e6dff5d
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -256,6 +256,15 @@ public abstract class Connection {
     */
     */
    public abstract int getDisconnectCause();
    public abstract int getDisconnectCause();


    /**
     * Returns a string disconnect cause which is from vendor.
     * Vendors may use this string to explain the underline causes of failed calls.
     * There is no guarantee that it is non-null nor it'll have meaningful stable values.
     * Only use it when getDisconnectCause() returns a value that is not specific enough, like
     * ERROR_UNSPECIFIED.
     */
    public abstract String getVendorDisconnectCause();

    /**
    /**
     * Returns true of this connection originated elsewhere
     * Returns true of this connection originated elsewhere
     * ("MT" or mobile terminated; another party called this terminal)
     * ("MT" or mobile terminated; another party called this terminal)
+29 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.internal.telephony;

public class LastCallFailCause {
  public int causeCode;
  public String vendorCause;

    @Override
    public String toString() {
        return super.toString()
            + " causeCode: " + causeCode
            + " vendorCause: " + vendorCause;
    }
}
+10 −1
Original line number Original line Diff line number Diff line
@@ -2482,7 +2482,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
            case RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE: ret =  responseVoid(p); break;
            case RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE: ret =  responseVoid(p); break;
            case RIL_REQUEST_CONFERENCE: ret =  responseVoid(p); break;
            case RIL_REQUEST_CONFERENCE: ret =  responseVoid(p); break;
            case RIL_REQUEST_UDUB: ret =  responseVoid(p); break;
            case RIL_REQUEST_UDUB: ret =  responseVoid(p); break;
            case RIL_REQUEST_LAST_CALL_FAIL_CAUSE: ret =  responseInts(p); break;
            case RIL_REQUEST_LAST_CALL_FAIL_CAUSE: ret =  responseFailCause(p); break;
            case RIL_REQUEST_SIGNAL_STRENGTH: ret =  responseSignalStrength(p); break;
            case RIL_REQUEST_SIGNAL_STRENGTH: ret =  responseSignalStrength(p); break;
            case RIL_REQUEST_VOICE_REGISTRATION_STATE: ret =  responseStrings(p); break;
            case RIL_REQUEST_VOICE_REGISTRATION_STATE: ret =  responseStrings(p); break;
            case RIL_REQUEST_DATA_REGISTRATION_STATE: ret =  responseStrings(p); break;
            case RIL_REQUEST_DATA_REGISTRATION_STATE: ret =  responseStrings(p); break;
@@ -3310,6 +3310,15 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return response;
        return response;
    }
    }


    private Object
    responseFailCause(Parcel p) {
        LastCallFailCause failCause = new LastCallFailCause();
        failCause.causeCode = p.readInt();
        if (p.dataAvail() > 0) {
          failCause.vendorCause = p.readString();
        }
        return failCause;
    }


    private Object
    private Object
    responseVoid(Parcel p) {
    responseVoid(Parcel p) {
+6 −2
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@ import com.android.internal.telephony.CallTracker;
import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.DriverCall;
import com.android.internal.telephony.DriverCall;
import com.android.internal.telephony.LastCallFailCause;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneBase;
import com.android.internal.telephony.PhoneBase;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneConstants;
@@ -1013,6 +1014,7 @@ public final class CdmaCallTracker extends CallTracker {


            case EVENT_GET_LAST_CALL_FAIL_CAUSE:
            case EVENT_GET_LAST_CALL_FAIL_CAUSE:
                int causeCode;
                int causeCode;
                String vendorCause = null;
                ar = (AsyncResult)msg.obj;
                ar = (AsyncResult)msg.obj;


                operationComplete();
                operationComplete();
@@ -1024,7 +1026,9 @@ public final class CdmaCallTracker extends CallTracker {
                    Rlog.i(LOG_TAG,
                    Rlog.i(LOG_TAG,
                            "Exception during getLastCallFailCause, assuming normal disconnect");
                            "Exception during getLastCallFailCause, assuming normal disconnect");
                } else {
                } else {
                    causeCode = ((int[])ar.result)[0];
                    LastCallFailCause failCause = (LastCallFailCause)ar.result;
                    causeCode = failCause.causeCode;
                    vendorCause = failCause.vendorCause;
                }
                }


                for (int i = 0, s =  mDroppedDuringPoll.size()
                for (int i = 0, s =  mDroppedDuringPoll.size()
@@ -1032,7 +1036,7 @@ public final class CdmaCallTracker extends CallTracker {
                ) {
                ) {
                    CdmaConnection conn = mDroppedDuringPoll.get(i);
                    CdmaConnection conn = mDroppedDuringPoll.get(i);


                    conn.onRemoteDisconnect(causeCode);
                    conn.onRemoteDisconnect(causeCode, vendorCause);
                }
                }


                updatePhoneState();
                updatePhoneState();
+9 −1
Original line number Original line Diff line number Diff line
@@ -64,6 +64,7 @@ public class CdmaConnection extends Connection {
    int mCause = DisconnectCause.NOT_DISCONNECTED;
    int mCause = DisconnectCause.NOT_DISCONNECTED;
    PostDialState mPostDialState = PostDialState.NOT_STARTED;
    PostDialState mPostDialState = PostDialState.NOT_STARTED;
    int mPreciseCause = 0;
    int mPreciseCause = 0;
    String mVendorCause;


    Handler mHandler;
    Handler mHandler;


@@ -323,6 +324,7 @@ public class CdmaConnection extends Connection {
    onHangupLocal() {
    onHangupLocal() {
        mCause = DisconnectCause.LOCAL;
        mCause = DisconnectCause.LOCAL;
        mPreciseCause = 0;
        mPreciseCause = 0;
        mVendorCause = null;
    }
    }


    /**
    /**
@@ -400,8 +402,9 @@ public class CdmaConnection extends Connection {
    }
    }


    /*package*/ void
    /*package*/ void
    onRemoteDisconnect(int causeCode) {
    onRemoteDisconnect(int causeCode, String vendorCause) {
        this.mPreciseCause = causeCode;
        this.mPreciseCause = causeCode;
        this.mVendorCause = vendorCause;
        onDisconnect(disconnectCauseFromCode(causeCode));
        onDisconnect(disconnectCauseFromCode(causeCode));
    }
    }


@@ -935,6 +938,11 @@ public class CdmaConnection extends Connection {
        return mPreciseCause;
        return mPreciseCause;
    }
    }


    @Override
    public String getVendorDisconnectCause() {
        return mVendorCause;
    }

    @Override
    @Override
    public Connection getOrigConnection() {
    public Connection getOrigConnection() {
        return null;
        return null;
Loading