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

Commit 9e969a91 authored by Youming Ye's avatar Youming Ye Committed by Xiangyu/Malcolm Chen
Browse files

Fix the radio on handling logic.

Fix the listener logic for Radio on message.

Bug: 129497722
Change-Id: Ie73716a1a5125da93e6f5deac1692853c05bed78
Merged-In: Ie73716a1a5125da93e6f5deac1692853c05bed78
Test: Build
(cherry picked from commit 4292533c)
parent c182c2e8
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -130,14 +130,14 @@ public class PhoneConfigurationManager {
                case Phone.EVENT_RADIO_AVAILABLE:
                case Phone.EVENT_RADIO_ON:
                    log("Received EVENT_RADIO_AVAILABLE/EVENT_RADIO_ON");
                    if (msg.obj instanceof Phone) {
                        phone = (Phone) msg.obj;
                    }
                    if (phone == null) {
                    ar = (AsyncResult) msg.obj;
                    if (ar.userObj != null && ar.userObj instanceof Phone) {
                        phone = (Phone) ar.userObj;
                        updatePhoneStatus(phone);
                    } else {
                        // phone is null
                        log("Unable to add phoneStatus to cache. "
                                + "No phone object provided for event " + msg.what);
                    } else {
                        updatePhoneStatus(phone);
                    }
                    getStaticPhoneCapability();
                    break;
@@ -196,7 +196,7 @@ public class PhoneConfigurationManager {
     */
    public boolean getPhoneStatus(Phone phone) {
        if (phone == null) {
            log("getPhonetatus failed phone is null");
            log("getPhoneStatus failed phone is null");
            return false;
        }

@@ -206,9 +206,11 @@ public class PhoneConfigurationManager {
        if (mPhoneStatusMap.containsKey(phoneId)) {
            return mPhoneStatusMap.get(phoneId);
        } else {
            //return false if modem status is not in cache
            updatePhoneStatus(phone);
            return false;
            // Return true if modem status is not in cache. For most of case, modem status
            // is on. And for older version modems, GET_MODEM_STATUS and disable modem are not
            // supported. Modem is always on.
            return true;
        }
    }