Loading src/java/com/android/internal/telephony/DefaultPhoneNotifier.java +3 −3 Original line number Diff line number Diff line Loading @@ -25,11 +25,11 @@ import android.telephony.BarringInfo; import android.telephony.CallQuality; import android.telephony.CellIdentity; import android.telephony.CellInfo; import android.telephony.DisplayInfo; import android.telephony.PhoneCapability; import android.telephony.PreciseCallState; import android.telephony.PreciseDataConnectionState; import android.telephony.ServiceState; import android.telephony.TelephonyDisplayInfo; import android.telephony.TelephonyManager; import android.telephony.TelephonyRegistryManager; import android.telephony.data.ApnSetting; Loading Loading @@ -202,9 +202,9 @@ public class DefaultPhoneNotifier implements PhoneNotifier { } @Override public void notifyDisplayInfoChanged(Phone sender, DisplayInfo displayInfo) { public void notifyDisplayInfoChanged(Phone sender, TelephonyDisplayInfo telephonyDisplayInfo) { mTelephonyRegistryMgr.notifyDisplayInfoChanged(sender.getPhoneId(), sender.getSubId(), displayInfo); telephonyDisplayInfo); } @Override Loading src/java/com/android/internal/telephony/Phone.java +3 −3 Original line number Diff line number Diff line Loading @@ -47,7 +47,6 @@ import android.telephony.CarrierRestrictionRules; import android.telephony.CellIdentity; import android.telephony.CellInfo; import android.telephony.ClientRequestStats; import android.telephony.DisplayInfo; import android.telephony.ImsiEncryptionInfo; import android.telephony.PhoneStateListener; import android.telephony.PhysicalChannelConfig; Loading @@ -57,6 +56,7 @@ import android.telephony.RadioAccessSpecifier; import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.SubscriptionManager; import android.telephony.TelephonyDisplayInfo; import android.telephony.TelephonyManager; import android.telephony.data.ApnSetting; import android.telephony.emergency.EmergencyNumber; Loading Loading @@ -2416,8 +2416,8 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { } /** Send notification that display info has changed. */ public void notifyDisplayInfoChanged(DisplayInfo displayInfo) { mNotifier.notifyDisplayInfoChanged(this, displayInfo); public void notifyDisplayInfoChanged(TelephonyDisplayInfo telephonyDisplayInfo) { mNotifier.notifyDisplayInfoChanged(this, telephonyDisplayInfo); } public void notifySignalStrength() { Loading src/java/com/android/internal/telephony/PhoneNotifier.java +2 −2 Original line number Diff line number Diff line Loading @@ -25,9 +25,9 @@ import android.telephony.BarringInfo; import android.telephony.CallQuality; import android.telephony.CellIdentity; import android.telephony.CellInfo; import android.telephony.DisplayInfo; import android.telephony.PhoneCapability; import android.telephony.PreciseDataConnectionState; import android.telephony.TelephonyDisplayInfo; import android.telephony.emergency.EmergencyNumber; import android.telephony.ims.ImsReasonInfo; Loading Loading @@ -88,7 +88,7 @@ public interface PhoneNotifier { void notifyUserMobileDataStateChanged(Phone sender, boolean state); /** Send a notification that the display info has changed */ void notifyDisplayInfoChanged(Phone sender, DisplayInfo displayInfo); void notifyDisplayInfoChanged(Phone sender, TelephonyDisplayInfo telephonyDisplayInfo); /** Send a notification that the phone capability has changed */ void notifyPhoneCapabilityChanged(PhoneCapability capability); Loading src/java/com/android/internal/telephony/dataconnection/DcTracker.java +19 −18 Original line number Diff line number Diff line Loading @@ -72,7 +72,6 @@ import android.telephony.Annotation.NetworkType; import android.telephony.CarrierConfigManager; import android.telephony.CellLocation; import android.telephony.DataFailCause; import android.telephony.DisplayInfo; import android.telephony.NetworkRegistrationInfo; import android.telephony.PcoData; import android.telephony.PreciseDataConnectionState; Loading @@ -81,6 +80,7 @@ import android.telephony.ServiceState.RilRadioTechnology; import android.telephony.SubscriptionManager; import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener; import android.telephony.SubscriptionPlan; import android.telephony.TelephonyDisplayInfo; import android.telephony.TelephonyFrameworkInitializer; import android.telephony.TelephonyManager; import android.telephony.cdma.CdmaCellLocation; Loading Loading @@ -335,8 +335,8 @@ public class DcTracker extends Handler { /* Used to check whether phone was recently connected to 5G. */ private boolean m5GWasConnected = false; /* Used to determine DisplayInfo to send to SysUI. */ private DisplayInfo mDisplayInfo = null; /* Used to determine TelephonyDisplayInfo to send to SysUI. */ private TelephonyDisplayInfo mTelephonyDisplayInfo = null; private final Map<String, Integer> m5GIconMapping = new HashMap<>(); private String mDataIconPattern = ""; Loading Loading @@ -3850,7 +3850,7 @@ public class DcTracker extends Handler { if (!reevaluateUnmeteredConnections()) { // always update on ServiceState changed so MobileSignalController gets // accurate display info mPhone.notifyDisplayInfoChanged(mDisplayInfo); mPhone.notifyDisplayInfoChanged(mTelephonyDisplayInfo); } break; case DctConstants.EVENT_5G_TIMER_HYSTERESIS: Loading Loading @@ -3993,11 +3993,11 @@ public class DcTracker extends Handler { if (DBG) log("Invalid 5G icon configuration, config = " + pair); continue; } int value = DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; int value = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; if (kv[1].equals("5g")) { value = DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA; value = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA; } else if (kv[1].equals("5g_plus")) { value = DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE; value = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE; } m5GIconMapping.put(kv[0], value); } Loading Loading @@ -4192,13 +4192,13 @@ public class DcTracker extends Handler { } private boolean updateDisplayInfo() { int displayNetworkType = DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; int displayNetworkType = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; int dataNetworkType = mPhone.getServiceState().getDataNetworkType(); if (mPhone.getServiceState().getNrState() != NetworkRegistrationInfo.NR_STATE_NONE || dataNetworkType == TelephonyManager.NETWORK_TYPE_NR || mHysteresis) { // process NR display network type displayNetworkType = getNrDisplayType(); if (displayNetworkType == DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) { if (displayNetworkType == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) { // use LTE values if 5G values aren't defined displayNetworkType = getLteDisplayType(); } Loading @@ -4207,10 +4207,11 @@ public class DcTracker extends Handler { // process LTE display network type displayNetworkType = getLteDisplayType(); } DisplayInfo displayInfo = new DisplayInfo(dataNetworkType, displayNetworkType); if (!displayInfo.equals(mDisplayInfo)) { mDisplayInfo = displayInfo; mPhone.notifyDisplayInfoChanged(displayInfo); TelephonyDisplayInfo telephonyDisplayInfo = new TelephonyDisplayInfo(dataNetworkType, displayNetworkType); if (!telephonyDisplayInfo.equals(mTelephonyDisplayInfo)) { mTelephonyDisplayInfo = telephonyDisplayInfo; mPhone.notifyDisplayInfoChanged(telephonyDisplayInfo); return true; } return false; Loading Loading @@ -4241,21 +4242,21 @@ public class DcTracker extends Handler { for (String key : keys) { if (m5GIconMapping.containsKey(key) && m5GIconMapping.get(key) != DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) { && m5GIconMapping.get(key) != TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) { return m5GIconMapping.get(key); } } return DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; return TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; } private int getLteDisplayType() { int value = DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; int value = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; if (mPhone.getServiceState().getDataNetworkType() == TelephonyManager.NETWORK_TYPE_LTE_CA || mPhone.getServiceState().isUsingCarrierAggregation()) { value = DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA; value = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA; } if (isLteEnhancedAvailable()) { value = DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO; value = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO; } return value; } Loading tests/telephonytests/src/com/android/internal/telephony/dataconnection/DcTrackerTest.java +18 −14 Original line number Diff line number Diff line Loading @@ -65,13 +65,13 @@ import android.provider.Telephony; import android.telephony.AccessNetworkConstants; import android.telephony.AccessNetworkConstants.AccessNetworkType; import android.telephony.CarrierConfigManager; import android.telephony.DisplayInfo; import android.telephony.NetworkRegistrationInfo; import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.telephony.SubscriptionPlan; import android.telephony.TelephonyDisplayInfo; import android.telephony.TelephonyManager; import android.telephony.data.ApnSetting; import android.telephony.data.DataProfile; Loading Loading @@ -2084,7 +2084,8 @@ public class DcTrackerTest extends TelephonyTest { @Test public void testGetNrDisplayType() { ArgumentCaptor<DisplayInfo> captor = ArgumentCaptor.forClass(DisplayInfo.class); ArgumentCaptor<TelephonyDisplayInfo> captor = ArgumentCaptor.forClass(TelephonyDisplayInfo.class); doReturn(TelephonyManager.NETWORK_TYPE_LTE).when(mServiceState).getDataNetworkType(); // set up 5G icon configuration Loading @@ -2102,7 +2103,7 @@ public class DcTrackerTest extends TelephonyTest { waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(1)).notifyDisplayInfoChanged(captor.capture()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, captor.getValue().getOverrideNetworkType()); // NR NSA, restricted Loading @@ -2111,7 +2112,7 @@ public class DcTrackerTest extends TelephonyTest { waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(2)).notifyDisplayInfoChanged(captor.capture()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, captor.getValue().getOverrideNetworkType()); // NR NSA, not restricted Loading @@ -2120,7 +2121,7 @@ public class DcTrackerTest extends TelephonyTest { waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(3)).notifyDisplayInfoChanged(captor.capture()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA, assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA, captor.getValue().getOverrideNetworkType()); doReturn(NetworkRegistrationInfo.NR_STATE_CONNECTED).when(mServiceState).getNrState(); Loading @@ -2131,7 +2132,7 @@ public class DcTrackerTest extends TelephonyTest { waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(4)).notifyDisplayInfoChanged(captor.capture()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA, assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA, captor.getValue().getOverrideNetworkType()); // NR NSA, millimeter wave frequency Loading @@ -2140,13 +2141,14 @@ public class DcTrackerTest extends TelephonyTest { waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(5)).notifyDisplayInfoChanged(captor.capture()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE, assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE, captor.getValue().getOverrideNetworkType()); } @Test public void testGetLteDisplayType() { ArgumentCaptor<DisplayInfo> captor = ArgumentCaptor.forClass(DisplayInfo.class); ArgumentCaptor<TelephonyDisplayInfo> captor = ArgumentCaptor.forClass(TelephonyDisplayInfo.class); // normal LTE doReturn(TelephonyManager.NETWORK_TYPE_LTE).when(mServiceState).getDataNetworkType(); Loading @@ -2154,7 +2156,7 @@ public class DcTrackerTest extends TelephonyTest { waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(1)).notifyDisplayInfoChanged(captor.capture()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, captor.getValue().getOverrideNetworkType()); // LTE CA Loading @@ -2163,7 +2165,7 @@ public class DcTrackerTest extends TelephonyTest { waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(2)).notifyDisplayInfoChanged(captor.capture()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA, assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA, captor.getValue().getOverrideNetworkType()); // TODO: LTE ADVANCED PRO Loading @@ -2171,16 +2173,18 @@ public class DcTrackerTest extends TelephonyTest { @Test public void testUpdateDisplayInfo() { ArgumentCaptor<DisplayInfo> captor = ArgumentCaptor.forClass(DisplayInfo.class); ArgumentCaptor<TelephonyDisplayInfo> captor = ArgumentCaptor.forClass(TelephonyDisplayInfo.class); doReturn(TelephonyManager.NETWORK_TYPE_HSPAP).when(mServiceState).getDataNetworkType(); mDct.sendMessage(mDct.obtainMessage(DctConstants.EVENT_SERVICE_STATE_CHANGED)); waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(1)).notifyDisplayInfoChanged(captor.capture()); DisplayInfo displayInfo = captor.getValue(); assertEquals(TelephonyManager.NETWORK_TYPE_HSPAP, displayInfo.getNetworkType()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, displayInfo.getOverrideNetworkType()); TelephonyDisplayInfo telephonyDisplayInfo = captor.getValue(); assertEquals(TelephonyManager.NETWORK_TYPE_HSPAP, telephonyDisplayInfo.getNetworkType()); assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, telephonyDisplayInfo.getOverrideNetworkType()); } /** Loading Loading
src/java/com/android/internal/telephony/DefaultPhoneNotifier.java +3 −3 Original line number Diff line number Diff line Loading @@ -25,11 +25,11 @@ import android.telephony.BarringInfo; import android.telephony.CallQuality; import android.telephony.CellIdentity; import android.telephony.CellInfo; import android.telephony.DisplayInfo; import android.telephony.PhoneCapability; import android.telephony.PreciseCallState; import android.telephony.PreciseDataConnectionState; import android.telephony.ServiceState; import android.telephony.TelephonyDisplayInfo; import android.telephony.TelephonyManager; import android.telephony.TelephonyRegistryManager; import android.telephony.data.ApnSetting; Loading Loading @@ -202,9 +202,9 @@ public class DefaultPhoneNotifier implements PhoneNotifier { } @Override public void notifyDisplayInfoChanged(Phone sender, DisplayInfo displayInfo) { public void notifyDisplayInfoChanged(Phone sender, TelephonyDisplayInfo telephonyDisplayInfo) { mTelephonyRegistryMgr.notifyDisplayInfoChanged(sender.getPhoneId(), sender.getSubId(), displayInfo); telephonyDisplayInfo); } @Override Loading
src/java/com/android/internal/telephony/Phone.java +3 −3 Original line number Diff line number Diff line Loading @@ -47,7 +47,6 @@ import android.telephony.CarrierRestrictionRules; import android.telephony.CellIdentity; import android.telephony.CellInfo; import android.telephony.ClientRequestStats; import android.telephony.DisplayInfo; import android.telephony.ImsiEncryptionInfo; import android.telephony.PhoneStateListener; import android.telephony.PhysicalChannelConfig; Loading @@ -57,6 +56,7 @@ import android.telephony.RadioAccessSpecifier; import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.SubscriptionManager; import android.telephony.TelephonyDisplayInfo; import android.telephony.TelephonyManager; import android.telephony.data.ApnSetting; import android.telephony.emergency.EmergencyNumber; Loading Loading @@ -2416,8 +2416,8 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { } /** Send notification that display info has changed. */ public void notifyDisplayInfoChanged(DisplayInfo displayInfo) { mNotifier.notifyDisplayInfoChanged(this, displayInfo); public void notifyDisplayInfoChanged(TelephonyDisplayInfo telephonyDisplayInfo) { mNotifier.notifyDisplayInfoChanged(this, telephonyDisplayInfo); } public void notifySignalStrength() { Loading
src/java/com/android/internal/telephony/PhoneNotifier.java +2 −2 Original line number Diff line number Diff line Loading @@ -25,9 +25,9 @@ import android.telephony.BarringInfo; import android.telephony.CallQuality; import android.telephony.CellIdentity; import android.telephony.CellInfo; import android.telephony.DisplayInfo; import android.telephony.PhoneCapability; import android.telephony.PreciseDataConnectionState; import android.telephony.TelephonyDisplayInfo; import android.telephony.emergency.EmergencyNumber; import android.telephony.ims.ImsReasonInfo; Loading Loading @@ -88,7 +88,7 @@ public interface PhoneNotifier { void notifyUserMobileDataStateChanged(Phone sender, boolean state); /** Send a notification that the display info has changed */ void notifyDisplayInfoChanged(Phone sender, DisplayInfo displayInfo); void notifyDisplayInfoChanged(Phone sender, TelephonyDisplayInfo telephonyDisplayInfo); /** Send a notification that the phone capability has changed */ void notifyPhoneCapabilityChanged(PhoneCapability capability); Loading
src/java/com/android/internal/telephony/dataconnection/DcTracker.java +19 −18 Original line number Diff line number Diff line Loading @@ -72,7 +72,6 @@ import android.telephony.Annotation.NetworkType; import android.telephony.CarrierConfigManager; import android.telephony.CellLocation; import android.telephony.DataFailCause; import android.telephony.DisplayInfo; import android.telephony.NetworkRegistrationInfo; import android.telephony.PcoData; import android.telephony.PreciseDataConnectionState; Loading @@ -81,6 +80,7 @@ import android.telephony.ServiceState.RilRadioTechnology; import android.telephony.SubscriptionManager; import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener; import android.telephony.SubscriptionPlan; import android.telephony.TelephonyDisplayInfo; import android.telephony.TelephonyFrameworkInitializer; import android.telephony.TelephonyManager; import android.telephony.cdma.CdmaCellLocation; Loading Loading @@ -335,8 +335,8 @@ public class DcTracker extends Handler { /* Used to check whether phone was recently connected to 5G. */ private boolean m5GWasConnected = false; /* Used to determine DisplayInfo to send to SysUI. */ private DisplayInfo mDisplayInfo = null; /* Used to determine TelephonyDisplayInfo to send to SysUI. */ private TelephonyDisplayInfo mTelephonyDisplayInfo = null; private final Map<String, Integer> m5GIconMapping = new HashMap<>(); private String mDataIconPattern = ""; Loading Loading @@ -3850,7 +3850,7 @@ public class DcTracker extends Handler { if (!reevaluateUnmeteredConnections()) { // always update on ServiceState changed so MobileSignalController gets // accurate display info mPhone.notifyDisplayInfoChanged(mDisplayInfo); mPhone.notifyDisplayInfoChanged(mTelephonyDisplayInfo); } break; case DctConstants.EVENT_5G_TIMER_HYSTERESIS: Loading Loading @@ -3993,11 +3993,11 @@ public class DcTracker extends Handler { if (DBG) log("Invalid 5G icon configuration, config = " + pair); continue; } int value = DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; int value = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; if (kv[1].equals("5g")) { value = DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA; value = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA; } else if (kv[1].equals("5g_plus")) { value = DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE; value = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE; } m5GIconMapping.put(kv[0], value); } Loading Loading @@ -4192,13 +4192,13 @@ public class DcTracker extends Handler { } private boolean updateDisplayInfo() { int displayNetworkType = DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; int displayNetworkType = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; int dataNetworkType = mPhone.getServiceState().getDataNetworkType(); if (mPhone.getServiceState().getNrState() != NetworkRegistrationInfo.NR_STATE_NONE || dataNetworkType == TelephonyManager.NETWORK_TYPE_NR || mHysteresis) { // process NR display network type displayNetworkType = getNrDisplayType(); if (displayNetworkType == DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) { if (displayNetworkType == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) { // use LTE values if 5G values aren't defined displayNetworkType = getLteDisplayType(); } Loading @@ -4207,10 +4207,11 @@ public class DcTracker extends Handler { // process LTE display network type displayNetworkType = getLteDisplayType(); } DisplayInfo displayInfo = new DisplayInfo(dataNetworkType, displayNetworkType); if (!displayInfo.equals(mDisplayInfo)) { mDisplayInfo = displayInfo; mPhone.notifyDisplayInfoChanged(displayInfo); TelephonyDisplayInfo telephonyDisplayInfo = new TelephonyDisplayInfo(dataNetworkType, displayNetworkType); if (!telephonyDisplayInfo.equals(mTelephonyDisplayInfo)) { mTelephonyDisplayInfo = telephonyDisplayInfo; mPhone.notifyDisplayInfoChanged(telephonyDisplayInfo); return true; } return false; Loading Loading @@ -4241,21 +4242,21 @@ public class DcTracker extends Handler { for (String key : keys) { if (m5GIconMapping.containsKey(key) && m5GIconMapping.get(key) != DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) { && m5GIconMapping.get(key) != TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) { return m5GIconMapping.get(key); } } return DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; return TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; } private int getLteDisplayType() { int value = DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; int value = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE; if (mPhone.getServiceState().getDataNetworkType() == TelephonyManager.NETWORK_TYPE_LTE_CA || mPhone.getServiceState().isUsingCarrierAggregation()) { value = DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA; value = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA; } if (isLteEnhancedAvailable()) { value = DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO; value = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO; } return value; } Loading
tests/telephonytests/src/com/android/internal/telephony/dataconnection/DcTrackerTest.java +18 −14 Original line number Diff line number Diff line Loading @@ -65,13 +65,13 @@ import android.provider.Telephony; import android.telephony.AccessNetworkConstants; import android.telephony.AccessNetworkConstants.AccessNetworkType; import android.telephony.CarrierConfigManager; import android.telephony.DisplayInfo; import android.telephony.NetworkRegistrationInfo; import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.telephony.SubscriptionPlan; import android.telephony.TelephonyDisplayInfo; import android.telephony.TelephonyManager; import android.telephony.data.ApnSetting; import android.telephony.data.DataProfile; Loading Loading @@ -2084,7 +2084,8 @@ public class DcTrackerTest extends TelephonyTest { @Test public void testGetNrDisplayType() { ArgumentCaptor<DisplayInfo> captor = ArgumentCaptor.forClass(DisplayInfo.class); ArgumentCaptor<TelephonyDisplayInfo> captor = ArgumentCaptor.forClass(TelephonyDisplayInfo.class); doReturn(TelephonyManager.NETWORK_TYPE_LTE).when(mServiceState).getDataNetworkType(); // set up 5G icon configuration Loading @@ -2102,7 +2103,7 @@ public class DcTrackerTest extends TelephonyTest { waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(1)).notifyDisplayInfoChanged(captor.capture()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, captor.getValue().getOverrideNetworkType()); // NR NSA, restricted Loading @@ -2111,7 +2112,7 @@ public class DcTrackerTest extends TelephonyTest { waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(2)).notifyDisplayInfoChanged(captor.capture()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, captor.getValue().getOverrideNetworkType()); // NR NSA, not restricted Loading @@ -2120,7 +2121,7 @@ public class DcTrackerTest extends TelephonyTest { waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(3)).notifyDisplayInfoChanged(captor.capture()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA, assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA, captor.getValue().getOverrideNetworkType()); doReturn(NetworkRegistrationInfo.NR_STATE_CONNECTED).when(mServiceState).getNrState(); Loading @@ -2131,7 +2132,7 @@ public class DcTrackerTest extends TelephonyTest { waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(4)).notifyDisplayInfoChanged(captor.capture()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA, assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA, captor.getValue().getOverrideNetworkType()); // NR NSA, millimeter wave frequency Loading @@ -2140,13 +2141,14 @@ public class DcTrackerTest extends TelephonyTest { waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(5)).notifyDisplayInfoChanged(captor.capture()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE, assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE, captor.getValue().getOverrideNetworkType()); } @Test public void testGetLteDisplayType() { ArgumentCaptor<DisplayInfo> captor = ArgumentCaptor.forClass(DisplayInfo.class); ArgumentCaptor<TelephonyDisplayInfo> captor = ArgumentCaptor.forClass(TelephonyDisplayInfo.class); // normal LTE doReturn(TelephonyManager.NETWORK_TYPE_LTE).when(mServiceState).getDataNetworkType(); Loading @@ -2154,7 +2156,7 @@ public class DcTrackerTest extends TelephonyTest { waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(1)).notifyDisplayInfoChanged(captor.capture()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, captor.getValue().getOverrideNetworkType()); // LTE CA Loading @@ -2163,7 +2165,7 @@ public class DcTrackerTest extends TelephonyTest { waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(2)).notifyDisplayInfoChanged(captor.capture()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA, assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA, captor.getValue().getOverrideNetworkType()); // TODO: LTE ADVANCED PRO Loading @@ -2171,16 +2173,18 @@ public class DcTrackerTest extends TelephonyTest { @Test public void testUpdateDisplayInfo() { ArgumentCaptor<DisplayInfo> captor = ArgumentCaptor.forClass(DisplayInfo.class); ArgumentCaptor<TelephonyDisplayInfo> captor = ArgumentCaptor.forClass(TelephonyDisplayInfo.class); doReturn(TelephonyManager.NETWORK_TYPE_HSPAP).when(mServiceState).getDataNetworkType(); mDct.sendMessage(mDct.obtainMessage(DctConstants.EVENT_SERVICE_STATE_CHANGED)); waitForLastHandlerAction(mDcTrackerTestHandler.getThreadHandler()); verify(mPhone, times(1)).notifyDisplayInfoChanged(captor.capture()); DisplayInfo displayInfo = captor.getValue(); assertEquals(TelephonyManager.NETWORK_TYPE_HSPAP, displayInfo.getNetworkType()); assertEquals(DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, displayInfo.getOverrideNetworkType()); TelephonyDisplayInfo telephonyDisplayInfo = captor.getValue(); assertEquals(TelephonyManager.NETWORK_TYPE_HSPAP, telephonyDisplayInfo.getNetworkType()); assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, telephonyDisplayInfo.getOverrideNetworkType()); } /** Loading