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

Commit e0a3cbcf authored by Jordan Liu's avatar Jordan Liu
Browse files

Do no try to unbind when unbound

This causes an illegal argument exception, so instead we will just skip
the operation if we know we're already unbound.

Bug: 144140043
Test: manually disable twice and see no crash
Change-Id: Idbb07c47dca43f3495703f983a7e2710ffa9dbe3
parent 083c03cc
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ public class CellBroadcastServiceManager {
    private static final int EVENT_NEW_GSM_SMS_CB = 0;
    private static final int EVENT_NEW_CDMA_SMS_CB = 1;
    private static final int EVENT_NEW_CDMA_SCP_MESSAGE = 2;
    private boolean mEnabled;
    private boolean mEnabled = false;

    public CellBroadcastServiceManager(Context context, Phone phone) {
        Log.d(TAG, "CellBroadcastServiceManager created for phone " + phone.getPhoneId());
@@ -111,6 +111,9 @@ public class CellBroadcastServiceManager {
     * Disable the CB module. The manager's handler will no longer receive CB messages from the RIL.
     */
    public void disable() {
        if (mEnabled == false) {
            return;
        }
        mEnabled = false;
        mPhone.mCi.unSetOnNewGsmBroadcastSms(mModuleCellBroadcastHandler);
        if (sServiceConnection.mService != null) {