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

Commit 1433ebc9 authored by fionaxu's avatar fionaxu
Browse files

hide restricted notification from unregistered nw

under poor cell coverage, devices might roams to other
network with unregistered service. We should not handle
those invalid restricted service indications from uncamped
networks. Add condition check before showing the notification

Bug: 70168086
Test: Build
Change-Id: I07637ccdbacff494038d4fc758904c430d7e6817
(cherry picked from commit 41babf58c972b97bdea4c02ae18c3f5718af7891)
Merged-in: I07637ccdbacff494038d4fc758904c430d7e6817
parent fdeaaeca
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -3586,10 +3586,25 @@ public class ServiceStateTracker extends Handler {
            // cancel previous post notification
            notificationManager.cancel(Integer.toString(mSubId), notificationId);
        } else {
            boolean show = false;
            if (mNewSS.isEmergencyOnly() && notifyType == CS_EMERGENCY_ENABLED) {
                // if reg state is emergency only, always show restricted emergency notification.
                show = true;
            } else if (notifyType == CS_REJECT_CAUSE_ENABLED) {
                // always show notification due to CS reject irrespective of service state.
                show = true;
            } else if (mNewSS.getState() == ServiceState.STATE_IN_SERVICE) {
                // for non in service states, we have system UI and signal bar to indicate limited
                // service. No need to show notification again. This also helps to mitigate the
                // issue if phone go to OOS and camp to other networks and received restricted ind.
                show = true;
            }
            // update restricted state notification for this subId
            if (show) {
                notificationManager.notify(Integer.toString(mSubId), notificationId, mNotification);
            }
        }
    }

    /**
     * Selects the resource ID, which depends on rejection cause that is sent by the network when CS