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

Commit fe76f264 authored by Peter Wang's avatar Peter Wang
Browse files

Remove unnecessary code and masking

The EXTRA is added in later
addExtrasToResultIntent method

Bug: 155433700
Test: Build
Change-Id: I5e2fee495210fc23d611350aa3c9c5e37e6ba58e
parent ed4731a7
Loading
Loading
Loading
Loading
+5 −10
Original line number Original line Diff line number Diff line
@@ -401,9 +401,6 @@ public class EuiccController extends IEuiccController.Stub {
                    break;
                    break;
                default:
                default:
                    resultCode = ERROR;
                    resultCode = ERROR;
                    extrasIntent.putExtra(
                            EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE,
                            result.getResult());
                    addExtrasToResultIntent(extrasIntent, result.getResult());
                    addExtrasToResultIntent(extrasIntent, result.getResult());
                    break;
                    break;
            }
            }
@@ -481,20 +478,19 @@ public class EuiccController extends IEuiccController.Stub {
     * b) {@link EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_SMDX_REASON_CODE} ->
     * b) {@link EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_SMDX_REASON_CODE} ->
     * ReasonCode[5.2.6.2] from GSMA (SGP.22 v2.2
     * ReasonCode[5.2.6.2] from GSMA (SGP.22 v2.2
     */
     */
    Intent addExtrasToResultIntent(Intent intent, int resultCode) {
    private void addExtrasToResultIntent(Intent intent, int resultCode) {
        final int firstByteBitOffset = 24;
        final int firstByteBitOffset = 24;
        int errorCodeMask = 0xFFFFFF;
        int errorCodeMask = 0xFFFFFF;
        int operationCodeMask = 0xFF << firstByteBitOffset;
        int operationCode = resultCode >>> firstByteBitOffset;


        intent.putExtra(
        intent.putExtra(
                EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE, resultCode);
                EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE, resultCode);


        intent.putExtra(EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_OPERATION_CODE,
        intent.putExtra(EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_OPERATION_CODE, operationCode);
                (resultCode & operationCodeMask) >> firstByteBitOffset);


        // check to see if the operation code is EuiccManager#OPERATION_SMDX_SUBJECT_REASON_CODE
        // check to see if the operation code is EuiccManager#OPERATION_SMDX_SUBJECT_REASON_CODE
        final boolean isSmdxSubjectReasonCode = (resultCode >> firstByteBitOffset)
        final boolean isSmdxSubjectReasonCode =
                == EuiccManager.OPERATION_SMDX_SUBJECT_REASON_CODE;
                (operationCode == EuiccManager.OPERATION_SMDX_SUBJECT_REASON_CODE);


        if (isSmdxSubjectReasonCode) {
        if (isSmdxSubjectReasonCode) {
            final Pair<String, String> subjectReasonCode = decodeSmdxSubjectAndReasonCode(
            final Pair<String, String> subjectReasonCode = decodeSmdxSubjectAndReasonCode(
@@ -508,7 +504,6 @@ public class EuiccController extends IEuiccController.Stub {
            final int errorCode = resultCode & errorCodeMask;
            final int errorCode = resultCode & errorCodeMask;
            intent.putExtra(EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_ERROR_CODE, errorCode);
            intent.putExtra(EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_ERROR_CODE, errorCode);
        }
        }
        return intent;
    }
    }


    void downloadSubscription(int cardId, DownloadableSubscription subscription,
    void downloadSubscription(int cardId, DownloadableSubscription subscription,