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

Commit 737964df authored by Brad Ebinger's avatar Brad Ebinger Committed by android-build-merger
Browse files

Use new API to get query response for call line supp services. am: ca316456

am: 853cd2e1

Change-Id: Ib691a74e24c4bfb0e37b8d8bd1d3fc5b8fab90c6
parents 68baef8b 853cd2e1
Loading
Loading
Loading
Loading
+28 −4
Original line number Diff line number Diff line
@@ -31,9 +31,11 @@ import android.telephony.ims.ImsCallForwardInfo;
import android.telephony.ims.ImsReasonInfo;
import android.telephony.ims.ImsSsData;
import android.telephony.ims.ImsSsInfo;
import android.telephony.ims.ImsUtListener;

import com.android.ims.internal.IImsUt;
import com.android.ims.internal.IImsUtListener;
import com.android.internal.annotations.VisibleForTesting;

/**
 * Provides APIs for the supplementary service settings using IMS (Ut interface).
@@ -645,7 +647,8 @@ public class ImsUt implements ImsUtInterface {
    /**
     * A listener type for the result of the supplementary service configuration.
     */
    private class IImsUtListenerProxy extends IImsUtListener.Stub {
    @VisibleForTesting
    public class IImsUtListenerProxy extends IImsUtListener.Stub {
        /**
         * Notifies the result of the supplementary service configuration udpate.
         */
@@ -672,13 +675,34 @@ public class ImsUt implements ImsUtInterface {
        /**
         * Notifies the result of the supplementary service configuration query.
         */
        // API Deprecated, internally use new API to process query result.
        @Override
        public void utConfigurationQueried(IImsUt ut, int id, Bundle ssInfo) {
            Integer key = Integer.valueOf(id);
            int[] clirResponse = ssInfo.getIntArray(ImsUtListener.BUNDLE_KEY_CLIR);
            if (clirResponse != null && clirResponse.length == 2) {
                // Deprecated functionality does not use status, set as NOT_REGISTERED.
                ImsSsInfo info = new ImsSsInfo.Builder(ImsSsInfo.NOT_REGISTERED)
                        .setClirOutgoingState(clirResponse[0])
                        .setClirInterrogationStatus(clirResponse[1]).build();
                lineIdentificationSupplementaryServiceResponse(id, info);
                return;
            }
            ImsSsInfo info = ssInfo.getParcelable(ImsUtListener.BUNDLE_KEY_SSINFO);
            if (info != null) {
                lineIdentificationSupplementaryServiceResponse(id, info);
                return;
            }
            Rlog.w(TAG, "Invalid utConfigurationQueried response received for Bundle " + ssInfo);
        }

        /**
         * Notifies the result of a line identification supplementary service query.
         */
        @Override
        public void lineIdentificationSupplementaryServiceResponse(int id, ImsSsInfo config) {
            synchronized(mLockObj) {
                sendSuccessReport(mPendingCmds.get(key), ssInfo);
                mPendingCmds.remove(key);
                sendSuccessReport(mPendingCmds.get(id), config);
                mPendingCmds.remove(id);
            }
        }