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

Commit 4d109837 authored by Jordan Liu's avatar Jordan Liu Committed by Gerrit Code Review
Browse files

Merge "Add logging for CellBroadcastServiceManager"

parents 72ce02c1 51af589f
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -99,8 +99,10 @@ public class CellBroadcastServiceManager {
    public void disable() {
        mEnabled = false;
        mPhone.mCi.unSetOnNewGsmBroadcastSms(mModuleCellBroadcastHandler);
        if (sServiceConnection.mService != null) {
            mContext.unbindService(sServiceConnection);
        }
    }

    /**
     * The CellBroadcastServiceManager binds to an implementation of the CellBroadcastService
@@ -154,7 +156,16 @@ public class CellBroadcastServiceManager {
            Intent intent = new Intent(CellBroadcastService.CELL_BROADCAST_SERVICE_INTERFACE);
            intent.setPackage(mCellBroadcastServicePackage);
            if (sServiceConnection.mService == null) {
                mContext.bindService(intent, sServiceConnection, Context.BIND_AUTO_CREATE);
                boolean serviceWasBound = mContext.bindService(intent, sServiceConnection,
                        Context.BIND_AUTO_CREATE);
                Log.d(TAG, "serviceWasBound=" + serviceWasBound);
                if (!serviceWasBound) {
                    Log.e(TAG, "Unable to bind to service");
                    mLocalLog.log("Unable to bind to service");
                    return;
                }
            } else {
                Log.d(TAG, "skipping bindService because connection already exists");
            }
            mPhone.mCi.setOnNewGsmBroadcastSms(mModuleCellBroadcastHandler, EVENT_NEW_GSM_SMS_CB,
                    null);
+2 −2
Original line number Diff line number Diff line
@@ -58,14 +58,12 @@ public class CdmaInboundSmsHandler extends InboundSmsHandler {
            com.android.internal.R.bool.config_duplicate_port_omadm_wappush);

    // When TEST_MODE is on we allow the test intent to trigger an SMS CB alert
    private static boolean sEnableCbModule = false;
    private static final boolean TEST_MODE = true; //STOPSHIP if true
    private static final String TEST_ACTION = "com.android.internal.telephony.cdma"
            + ".TEST_TRIGGER_CELL_BROADCAST";
    private static final String TOGGLE_CB_MODULE = "com.android.internal.telephony.cdma"
            + ".TOGGLE_CB_MODULE";


    /**
     * Create a new inbound SMS handler for CDMA.
     */
@@ -447,11 +445,13 @@ public class CdmaInboundSmsHandler extends InboundSmsHandler {
        @Override
        protected void handleToggleEnable() {
            // sEnableCbModule is already toggled in super class
            mCellBroadcastServiceManager.enable();
        }

        @Override
        protected void handleToggleDisable(Context context) {
            // sEnableCbModule is already toggled in super class
            mCellBroadcastServiceManager.disable();
        }
    }
}