File tree Expand file tree Collapse file tree 5 files changed +33
-14
lines changed
androidTest/java/com/unity3d/ads/test/unit
main/java/com/unity3d/ads/metadata Expand file tree Collapse file tree 5 files changed +33
-14
lines changed Original file line number Diff line number Diff line change 5858
5959javadoc :
6060 ./gradlew :lib:generateReleaseJavadoc
61+
62+ zip : release
63+ cp lib/build/outputs/aar/unity-ads-release.aar unity-ads.aar
64+ zip -9r builds.zip unity-ads.aar
65+ rm unity-ads.aar
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ android {
88 applicationId " com.unity3d.ads.example"
99 minSdkVersion 9
1010 targetSdkVersion 23
11- versionCode = 2006
12- versionName = " 2.0.6 "
11+ versionCode = 2007
12+ versionName = " 2.0.7 "
1313 }
1414 buildTypes {
1515 release {
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ android {
1212 defaultConfig {
1313 minSdkVersion 9
1414 targetSdkVersion 23
15- versionCode = 2006
16- versionName = " 2.0.6 "
15+ versionCode = 2007
16+ versionName = " 2.0.7 "
1717
1818 setProperty(" archivesBaseName" , " unity-ads" )
1919
Original file line number Diff line number Diff line change 1414import org .junit .BeforeClass ;
1515import org .junit .Test ;
1616import org .junit .runner .RunWith ;
17- import static org .junit .Assert .assertTrue ;
18- import static org . junit . Assert . assertEquals ;
17+ import static org .junit .Assert .* ;
18+
1919import java .util .HashMap ;
2020
2121@ RunWith (AndroidJUnit4 .class )
@@ -109,6 +109,17 @@ public void testMetaDataBaseClassWithCategory () throws Exception {
109109 }
110110 }
111111
112+ @ Test
113+ public void testCommitWithoutMetaDataSet () throws Exception {
114+ WebViewApp .setCurrentApp (new MetaDataWebApp ());
115+ MetaData metaData = new MetaData (ClientProperties .getApplicationContext ());
116+ metaData .setCategory ("test" );
117+ metaData .commit ();
118+
119+ assertNull ("Entries should still be null" , metaData .getEntries ());
120+ }
121+
122+
112123 private class MetaDataWebApp extends WebViewApp {
113124 public Object [] PARAMS = null ;
114125 public Enum EVENT_CATEOGRY = null ;
Original file line number Diff line number Diff line change @@ -49,17 +49,20 @@ public void commit () {
4949 if (StorageManager .init (_context )) {
5050 Storage storage = StorageManager .getStorage (StorageManager .StorageType .PUBLIC );
5151
52- for (String key : _metaData .keySet ()) {
53- if (storage != null ) {
54- storage .set (key , _metaData .get (key ));
52+ if (_metaData != null ) {
53+ for (String key : _metaData .keySet ()) {
54+ if (storage != null ) {
55+ storage .set (key , _metaData .get (key ));
56+ }
5557 }
56- }
5758
58- if (storage != null ) {
59- storage .writeStorage ();
60- storage .sendEvent (StorageEvent .SET , _metaData );
59+ if (storage != null ) {
60+ storage .writeStorage ();
61+ storage .sendEvent (StorageEvent .SET , _metaData );
62+ }
6163 }
62- } else {
64+ }
65+ else {
6366 DeviceLog .error ("Unity Ads could not commit metadata due to storage error" );
6467 }
6568 }
You can’t perform that action at this time.
0 commit comments