Skip to content

Commit a9cea9e

Browse files
committed
Remove In-App Feedback functionality from firebase-appdistribution
1 parent 5991287 commit a9cea9e

File tree

15 files changed

+3
-928
lines changed

15 files changed

+3
-928
lines changed

firebase-appdistribution-api/src/main/java/com/google/firebase/appdistribution/FirebaseAppDistribution.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,6 @@ public interface FirebaseAppDistribution {
109109
@NonNull
110110
UpdateTask updateApp();
111111

112-
/**
113-
* Takes a screenshot, and starts an activity to collect and submit feedback from the tester.
114-
*
115-
* <p>Performs the following actions:
116-
*
117-
* <ol>
118-
* <li>Takes a screenshot of the current activity
119-
* <li>If tester is not signed in, presents the tester with a Google Sign-in UI
120-
* <li>Looks up the currently installed App Distribution release
121-
* <li>Starts a full screen activity for the tester to compose and submit the feedback
122-
* </ol>
123-
*/
124-
void collectAndSendFeedback();
125-
126112
/** Gets the singleton {@link FirebaseAppDistribution} instance. */
127113
@NonNull
128114
static FirebaseAppDistribution getInstance() {

firebase-appdistribution-api/src/main/java/com/google/firebase/appdistribution/internal/FirebaseAppDistributionProxy.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,4 @@ public synchronized Task<AppDistributionRelease> checkForNewRelease() {
7171
public UpdateTask updateApp() {
7272
return delegate.updateApp();
7373
}
74-
75-
@Override
76-
public void collectAndSendFeedback() {
77-
delegate.collectAndSendFeedback();
78-
}
7974
}

firebase-appdistribution-api/src/main/java/com/google/firebase/appdistribution/internal/FirebaseAppDistributionStub.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ public UpdateTask updateApp() {
7373
return new NotImplementedUpdateTask();
7474
}
7575

76-
@Override
77-
public void collectAndSendFeedback() {
78-
return;
79-
}
80-
8176
private static <TResult> Task<TResult> getNotImplementedTask() {
8277
return Tasks.forException(
8378
new FirebaseAppDistributionException(

firebase-appdistribution/src/main/AndroidManifest.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@
4646
</intent-filter>
4747
</activity>
4848

49-
<activity
50-
android:name=".FeedbackActivity"
51-
android:exported="false"
52-
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
53-
5449
<provider
5550
android:name="com.google.firebase.appdistribution.impl.FirebaseAppDistributionFileProvider"
5651
android:authorities="${applicationId}.FirebaseAppDistributionFileProvider"

firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/impl/FeedbackActivity.java

Lines changed: 0 additions & 97 deletions
This file was deleted.

firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/impl/FeedbackSender.java

Lines changed: 0 additions & 51 deletions
This file was deleted.

firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/impl/FirebaseAppDistributionImpl.java

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@
1818
import static com.google.firebase.appdistribution.FirebaseAppDistributionException.Status.AUTHENTICATION_FAILURE;
1919
import static com.google.firebase.appdistribution.FirebaseAppDistributionException.Status.HOST_ACTIVITY_INTERRUPTED;
2020
import static com.google.firebase.appdistribution.FirebaseAppDistributionException.Status.UPDATE_NOT_AVAILABLE;
21-
import static com.google.firebase.appdistribution.impl.FeedbackActivity.RELEASE_NAME_EXTRA_KEY;
22-
import static com.google.firebase.appdistribution.impl.FeedbackActivity.SCREENSHOT_FILENAME_EXTRA_KEY;
2321
import static com.google.firebase.appdistribution.impl.TaskUtils.safeSetTaskException;
2422
import static com.google.firebase.appdistribution.impl.TaskUtils.safeSetTaskResult;
2523

2624
import android.app.Activity;
2725
import android.app.AlertDialog;
2826
import android.content.Context;
29-
import android.content.Intent;
3027
import androidx.annotation.GuardedBy;
3128
import androidx.annotation.NonNull;
3229
import androidx.annotation.Nullable;
@@ -43,8 +40,6 @@
4340
import com.google.firebase.appdistribution.UpdateProgress;
4441
import com.google.firebase.appdistribution.UpdateStatus;
4542
import com.google.firebase.appdistribution.UpdateTask;
46-
import java.util.concurrent.Executor;
47-
import java.util.concurrent.Executors;
4843

4944
/**
5045
* This class is the "real" implementation of the Firebase App Distribution API which should only be
@@ -61,8 +56,6 @@ class FirebaseAppDistributionImpl implements FirebaseAppDistribution {
6156
private final ApkUpdater apkUpdater;
6257
private final AabUpdater aabUpdater;
6358
private final SignInStorage signInStorage;
64-
private final ReleaseIdentifier releaseIdentifier;
65-
private final ScreenshotTaker screenshotTaker;
6659

6760
private final Object updateIfNewReleaseTaskLock = new Object();
6861

@@ -93,18 +86,14 @@ class FirebaseAppDistributionImpl implements FirebaseAppDistribution {
9386
@NonNull ApkUpdater apkUpdater,
9487
@NonNull AabUpdater aabUpdater,
9588
@NonNull SignInStorage signInStorage,
96-
@NonNull FirebaseAppDistributionLifecycleNotifier lifecycleNotifier,
97-
@NonNull ReleaseIdentifier releaseIdentifier,
98-
@NonNull ScreenshotTaker screenshotTaker) {
89+
@NonNull FirebaseAppDistributionLifecycleNotifier lifecycleNotifier) {
9990
this.firebaseApp = firebaseApp;
10091
this.testerSignInManager = testerSignInManager;
10192
this.newReleaseFetcher = newReleaseFetcher;
10293
this.apkUpdater = apkUpdater;
10394
this.aabUpdater = aabUpdater;
10495
this.signInStorage = signInStorage;
105-
this.releaseIdentifier = releaseIdentifier;
10696
this.lifecycleNotifier = lifecycleNotifier;
107-
this.screenshotTaker = screenshotTaker;
10897
lifecycleNotifier.addOnActivityDestroyedListener(this::onActivityDestroyed);
10998
lifecycleNotifier.addOnActivityPausedListener(this::onActivityPaused);
11099
lifecycleNotifier.addOnActivityResumedListener(this::onActivityResumed);
@@ -305,43 +294,6 @@ private UpdateTask updateApp(boolean showDownloadInNotificationManager) {
305294
}
306295
}
307296

308-
@Override
309-
public void collectAndSendFeedback() {
310-
collectAndSendFeedback(Executors.newSingleThreadExecutor());
311-
}
312-
313-
@VisibleForTesting
314-
public void collectAndSendFeedback(Executor taskExecutor) {
315-
screenshotTaker
316-
.takeScreenshot()
317-
.onSuccessTask(
318-
taskExecutor,
319-
screenshotFilename ->
320-
testerSignInManager
321-
.signInTester()
322-
.addOnFailureListener(
323-
taskExecutor,
324-
e ->
325-
LogWrapper.getInstance()
326-
.e("Failed to sign in tester. Could not collect feedback.", e))
327-
.onSuccessTask(taskExecutor, unused -> releaseIdentifier.identifyRelease())
328-
.onSuccessTask(
329-
taskExecutor,
330-
releaseName -> launchFeedbackActivity(releaseName, screenshotFilename)))
331-
.addOnFailureListener(
332-
taskExecutor, e -> LogWrapper.getInstance().e("Failed to launch feedback flow", e));
333-
}
334-
335-
private Task<Void> launchFeedbackActivity(String releaseName, String screenshotFilename) {
336-
return lifecycleNotifier.consumeForegroundActivity(
337-
activity -> {
338-
Intent intent = new Intent(activity, FeedbackActivity.class);
339-
intent.putExtra(RELEASE_NAME_EXTRA_KEY, releaseName);
340-
intent.putExtra(SCREENSHOT_FILENAME_EXTRA_KEY, screenshotFilename);
341-
activity.startActivity(intent);
342-
});
343-
}
344-
345297
@VisibleForTesting
346298
void onActivityResumed(Activity activity) {
347299
if (awaitingSignInDialogConfirmation()) {
@@ -386,13 +338,6 @@ void onActivityDestroyed(@NonNull Activity activity) {
386338
if (activity == dialogHostActivity) {
387339
dialogHostActivity = null;
388340
}
389-
390-
// If the feedback activity finishes, clean up the screenshot that was taken before starting
391-
// the activity. If this does not happen for some reason it will be cleaned up the next time
392-
// before taking a new screenshot.
393-
if (activity instanceof FeedbackActivity) {
394-
screenshotTaker.deleteScreenshot();
395-
}
396341
}
397342

398343
@VisibleForTesting

firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/impl/FirebaseAppDistributionRegistrar.java

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,9 @@ public class FirebaseAppDistributionRegistrar implements ComponentRegistrar {
5151
// activity lifecycle callbacks before the API is called
5252
.alwaysEager()
5353
.build(),
54-
Component.builder(FeedbackSender.class)
55-
.add(Dependency.required(FirebaseApp.class))
56-
.add(Dependency.requiredProvider(FirebaseInstallationsApi.class))
57-
.factory(this::buildFeedbackSender)
58-
.build(),
5954
LibraryVersionComponent.create("fire-appdistribution", BuildConfig.VERSION_NAME));
6055
}
6156

62-
private FeedbackSender buildFeedbackSender(ComponentContainer container) {
63-
FirebaseApp firebaseApp = container.get(FirebaseApp.class);
64-
Provider<FirebaseInstallationsApi> firebaseInstallationsApiProvider =
65-
container.getProvider(FirebaseInstallationsApi.class);
66-
FirebaseAppDistributionTesterApiClient testerApiClient =
67-
new FirebaseAppDistributionTesterApiClient(
68-
firebaseApp, firebaseInstallationsApiProvider, new TesterApiHttpClient(firebaseApp));
69-
return new FeedbackSender(testerApiClient);
70-
}
71-
7257
private FirebaseAppDistribution buildFirebaseAppDistribution(ComponentContainer container) {
7358
FirebaseApp firebaseApp = container.get(FirebaseApp.class);
7459
Context context = firebaseApp.getApplicationContext();
@@ -90,9 +75,7 @@ private FirebaseAppDistribution buildFirebaseAppDistribution(ComponentContainer
9075
new ApkUpdater(firebaseApp, new ApkInstaller()),
9176
new AabUpdater(),
9277
signInStorage,
93-
lifecycleNotifier,
94-
releaseIdentifier,
95-
new ScreenshotTaker(firebaseApp, lifecycleNotifier));
78+
lifecycleNotifier);
9679

9780
if (context instanceof Application) {
9881
Application firebaseApplication = (Application) context;

0 commit comments

Comments
 (0)