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

Commit 5644b080 authored by Kenny Root's avatar Kenny Root
Browse files

Don't waste resources creating new Boolean objects

There's a static Boolean.TRUE and Boolean.FALSE that can be used without
instantiating a new Boolean object unnecessarily.

Change-Id: I30a6c6514faae0ebeb6b571bf741db6814b8cc78
parent 1bf397ff
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -934,13 +934,13 @@ public class CDMAPhone extends PhoneBase {
        switch(action) {
        case CANCEL_ECM_TIMER:
            removeCallbacks(mExitEcmRunnable);
            mEcmTimerResetRegistrants.notifyResult(new Boolean(true));
            mEcmTimerResetRegistrants.notifyResult(Boolean.TRUE);
            break;
        case RESTART_ECM_TIMER:
            long delayInMillis = SystemProperties.getLong(
                    TelephonyProperties.PROPERTY_ECM_EXIT_TIMER, DEFAULT_ECM_EXIT_TIMER_VALUE);
            postDelayed(mExitEcmRunnable, delayInMillis);
            mEcmTimerResetRegistrants.notifyResult(new Boolean(false));
            mEcmTimerResetRegistrants.notifyResult(Boolean.FALSE);
            break;
        default:
            Log.e(LOG_TAG, "handleTimerInEmergencyCallbackMode, unsupported action " + action);
+2 −2
Original line number Diff line number Diff line
@@ -101,12 +101,12 @@ abstract class SipPhoneBase extends PhoneBase {
    }

    protected void startRingbackTone() {
        AsyncResult result = new AsyncResult(null, new Boolean(true), null);
        AsyncResult result = new AsyncResult(null, Boolean.TRUE, null);
        mRingbackRegistrants.notifyRegistrants(result);
    }

    protected void stopRingbackTone() {
        AsyncResult result = new AsyncResult(null, new Boolean(false), null);
        AsyncResult result = new AsyncResult(null, Boolean.FALSE, null);
        mRingbackRegistrants.notifyRegistrants(result);
    }