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

Commit 82afd56d authored by Brad Ebinger's avatar Brad Ebinger Committed by Android (Google) Code Review
Browse files

Merge "Use new API to get query response for call line supp services."

parents bf31756a 16824295
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);
            }
        }