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

Commit c7f53702 authored by Amit Mahajan's avatar Amit Mahajan Committed by android-build-merger
Browse files

Merge "Improve debug loggin in carrier sms filter." am: a2d3b137

am: 2396f69e

Change-Id: I24284a896bc1691f0f8ee83a51b0842800ba382a
parents 763ba04c 2396f69e
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -238,6 +238,7 @@ public class CarrierServicesSmsFilter {
        @Override
        @Override
        protected void onServiceReady(ICarrierMessagingService carrierMessagingService) {
        protected void onServiceReady(ICarrierMessagingService carrierMessagingService) {
            try {
            try {
                log("onServiceReady: calling filterSms");
                carrierMessagingService.filterSms(
                carrierMessagingService.filterSms(
                        new MessagePdu(Arrays.asList(mPdus)), mSmsFormat, mDestPort,
                        new MessagePdu(Arrays.asList(mPdus)), mSmsFormat, mDestPort,
                        mPhone.getSubId(), mSmsFilterCallback);
                        mPhone.getSubId(), mSmsFilterCallback);
@@ -270,6 +271,7 @@ public class CarrierServicesSmsFilter {
         */
         */
        @Override
        @Override
        public void onFilterComplete(int result) {
        public void onFilterComplete(int result) {
            log("onFilterComplete called with result: " + result);
            // in the case that timeout has already passed and triggered, but the initial callback
            // in the case that timeout has already passed and triggered, but the initial callback
            // is run afterwards, we should not follow through
            // is run afterwards, we should not follow through
            if (!mIsOnFilterCompleteCalled) {
            if (!mIsOnFilterCompleteCalled) {
@@ -328,8 +330,10 @@ public class CarrierServicesSmsFilter {
                    }
                    }
                    //all onFilterCompletes called before timeout has triggered
                    //all onFilterCompletes called before timeout has triggered
                    //remove the pending message
                    //remove the pending message
                    log("onFilterComplete called successfully with result = " + result);
                    log("onFilterComplete: called successfully with result = " + result);
                    mCallbackTimeoutHandler.removeMessages(EVENT_ON_FILTER_COMPLETE_NOT_CALLED);
                    mCallbackTimeoutHandler.removeMessages(EVENT_ON_FILTER_COMPLETE_NOT_CALLED);
                } else {
                    log("onFilterComplete: waiting for pending filters " + mNumPendingFilters);
                }
                }
            }
            }
        }
        }
@@ -365,6 +369,7 @@ public class CarrierServicesSmsFilter {


        private void handleFilterCallbacksTimeout() {
        private void handleFilterCallbacksTimeout() {
            for (CarrierSmsFilterCallback callback : mFilterAggregator.mCallbacks) {
            for (CarrierSmsFilterCallback callback : mFilterAggregator.mCallbacks) {
                log("handleFilterCallbacksTimeout: calling onFilterComplete");
                callback.onFilterComplete(CarrierMessagingService.RECEIVE_OPTIONS_DEFAULT);
                callback.onFilterComplete(CarrierMessagingService.RECEIVE_OPTIONS_DEFAULT);
            }
            }
        }
        }