Skip to content

Fix Fiam crash at AbtIntegrationHelper #4913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions firebase-inappmessaging-display/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Unreleased
* [fixed] Fixed nullpointer crash when using experiments
([GitHub Issue #4214](//github.com/firebase/firebase-android-sdk/issues/4716))

# 20.3.1
* [fixed] Fixed nullpointer crash
Expand Down
2 changes: 2 additions & 0 deletions firebase-inappmessaging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Unreleased
* [fixed] Fixed nullpointer crash when using experiments
([GitHub Issue #4214](//github.com/firebase/firebase-android-sdk/issues/4716))

# 20.3.1
* [fixed] Fixed nullpointer crash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ private FirebaseInAppMessaging providesFirebaseInAppMessaging(ComponentContainer
new AbtIntegrationHelper(
container
.get(AbtComponent.class)
.get(FirebaseABTesting.OriginService.INAPP_MESSAGING)))
.get(FirebaseABTesting.OriginService.INAPP_MESSAGING),
container.get(blockingExecutor)))
.apiClientModule(
new ApiClientModule(firebaseApp, firebaseInstallations, universalComponent.clock()))
.grpcClientModule(new GrpcClientModule(firebaseApp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
@FirebaseAppScope
public class AbtIntegrationHelper {
private final FirebaseABTesting abTesting;

@Inject @Blocking @VisibleForTesting Executor executor;
@VisibleForTesting Executor executor;

@Inject
public AbtIntegrationHelper(FirebaseABTesting abTesting) {
public AbtIntegrationHelper(FirebaseABTesting abTesting, @Blocking Executor blockingExecutor) {
this.abTesting = abTesting;
this.executor = blockingExecutor;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
ExecutorsModule.class
})
public interface UniversalComponent {
ProviderInstaller probiderInstaller();
ProviderInstaller providerInstaller();

Channel gRPCChannel();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import static org.mockito.Mockito.verifyZeroInteractions;

import com.google.firebase.abt.FirebaseABTesting;
import com.google.firebase.concurrent.TestOnlyExecutors;
import com.google.firebase.inappmessaging.MessagesProto;
import com.google.internal.firebase.inappmessaging.v1.CampaignProto;
import com.google.internal.firebase.inappmessaging.v1.sdkserving.FetchEligibleCampaignsResponse;
Expand Down Expand Up @@ -66,7 +67,7 @@ public class AbtIntegrationHelperTest {
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
abtIntegrationHelper = new AbtIntegrationHelper(abTesting);
abtIntegrationHelper = new AbtIntegrationHelper(abTesting, TestOnlyExecutors.blocking());
// make executor immediately execute
abtIntegrationHelper.executor = Runnable::run;
}
Expand Down