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

Commit 3771a7e6 authored by Peter Wang's avatar Peter Wang Committed by Automerger Merge Worker
Browse files

Merge "Remove unnecessary code and masking" into rvc-dev am: 256a392f

Change-Id: I4f508a5bfd2d45f5a4730b1b810576b9f9c03424
parents a2121ab0 256a392f
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -404,9 +404,6 @@ public class EuiccController extends IEuiccController.Stub {
                    break;
                default:
                    resultCode = ERROR;
                    extrasIntent.putExtra(
                            EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE,
                            result.getResult());
                    addExtrasToResultIntent(extrasIntent, result.getResult());
                    break;
            }
@@ -484,20 +481,19 @@ public class EuiccController extends IEuiccController.Stub {
     * b) {@link EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_SMDX_REASON_CODE} ->
     * 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;
        int errorCodeMask = 0xFFFFFF;
        int operationCodeMask = 0xFF << firstByteBitOffset;
        int operationCode = resultCode >>> firstByteBitOffset;

        intent.putExtra(
                EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE, resultCode);

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

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

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

    void downloadSubscription(int cardId, DownloadableSubscription subscription,