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

Commit e681be9b authored by fionaxu's avatar fionaxu
Browse files

clear mdn cache on SIM absent

mdn cache is not cleared on SIM absent. on SIM swap, getLine1Number
returns staled MDN of previous SIM util RUIM records loaded.
Fix is proactively clear mdn cache on SIM absent.

Bug: 67074980
Test: Manual
Change-Id: Ibb1815d27e9f5ee1704cc12c960ffc49d32669d8
parent 390628aa
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1306,8 +1306,11 @@ public class ServiceStateTracker extends Handler {
                break;

            case EVENT_SIM_NOT_INSERTED:
                if (DBG) log("EVENT_SIM_NOT_INSERTED, cancelling notifications.");
                if (DBG) log("EVENT_SIM_NOT_INSERTED");
                cancelAllNotifications();
                mMdn = null;
                mMin = null;
                mIsMinInfoReady = false;
                break;

            case EVENT_ALL_DATA_DISCONNECTED:
@@ -3864,6 +3867,7 @@ public class ServiceStateTracker extends Handler {
     * removed.
     */
    private void cancelAllNotifications() {
        if (DBG) log("setNotification: cancelAllNotifications");
        NotificationManager notificationManager = (NotificationManager)
                mPhone.getContext().getSystemService(Context.NOTIFICATION_SERVICE);
        notificationManager.cancelAll();