Loading src/java/com/android/internal/telephony/DefaultPhoneNotifier.java +3 −3 Original line number Diff line number Diff line Loading @@ -28,11 +28,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.emergency.EmergencyNumber; Loading Loading @@ -208,9 +208,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 @@ -2430,8 +2430,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 @@ -73,7 +73,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; import android.telephony.ServiceState.RilRadioTechnology; import android.telephony.SubscriptionManager; import android.telephony.SubscriptionPlan; import android.telephony.TelephonyDisplayInfo; import android.telephony.TelephonyManager; import android.telephony.cdma.CdmaCellLocation; import android.telephony.data.ApnSetting; Loading Loading @@ -331,8 +331,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 @@ -3739,7 +3739,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 @@ -3850,11 +3850,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 @@ -4035,13 +4035,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 @@ -4050,10 +4050,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 @@ -4084,21 +4085,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 @@ -63,13 +63,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 @@ -2102,7 +2102,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 @@ -2121,7 +2122,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 @@ -2130,7 +2131,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 @@ -2139,7 +2140,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 @@ -2150,7 +2151,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 @@ -2159,13 +2160,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 @@ -2173,7 +2175,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 @@ -2182,7 +2184,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 @@ -2190,16 +2192,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 @@ -28,11 +28,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.emergency.EmergencyNumber; Loading Loading @@ -208,9 +208,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 @@ -2430,8 +2430,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 @@ -73,7 +73,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; import android.telephony.ServiceState.RilRadioTechnology; import android.telephony.SubscriptionManager; import android.telephony.SubscriptionPlan; import android.telephony.TelephonyDisplayInfo; import android.telephony.TelephonyManager; import android.telephony.cdma.CdmaCellLocation; import android.telephony.data.ApnSetting; Loading Loading @@ -331,8 +331,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 @@ -3739,7 +3739,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 @@ -3850,11 +3850,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 @@ -4035,13 +4035,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 @@ -4050,10 +4050,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 @@ -4084,21 +4085,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 @@ -63,13 +63,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 @@ -2102,7 +2102,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 @@ -2121,7 +2122,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 @@ -2130,7 +2131,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 @@ -2139,7 +2140,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 @@ -2150,7 +2151,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 @@ -2159,13 +2160,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 @@ -2173,7 +2175,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 @@ -2182,7 +2184,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 @@ -2190,16 +2192,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