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

Commit 124569fe authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Always show emergency notification while UE is registered over WFC"

parents b1d701d9 842d9f97
Loading
Loading
Loading
Loading
+6 −13
Original line number Diff line number Diff line
@@ -170,13 +170,6 @@ public class CarrierServiceStateTracker extends Handler {
                || mSST.mSS.getDataRegState() == ServiceState.STATE_IN_SERVICE);
    }

    private boolean isPhoneVoiceRegistered() {
        if (mSST.mSS == null) {
            return true; //something has gone wrong, return true and not show the notification.
        }
        return (mSST.mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE);
    }

    private boolean isPhoneRegisteredForWifiCalling() {
        Rlog.d(LOG_TAG, "isPhoneRegisteredForWifiCalling: " + mPhone.isWifiCallingEnabled());
        return mPhone.isWifiCallingEnabled();
@@ -456,8 +449,8 @@ public class CarrierServiceStateTracker extends Handler {
    }

    /**
     * Class that defines the emergency notification, which is shown when the user is out of cell
     * connectivity, but has wifi enabled.
     * Class that defines the emergency notification, which is shown when Wi-Fi Calling is
     * available.
     */
    public class EmergencyNetworkNotification implements NotificationType {

@@ -502,10 +495,9 @@ public class CarrierServiceStateTracker extends Handler {
         */
        public boolean sendMessage() {
            Rlog.i(LOG_TAG, "EmergencyNetworkNotification: sendMessage() w/values: "
                    + "," + isPhoneVoiceRegistered() + "," + mDelay + ","
                    + isPhoneRegisteredForWifiCalling() + "," + mSST.isRadioOn());
            if (mDelay == UNINITIALIZED_DELAY_VALUE || isPhoneVoiceRegistered()
                    || !isPhoneRegisteredForWifiCalling()) {
                    + "," + mDelay + "," + isPhoneRegisteredForWifiCalling() + ","
                    + mSST.isRadioOn());
            if (mDelay == UNINITIALIZED_DELAY_VALUE || !isPhoneRegisteredForWifiCalling()) {
                return false;
            }
            return true;
@@ -525,6 +517,7 @@ public class CarrierServiceStateTracker extends Handler {
                    .setContentTitle(title)
                    .setStyle(new Notification.BigTextStyle().bigText(details))
                    .setContentText(details)
                    .setFlag(Notification.FLAG_NO_CLEAR, true)
                    .setChannelId(NotificationChannelController.CHANNEL_ID_WFC);
        }
    }
+0 −1
Original line number Diff line number Diff line
@@ -187,7 +187,6 @@ public class CarrierServiceStateTrackerTest extends TelephonyTest {
        notificationTypeMap.put(CarrierServiceStateTracker.NOTIFICATION_EMERGENCY_NETWORK,
                spyEmergencyNetworkNotification);
        Notification.Builder mNotificationBuilder = new Notification.Builder(mContext);
        doReturn(ServiceState.STATE_OUT_OF_SERVICE).when(mSST.mSS).getVoiceRegState();
        doReturn(mNotificationBuilder).when(spyEmergencyNetworkNotification)
                .getNotificationBuilder();