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

Commit b1fa1094 authored by Arc Wang's avatar Arc Wang Committed by Gerrit Code Review
Browse files

Merge "Remove updatePhoneObject methods from SMS related objects."

parents b5ca45c2 7a8d95e2
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -184,11 +184,6 @@ public class IccSmsInterfaceManager {
        }
    }

    protected void updatePhoneObject(Phone phone) {
        mPhone = phone;
        mDispatchersController.updatePhoneObject(phone);
    }

    protected void enforceReceiveAndSend(String message) {
        mContext.enforceCallingOrSelfPermission(
                Manifest.permission.RECEIVE_SMS, message);
+2 −29
Original line number Diff line number Diff line
@@ -154,14 +154,11 @@ public abstract class InboundSmsHandler extends StateMachine {
    /** Sent by {@link SmsBroadcastUndelivered} after cleaning the raw table. */
    public static final int EVENT_START_ACCEPTING_SMS = 6;

    /** Update phone object */
    private static final int EVENT_UPDATE_PHONE_OBJECT = 7;

    /** New SMS received as an AsyncResult. */
    public static final int EVENT_INJECT_SMS = 8;
    public static final int EVENT_INJECT_SMS = 7;

    /** Update the sms tracker */
    public static final int EVENT_UPDATE_TRACKER = 9;
    public static final int EVENT_UPDATE_TRACKER = 8;

    /** Wakelock release delay when returning to idle state. */
    private static final int WAKELOCK_TIMEOUT = 3000;
@@ -271,13 +268,6 @@ public abstract class InboundSmsHandler extends StateMachine {
        quit();
    }

    /**
     * Update the phone object when it changes.
     */
    public void updatePhoneObject(Phone phone) {
        sendMessage(EVENT_UPDATE_PHONE_OBJECT, phone);
    }

    /**
     * Dispose of the WAP push object and release the wakelock.
     */
@@ -303,10 +293,6 @@ public abstract class InboundSmsHandler extends StateMachine {
        @Override
        public boolean processMessage(Message msg) {
            switch (msg.what) {
                case EVENT_UPDATE_PHONE_OBJECT: {
                    onUpdatePhoneObject((Phone) msg.obj);
                    break;
                }
                default: {
                    String errorText = "processMessage: unhandled message type " + msg.what +
                        " currState=" + getCurrentState().getName();
@@ -673,19 +659,6 @@ public abstract class InboundSmsHandler extends StateMachine {
    protected abstract void acknowledgeLastIncomingSms(boolean success,
            int result, Message response);

    /**
     * Called when the phone changes the default method updates mPhone
     * mStorageMonitor and mCellBroadcastHandler.updatePhoneObject.
     * Override if different or other behavior is desired.
     *
     * @param phone
     */
    protected void onUpdatePhoneObject(Phone phone) {
        mPhone = phone;
        mStorageMonitor = mPhone.mSmsStorageMonitor;
        log("onUpdatePhoneObject: phone=" + mPhone.getClass().getSimpleName());
    }

    /**
     * Notify interested apps if the framework has rejected an incoming SMS,
     * and send an acknowledge message to the network.
+0 −5
Original line number Diff line number Diff line
@@ -221,11 +221,6 @@ public abstract class SMSDispatcher extends Handler {
        }
    }

    protected void updatePhoneObject(Phone phone) {
        mPhone = phone;
        Rlog.d(TAG, "Active phone changed to " + mPhone.getPhoneName() );
    }

    /** Unregister for incoming SMS events. */
    public void dispose() {
        mContext.getContentResolver().unregisterContentObserver(mSettingsObserver);
+0 −9
Original line number Diff line number Diff line
@@ -104,15 +104,6 @@ public class SmsDispatchersController extends Handler {
        mCi.registerForImsNetworkStateChanged(this, EVENT_IMS_STATE_CHANGED, null);
    }

    /* Updates the phone object when there is a change */
    protected void updatePhoneObject(Phone phone) {
        Rlog.d(TAG, "In IMS updatePhoneObject ");
        mCdmaDispatcher.updatePhoneObject(phone);
        mGsmDispatcher.updatePhoneObject(phone);
        mGsmInboundSmsHandler.updatePhoneObject(phone);
        mCdmaInboundSmsHandler.updatePhoneObject(phone);
    }

    public void dispose() {
        mCi.unregisterForOn(this);
        mCi.unregisterForImsNetworkStateChanged(this);
+0 −11
Original line number Diff line number Diff line
@@ -48,8 +48,6 @@ public abstract class WakeLockStateMachine extends StateMachine {
    /** Release wakelock after a short timeout when returning to idle state. */
    static final int EVENT_RELEASE_WAKE_LOCK = 3;

    static final int EVENT_UPDATE_PHONE_OBJECT = 4;

    protected Phone mPhone;

    protected Context mContext;
@@ -77,10 +75,6 @@ public abstract class WakeLockStateMachine extends StateMachine {
        setInitialState(mIdleState);
    }

    public void updatePhoneObject(Phone phone) {
        sendMessage(EVENT_UPDATE_PHONE_OBJECT, phone);
    }

    /**
     * Tell the state machine to quit after processing all messages.
     */
@@ -112,11 +106,6 @@ public abstract class WakeLockStateMachine extends StateMachine {
        @Override
        public boolean processMessage(Message msg) {
            switch (msg.what) {
                case EVENT_UPDATE_PHONE_OBJECT: {
                    mPhone = (Phone) msg.obj;
                    log("updatePhoneObject: phone=" + mPhone.getClass().getSimpleName());
                    break;
                }
                default: {
                    String errorText = "processMessage: unhandled message type " + msg.what;
                    if (Build.IS_DEBUGGABLE) {
Loading