Loading Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ java_defaults { libs: ["unsupportedappusage"], static_libs: [ "androidx.annotation_annotation", "netd_aidl_interface-V3-java", "netd_aidl_interface-unstable-java", "netlink-client", "networkstack-client", "datastallprotosnano", Loading src/android/net/dhcp/DhcpClient.java +2 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ public class DhcpClient extends StateMachine { private static final int FIRST_TIMEOUT_MS = 1 * SECONDS; private static final int MAX_TIMEOUT_MS = 512 * SECONDS; private static final int IPMEMORYSTORE_TIMEOUT_MS = 1 * SECONDS; private static final int DHCP_INITREBOOT_TIMEOUT_MS = 5 * SECONDS; // The waiting time to restart the DHCP configuration process after broadcasting a // DHCPDECLINE message, (RFC2131 3.1.5 describes client SHOULD wait a minimum of 10 Loading Loading @@ -1814,6 +1815,7 @@ public class DhcpClient extends StateMachine { class DhcpInitRebootState extends DhcpRequestingState { @Override public void enter() { mTimeout = DHCP_INITREBOOT_TIMEOUT_MS; super.enter(); startNewTransaction(); } Loading src/com/android/server/connectivity/NetworkMonitor.java +1 −0 Original line number Diff line number Diff line Loading @@ -1731,6 +1731,7 @@ public class NetworkMonitor extends StateMachine { } try { final List<CellInfo> cells = mTelephonyManager.getAllCellInfo(); if (cells == null) return null; final Map<String, Integer> countryCodeMap = new HashMap<>(); int maxCount = 0; for (final CellInfo cell : cells) { Loading tests/unit/src/com/android/server/connectivity/NetworkMonitorTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -867,12 +867,15 @@ public class NetworkMonitorTest { doReturn(PackageManager.PERMISSION_GRANTED).when(mContext).checkPermission( eq(android.Manifest.permission.ACCESS_FINE_LOCATION), anyInt(), anyInt()); doReturn(new ContextWrapper(mContext)).when(mContext).createConfigurationContext(any()); doReturn(null).when(mTelephony).getAllCellInfo(); assertNull(wnm.getLocationMcc()); // Prepare CellInfo and check if the vote mechanism is working or not. final List<CellInfo> cellList = new ArrayList<CellInfo>(); doReturn(cellList).when(mTelephony).getAllCellInfo(); assertNull(wnm.getLocationMcc()); cellList.add(makeTestCellInfoGsm("460")); cellList.add(makeTestCellInfoGsm("460")); cellList.add(makeTestCellInfoLte("466")); doReturn(cellList).when(mTelephony).getAllCellInfo(); // The count of 460 is 2 and the count of 466 is 1, so the getLocationMcc() should return // 460. assertEquals("460", wnm.getLocationMcc()); Loading Loading
Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ java_defaults { libs: ["unsupportedappusage"], static_libs: [ "androidx.annotation_annotation", "netd_aidl_interface-V3-java", "netd_aidl_interface-unstable-java", "netlink-client", "networkstack-client", "datastallprotosnano", Loading
src/android/net/dhcp/DhcpClient.java +2 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ public class DhcpClient extends StateMachine { private static final int FIRST_TIMEOUT_MS = 1 * SECONDS; private static final int MAX_TIMEOUT_MS = 512 * SECONDS; private static final int IPMEMORYSTORE_TIMEOUT_MS = 1 * SECONDS; private static final int DHCP_INITREBOOT_TIMEOUT_MS = 5 * SECONDS; // The waiting time to restart the DHCP configuration process after broadcasting a // DHCPDECLINE message, (RFC2131 3.1.5 describes client SHOULD wait a minimum of 10 Loading Loading @@ -1814,6 +1815,7 @@ public class DhcpClient extends StateMachine { class DhcpInitRebootState extends DhcpRequestingState { @Override public void enter() { mTimeout = DHCP_INITREBOOT_TIMEOUT_MS; super.enter(); startNewTransaction(); } Loading
src/com/android/server/connectivity/NetworkMonitor.java +1 −0 Original line number Diff line number Diff line Loading @@ -1731,6 +1731,7 @@ public class NetworkMonitor extends StateMachine { } try { final List<CellInfo> cells = mTelephonyManager.getAllCellInfo(); if (cells == null) return null; final Map<String, Integer> countryCodeMap = new HashMap<>(); int maxCount = 0; for (final CellInfo cell : cells) { Loading
tests/unit/src/com/android/server/connectivity/NetworkMonitorTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -867,12 +867,15 @@ public class NetworkMonitorTest { doReturn(PackageManager.PERMISSION_GRANTED).when(mContext).checkPermission( eq(android.Manifest.permission.ACCESS_FINE_LOCATION), anyInt(), anyInt()); doReturn(new ContextWrapper(mContext)).when(mContext).createConfigurationContext(any()); doReturn(null).when(mTelephony).getAllCellInfo(); assertNull(wnm.getLocationMcc()); // Prepare CellInfo and check if the vote mechanism is working or not. final List<CellInfo> cellList = new ArrayList<CellInfo>(); doReturn(cellList).when(mTelephony).getAllCellInfo(); assertNull(wnm.getLocationMcc()); cellList.add(makeTestCellInfoGsm("460")); cellList.add(makeTestCellInfoGsm("460")); cellList.add(makeTestCellInfoLte("466")); doReturn(cellList).when(mTelephony).getAllCellInfo(); // The count of 460 is 2 and the count of 466 is 1, so the getLocationMcc() should return // 460. assertEquals("460", wnm.getLocationMcc()); Loading