Skip to content

Commit

Permalink
Release 3.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
UnitySteven committed Aug 6, 2020
1 parent c70247b commit 16bb091
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 78 deletions.
70 changes: 0 additions & 70 deletions .gitlab-ci.yml

This file was deleted.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.unity3d.ads.example"
minSdkVersion 14
targetSdkVersion 26
versionCode = 3460
versionName = "3.4.6"
versionCode = 3480
versionName = "3.4.8"
}

flavorDimensions "arEnabled"
Expand Down
6 changes: 3 additions & 3 deletions unity-ads/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ext {
siteUrl = 'https://github.com/Unity-Technologies/unity-ads-android'
gitUrl = 'https://github.com/Unity-Technologies/unity-ads-android.git'

libraryVersion = '3.4.6'
libraryVersion = '3.4.8'

developerId = 'sbankhead'
developerName = 'Steven Bankhead'
Expand Down Expand Up @@ -50,8 +50,8 @@ android {
All SDK with version numbers with last two digits >= 50 will be treated
as China SDK for filtering in the backend.
*/
versionCode = 3460
versionName = "3.4.6"
versionCode = 3480
versionName = "3.4.8"

setProperty("archivesBaseName", "unity-ads")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ private static void initConnectionStatus() {

if(!_wifi) {
TelephonyManager tm = (TelephonyManager)ClientProperties.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
_networkType = tm.getNetworkType();
try {
_networkType = tm.getNetworkType();
} catch (SecurityException ex) {
DeviceLog.warning("Unity Ads was not able to get current network type due to missing permission");
}
}
} else {
_connected = 0;
Expand Down Expand Up @@ -159,7 +163,13 @@ public static void connectionStatusChanged() {
if(ni != null && ni.isConnected()) {
boolean wifiStatus = ni.getType() == ConnectivityManager.TYPE_WIFI;
TelephonyManager tm = (TelephonyManager)ClientProperties.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
int mobileNetworkType = tm.getNetworkType();
int mobileNetworkType = -1;

try {
mobileNetworkType = tm.getNetworkType();
} catch (SecurityException ex) {
DeviceLog.warning("Unity Ads was not able to get current network type due to missing permission");
}

// If wifi status and network type have not changed, ignore this event. If wifi is on, mobile network type does not need to match.
if(wifiStatus == _wifi && (mobileNetworkType == _networkType || _wifi)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ public static boolean isUsingWifi () {
public static int getNetworkType() {
if (ClientProperties.getApplicationContext() != null) {
TelephonyManager tm = (TelephonyManager)ClientProperties.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
return tm.getNetworkType();
try {
return tm.getNetworkType();
} catch (SecurityException ex) {
DeviceLog.warning("Unity Ads was not able to get current network type due to missing permission");
}
}

return -1;
Expand Down

0 comments on commit 16bb091

Please sign in to comment.