Skip to content

Commit

Permalink
Release 2.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Unity Ads Travis committed Dec 19, 2016
1 parent 4dfac79 commit 71128ac
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 14 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ sonar:

javadoc:
./gradlew :lib:generateReleaseJavadoc

zip: release
cp lib/build/outputs/aar/unity-ads-release.aar unity-ads.aar
zip -9r builds.zip unity-ads.aar
rm unity-ads.aar
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 9
targetSdkVersion 23
versionCode = 2006
versionName = "2.0.6"
versionCode = 2007
versionName = "2.0.7"
}
buildTypes {
release {
Expand Down
4 changes: 2 additions & 2 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
defaultConfig {
minSdkVersion 9
targetSdkVersion 23
versionCode = 2006
versionName = "2.0.6"
versionCode = 2007
versionName = "2.0.7"

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.*;

import java.util.HashMap;

@RunWith(AndroidJUnit4.class)
Expand Down Expand Up @@ -109,6 +109,17 @@ public void testMetaDataBaseClassWithCategory () throws Exception {
}
}

@Test
public void testCommitWithoutMetaDataSet () throws Exception {
WebViewApp.setCurrentApp(new MetaDataWebApp());
MetaData metaData = new MetaData(ClientProperties.getApplicationContext());
metaData.setCategory("test");
metaData.commit();

assertNull("Entries should still be null", metaData.getEntries());
}


private class MetaDataWebApp extends WebViewApp {
public Object[] PARAMS = null;
public Enum EVENT_CATEOGRY = null;
Expand Down
19 changes: 11 additions & 8 deletions lib/src/main/java/com/unity3d/ads/metadata/MetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,20 @@ public void commit () {
if (StorageManager.init(_context)) {
Storage storage = StorageManager.getStorage(StorageManager.StorageType.PUBLIC);

for (String key : _metaData.keySet()) {
if (storage != null) {
storage.set(key, _metaData.get(key));
if (_metaData != null) {
for (String key : _metaData.keySet()) {
if (storage != null) {
storage.set(key, _metaData.get(key));
}
}
}

if (storage != null) {
storage.writeStorage();
storage.sendEvent(StorageEvent.SET, _metaData);
if (storage != null) {
storage.writeStorage();
storage.sendEvent(StorageEvent.SET, _metaData);
}
}
} else {
}
else {
DeviceLog.error("Unity Ads could not commit metadata due to storage error");
}
}
Expand Down

0 comments on commit 71128ac

Please sign in to comment.