Skip to content

Commit

Permalink
Merge pull request #1641 from microsoft/develop
Browse files Browse the repository at this point in the history
Version 4.4.5
  • Loading branch information
DmitriyKirakosyan committed Jun 27, 2022
2 parents db681ce + 522a8aa commit 39fd75a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# App Center SDK for Android Change Log

## Version 4.4.5

### App Center

* **[Fix]** Fix crash when SDK is started from overridden `Application.attachBaseContext`.

___

## Version 4.4.4

### App Center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static Context getApplicationContext(Application application) {
return application.createDeviceProtectedStorageContext();
}
}
return application.getApplicationContext();
return application;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
Expand Down Expand Up @@ -39,7 +40,6 @@ public class ApplicationContextUtilsTest {

@Before
public void setUp() {
when(mApplication.getApplicationContext()).thenReturn(mApplication);
when(mApplication.isDeviceProtectedStorage()).thenReturn(false);
when(mApplication.createDeviceProtectedStorageContext()).thenReturn(mDeviceProtectedStorageContext);
when(mApplication.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
Expand Down Expand Up @@ -80,8 +80,8 @@ public void contextOnNewUnlockedDevice() {
/* It should be regular context. */
assertEquals(mApplication, ApplicationContextUtils.getApplicationContext(mApplication));

/* Verify get application context. */
verify(mApplication).getApplicationContext();
/* We should use application object directly, without getApplicationContext call. */
verify(mApplication, never()).getApplicationContext();
}

@Test
Expand All @@ -96,8 +96,8 @@ public void contextOnOldDevice() {
/* It should be regular context. */
assertEquals(mApplication, ApplicationContextUtils.getApplicationContext(mApplication));

/* Verify get application context. */
verify(mApplication).getApplicationContext();
/* We should use application object directly, without getApplicationContext call. */
verify(mApplication, never()).getApplicationContext();
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

ext {
versionCode = 68
versionName = '4.4.4'
versionName = '4.4.5'
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
Expand Down

0 comments on commit 39fd75a

Please sign in to comment.