Skip to content

Commit d45123d

Browse files
Remove network type information from NetworkUtils (commons-app#4996)
* Remove network type information from NetworkUtils * Ignore dependent tests
1 parent e5e5a8d commit d45123d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

app/src/main/java/fr/free/nrw/commons/utils/NetworkUtils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ static NetworkConnectionType getNetworkType(Context context) {
4949
return NetworkConnectionType.WIFI;
5050
}
5151

52+
// TODO for Android 12+ request permission from user is mandatory
53+
/*
5254
int mobileNetwork = telephonyManager.getNetworkType();
5355
switch (mobileNetwork) {
5456
case TelephonyManager.NETWORK_TYPE_GPRS:
@@ -71,6 +73,8 @@ static NetworkConnectionType getNetworkType(Context context) {
7173
default:
7274
return NetworkConnectionType.UNKNOWN;
7375
}
76+
*/
77+
return NetworkConnectionType.UNKNOWN;
7478
}
7579

7680
/**

app/src/test/kotlin/fr/free/nrw/commons/utils/NetworkUtilsTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import org.jetbrains.annotations.NotNull;
1010
import org.junit.Before;
11+
import org.junit.Ignore;
1112
import org.junit.Test;
1213

1314
import fr.free.nrw.commons.utils.model.NetworkConnectionType;
@@ -97,6 +98,7 @@ public void testWifiNetwork() {
9798
}
9899

99100
@Test
101+
@Ignore("Fix these test with telemetry permission")
100102
public void testCellular2GNetwork() {
101103
Context mockContext = mock(Context.class);
102104
Application mockApplication = mock(Application.class);
@@ -123,6 +125,7 @@ public void testCellular2GNetwork() {
123125
}
124126

125127
@Test
128+
@Ignore("Fix these test with telemetry permission")
126129
public void testCellular3GNetwork() {
127130
Context mockContext = mock(Context.class);
128131
Application mockApplication = mock(Application.class);
@@ -149,6 +152,7 @@ public void testCellular3GNetwork() {
149152
}
150153

151154
@Test
155+
@Ignore("Fix these test with telemetry permission")
152156
public void testCellular4GNetwork() {
153157
Context mockContext = mock(Context.class);
154158
Application mockApplication = mock(Application.class);

0 commit comments

Comments
 (0)