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

Commit 34803510 authored by Rakesh Pallerla's avatar Rakesh Pallerla Committed by dhacker29
Browse files

Do not update External state until we receive card status.

When updateExternalState is called before card state is received
from RIL, unwanted ABSENT state is getting broadcasted to
external apps incase of property apm_sim_not_pwdn is  set to 1.

So do not broadcast card state to external apps until we
receive card status from RIL atlease once.

CRs-Fixed: 520485
Change-Id: I8803360dd57055ca3534b6dc7bade63ff629c730
parent f2c1ee61
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ public class IccCardProxy extends Handler implements IccCard {
    private boolean mQuietMode = false; // when set to true IccCardProxy will not broadcast
                                        // ACTION_SIM_STATE_CHANGED intents
    private boolean mInitialized = false;
    private boolean mIsCardStatusAvailable = false;
    private State mExternalState = State.UNKNOWN;

    public IccCardProxy(Context context, CommandsInterface ci) {
@@ -237,7 +238,8 @@ public class IccCardProxy extends Handler implements IccCard {
                    + mCurrentAppType + " cdmaSource=" + cdmaSource + ")");
            }
            mInitialized = true;
            sendMessage(obtainMessage(EVENT_ICC_CHANGED));
            //Send EVENT_ICC_CHANGED only if it is already received atleast once from RIL.
            if (mIsCardStatusAvailable) sendMessage(obtainMessage(EVENT_ICC_CHANGED));
        }
    }

@@ -254,6 +256,7 @@ public class IccCardProxy extends Handler implements IccCard {
                }
                break;
            case EVENT_ICC_CHANGED:
                mIsCardStatusAvailable = true;
                if (mInitialized) {
                    updateIccAvailability();
                }