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

Commit b48c51eb authored by Vineeta Srivastava's avatar Vineeta Srivastava Committed by Android (Google) Code Review
Browse files

Merge "UICC : add support empty alpha id for BIP" into klp-dev

parents 9894b3fb d7e83ff0
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources.NotFoundException;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.HandlerThread;
@@ -293,12 +294,28 @@ public class CatService extends Handler implements AppInterface {
            case RECEIVE_DATA:
            case SEND_DATA:
                BIPClientParams cmd = (BIPClientParams) cmdParams;
                if (cmd.mHasAlphaId && (cmd.mTextMsg.text == null)) {
                /* Per 3GPP specification 102.223,
                 * if the alpha identifier is not provided by the UICC,
                 * the terminal MAY give information to the user
                 * noAlphaUsrCnf defines if you need to show user confirmation or not
                 */
                boolean noAlphaUsrCnf = false;
                try {
                    noAlphaUsrCnf = mContext.getResources().getBoolean(
                            com.android.internal.R.bool.config_stkNoAlphaUsrCnf);
                } catch (NotFoundException e) {
                    noAlphaUsrCnf = false;
                }
                if ((cmd.mTextMsg.text == null) && (cmd.mHasAlphaId || noAlphaUsrCnf)) {
                    CatLog.d(this, "cmd " + cmdParams.getCommandType() + " with null alpha id");
                    // If alpha length is zero, we just respond with OK.
                    if (isProactiveCmd) {
                        if (cmdParams.getCommandType() == CommandType.OPEN_CHANNEL) {
                            mCmdIf.handleCallSetupRequestFromSim(true, null);
                        } else {
                            sendTerminalResponse(cmdParams.mCmdDet, ResultCode.OK, false, 0, null);
                        }
                    }
                    return;
                }
                // Respond with permanent failure to avoid retry if STK app is not present.
+17 −1
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import com.android.internal.telephony.GsmAlphabet;
import com.android.internal.telephony.cat.Duration.TimeUnit;
import com.android.internal.telephony.uicc.IccUtils;

import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
@@ -285,10 +287,24 @@ abstract class ValueParser {
                    throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD);
                }
            } else {
                CatLog.d("ValueParser", "Alpha Id length=" + length);
                return null;
            }
        } else {
            return CatService.STK_DEFAULT;
            /* Per 3GPP specification 102.223,
             * if the alpha identifier is not provided by the UICC,
             * the terminal MAY give information to the user
             * noAlphaUsrCnf defines if you need to show user confirmation or not
             */
            boolean noAlphaUsrCnf = false;
            Resources resource = Resources.getSystem();
            try {
                noAlphaUsrCnf = resource.getBoolean(
                        com.android.internal.R.bool.config_stkNoAlphaUsrCnf);
            } catch (NotFoundException e) {
                noAlphaUsrCnf = false;
            }
            return (noAlphaUsrCnf ? null : CatService.STK_DEFAULT);
        }
    }