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

Commit 242502e5 authored by Stanley Wang's avatar Stanley Wang
Browse files

Fix WiFi calling option is showing in search result regardless the carrier supports VoWiFi or not

Change Availability Status to UNSUPPORTED_ON_DEVICE when device doesn't
support VoWiFi.

Change-Id: I8ac501cf7442f1cd7d41f61d2db912d82a9e8c25
Fixes: 120806624
Test: manual and robotests
parent 637c874d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ public class WifiCallingPreferenceController extends BasePreferenceController im
                && MobileNetworkUtils.isWifiCallingEnabled(mContext,
                SubscriptionManager.getPhoneId(mSubId))
                ? AVAILABLE
                : CONDITIONALLY_UNAVAILABLE;
                : UNSUPPORTED_ON_DEVICE;
    }

    @Override
+9 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import androidx.preference.PreferenceScreen;

import com.android.ims.ImsConfig;
import com.android.ims.ImsManager;
import com.android.settings.core.BasePreferenceController;

import org.junit.Before;
import org.junit.Test;
@@ -109,4 +110,12 @@ public class WifiCallingPreferenceControllerTest {

        assertThat(mPreferenceCategory.isVisible()).isFalse();
    }

    @Test
    public void getAvailabilityStatus_noWiFiCalling_shouldReturnUnsupported() {
        mController.init(SubscriptionManager.INVALID_SUBSCRIPTION_ID);

        assertThat(mController.getAvailabilityStatus()).isEqualTo(
                BasePreferenceController.UNSUPPORTED_ON_DEVICE);
    }
}