Skip to content

App Distribution Reference Docs Edits #3427

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 10 commits into from
Feb 22, 2022
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
1 change: 0 additions & 1 deletion firebase-appdistribution/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ package com.google.firebase.appdistribution {
}

public enum FirebaseAppDistributionException.Status {
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status APP_RUNNING_IN_PRODUCTION;
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status AUTHENTICATION_CANCELED;
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status AUTHENTICATION_FAILURE;
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status DOWNLOAD_FAILURE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import androidx.annotation.GuardedBy;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import com.google.firebase.appdistribution.Constants.ErrorMessages;
import com.google.firebase.appdistribution.internal.InstallActivity;
import com.google.firebase.appdistribution.internal.LogWrapper;
import com.google.firebase.appdistribution.internal.SignInResultActivity;
Expand Down Expand Up @@ -181,7 +180,7 @@ void tryCancelAabUpdateTask() {
safeSetTaskException(
cachedUpdateTask,
new FirebaseAppDistributionException(
ErrorMessages.UPDATE_CANCELED,
FirebaseAppDistributionException.ErrorMessages.UPDATE_CANCELED,
FirebaseAppDistributionException.Status.INSTALLATION_CANCELED,
ReleaseUtils.convertToAppDistributionRelease(aabReleaseInProgress)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ private void startInstallActivity(String path, Activity currentActivity) {
Intent intent = new Intent(currentActivity, InstallActivity.class);
intent.putExtra("INSTALL_PATH", path);
currentActivity.startActivity(intent);
LogWrapper.getInstance().v(TAG + "Prompting user with install activity ");
LogWrapper.getInstance().v(TAG + "Prompting tester with install activity ");
}

void trySetInstallTaskError() {
synchronized (installTaskLock) {
safeSetTaskException(
installTaskCompletionSource,
new FirebaseAppDistributionException(
Constants.ErrorMessages.APK_INSTALLATION_FAILED,
FirebaseAppDistributionException.ErrorMessages.APK_INSTALLATION_FAILED,
FirebaseAppDistributionException.Status.INSTALLATION_FAILURE));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.TaskCompletionSource;
import com.google.firebase.FirebaseApp;
import com.google.firebase.appdistribution.Constants.ErrorMessages;
import com.google.firebase.appdistribution.FirebaseAppDistributionException.Status;
import com.google.firebase.appdistribution.internal.LogWrapper;
import java.io.BufferedOutputStream;
Expand Down Expand Up @@ -131,7 +130,9 @@ private void installApk(File file, boolean showDownloadNotificationManager) {
UpdateStatus.INSTALL_FAILED,
showDownloadNotificationManager);
setUpdateTaskCompletionErrorWithDefault(
e, ErrorMessages.APK_INSTALLATION_FAILED, Status.INSTALLATION_FAILURE);
e,
FirebaseAppDistributionException.ErrorMessages.APK_INSTALLATION_FAILED,
Status.INSTALLATION_FAILURE);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ static Builder builder() {
return new com.google.firebase.appdistribution.AutoValue_AppDistributionRelease.Builder();
}

/** The short bundle version of this build (example 1.0.0). */
/** Returns the short bundle version of this build (example: 1.0.0). */
@NonNull
public abstract String getDisplayVersion();

/** The version code of this build (example: 123). */
/** Returns the version code of this build (example: 123). */
@NonNull
public abstract long getVersionCode();

/** The release notes for this build. */
/** Returns the release notes for this build. */
@Nullable
public abstract String getReleaseNotes();

/** The binary type for this build. */
/** Returns the binary type for this build. */
@NonNull
public abstract BinaryType getBinaryType();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@
import com.google.auto.value.AutoValue;

/**
* This class represents the AppDistributionRelease object returned by the App Distribution backend
*
* <p>It is an immutable value class implemented by AutoValue.
*
* @see <a
* href="https://github.com/google/auto/tree/master/value">https://github.com/google/auto/tree/master/value</a>
* This class represents the AppDistributionRelease object returned by the App Distribution backend.
*/
@AutoValue
abstract class AppDistributionReleaseInternal {
Expand All @@ -34,38 +29,38 @@ static Builder builder() {
return new AutoValue_AppDistributionReleaseInternal.Builder();
}

/** The short bundle version of this build (example 1.0.0) */
/** The short bundle version of this build (example: 1.0.0). */
@NonNull
abstract String getDisplayVersion();

/** The bundle version of this build (example: 123) */
/** The bundle version of this build (example: 123). */
@NonNull
abstract String getBuildVersion();

/** The release notes for this build */
/** The release notes for this build. */
@Nullable
abstract String getReleaseNotes();

/** The binary type for this build */
/** The binary type for this build. */
@NonNull
abstract BinaryType getBinaryType();

/** Hash of binary of an Android app */
/** Hash of binary of an Android app. */
@Nullable
abstract String getCodeHash();

/** Efficient hash of an Android apk. Used to identify a release */
/** Efficient hash of an Android apk. Used to identify a release. */
@Nullable
abstract String getApkHash();

/**
* IAS artifact id. This value is inserted into the manifest of APK's installed via Used to map a
* release to an APK installed via an app bundle
* release to an APK installed via an app bundle.
*/
@Nullable
abstract String getIasArtifactId();

/** Short-lived download URL */
/** Short-lived download URL. */
@Nullable
abstract String getDownloadUrl();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package com.google.firebase.appdistribution;

/** Enum of Android app binary types, used in {@link AppDistributionRelease} */
/** Enum of Android app binary types, used in {@link AppDistributionRelease}. */
public enum BinaryType {
/** Android App Bundle. */
AAB,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import com.google.android.gms.tasks.TaskCompletionSource;
import com.google.android.gms.tasks.Tasks;
import com.google.firebase.FirebaseApp;
import com.google.firebase.appdistribution.Constants.ErrorMessages;
import com.google.firebase.appdistribution.FirebaseAppDistributionException.Status;
import com.google.firebase.appdistribution.internal.LogWrapper;
import com.google.firebase.appdistribution.internal.SignInStorage;
Expand Down Expand Up @@ -81,7 +80,7 @@ public class FirebaseAppDistribution {
private TaskCompletionSource<Void> showSignInDialogTask = null;
private TaskCompletionSource<Void> showUpdateDialogTask = null;

/** Constructor for FirebaseAppDistribution */
/** Constructor for FirebaseAppDistribution. */
@VisibleForTesting
FirebaseAppDistribution(
@NonNull FirebaseApp firebaseApp,
Expand All @@ -103,7 +102,7 @@ public class FirebaseAppDistribution {
lifecycleNotifier.addOnActivityResumedListener(this::onActivityResumed);
}

/** Constructor for FirebaseAppDistribution */
/** Constructor for FirebaseAppDistribution. */
FirebaseAppDistribution(
@NonNull FirebaseApp firebaseApp,
@NonNull Provider<FirebaseInstallationsApi> firebaseInstallationsApiProvider,
Expand All @@ -122,7 +121,7 @@ public class FirebaseAppDistribution {
lifecycleNotifier);
}

/** Constructor for FirebaseAppDistribution */
/** Constructor for FirebaseAppDistribution. */
FirebaseAppDistribution(
@NonNull FirebaseApp firebaseApp,
@NonNull Provider<FirebaseInstallationsApi> firebaseInstallationsApiProvider) {
Expand All @@ -142,15 +141,16 @@ public static FirebaseAppDistribution getInstance() {
/**
* Updates the app to the newest release, if one is available.
*
* <p>Returns the release information or null if no update is found. Performs the following
* actions:
* <p>Returns the release information or {@code null} if no update is found. Performs the
* following actions:
*
* <ol>
* <li>If tester is not signed in, presents the tester with a Google sign in UI.
* <li>If tester is not signed in, presents the tester with a Google Sign-in UI.
* <li>Checks if a newer release is available. If so, presents the tester with a confirmation
* dialog to begin the download.
* <li>For APKs, downloads the binary and starts an installation intent. For AABs, directs the
* tester to the Play app to complete the download and installation.
* <li>If the newest release is an APK, downloads the binary and starts an installation. If the
* newest release is an AAB, directs the tester to the Play app to complete the download and
* installation.
* </ol>
*/
@NonNull
Expand Down Expand Up @@ -239,20 +239,22 @@ private Task<Void> showSignInConfirmationDialog(Activity hostActivity) {
(dialogInterface, i) ->
showSignInDialogTask.setException(
new FirebaseAppDistributionException(
ErrorMessages.AUTHENTICATION_CANCELED, AUTHENTICATION_CANCELED)));
FirebaseAppDistributionException.ErrorMessages.AUTHENTICATION_CANCELED,
AUTHENTICATION_CANCELED)));

signInConfirmationDialog.setOnCancelListener(
dialogInterface ->
showSignInDialogTask.setException(
new FirebaseAppDistributionException(
ErrorMessages.AUTHENTICATION_CANCELED, AUTHENTICATION_CANCELED)));
FirebaseAppDistributionException.ErrorMessages.AUTHENTICATION_CANCELED,
AUTHENTICATION_CANCELED)));

signInConfirmationDialog.show();
});
return showSignInDialogTask.getTask();
}

/** Signs in the App Distribution tester. Presents the tester with a Google sign in UI */
/** Signs in the App Distribution tester. Presents the tester with a Google sign in UI. */
@NonNull
public Task<Void> signInTester() {
return this.testerSignInManager.signInTester();
Expand Down Expand Up @@ -329,13 +331,14 @@ private UpdateTask updateApp(boolean showDownloadInNotificationManager) {
LogWrapper.getInstance().v("New release not found.");
return getErrorUpdateTask(
new FirebaseAppDistributionException(
Constants.ErrorMessages.NOT_FOUND_ERROR, UPDATE_NOT_AVAILABLE));
FirebaseAppDistributionException.ErrorMessages.NOT_FOUND_ERROR,
UPDATE_NOT_AVAILABLE));
}
if (cachedNewRelease.getDownloadUrl() == null) {
LogWrapper.getInstance().v("Download failed to execute");
LogWrapper.getInstance().v("Download failed to execute.");
return getErrorUpdateTask(
new FirebaseAppDistributionException(
Constants.ErrorMessages.DOWNLOAD_URL_NOT_FOUND,
FirebaseAppDistributionException.ErrorMessages.DOWNLOAD_URL_NOT_FOUND,
FirebaseAppDistributionException.Status.DOWNLOAD_FAILURE));
}

Expand All @@ -352,7 +355,7 @@ public boolean isTesterSignedIn() {
return this.signInStorage.getSignInStatus();
}

/** Signs out the App Distribution tester */
/** Signs out the App Distribution tester. */
public void signOutTester() {
setCachedNewRelease(null);
this.signInStorage.setSignInStatus(false);
Expand All @@ -364,7 +367,8 @@ void onActivityResumed(Activity activity) {
if (dialogHostActivity != null && dialogHostActivity != activity) {
showSignInDialogTask.setException(
new FirebaseAppDistributionException(
ErrorMessages.HOST_ACTIVITY_INTERRUPTED, HOST_ACTIVITY_INTERRUPTED));
FirebaseAppDistributionException.ErrorMessages.HOST_ACTIVITY_INTERRUPTED,
HOST_ACTIVITY_INTERRUPTED));
} else {
showSignInConfirmationDialog(activity);
}
Expand All @@ -374,7 +378,8 @@ void onActivityResumed(Activity activity) {
if (dialogHostActivity != null && dialogHostActivity != activity) {
showUpdateDialogTask.setException(
new FirebaseAppDistributionException(
ErrorMessages.HOST_ACTIVITY_INTERRUPTED, HOST_ACTIVITY_INTERRUPTED));
FirebaseAppDistributionException.ErrorMessages.HOST_ACTIVITY_INTERRUPTED,
HOST_ACTIVITY_INTERRUPTED));
} else {
synchronized (cachedNewReleaseLock) {
showUpdateConfirmationDialog(
Expand Down Expand Up @@ -457,13 +462,15 @@ private Task<Void> showUpdateConfirmationDialog(
(dialogInterface, i) ->
showUpdateDialogTask.setException(
new FirebaseAppDistributionException(
ErrorMessages.UPDATE_CANCELED, Status.INSTALLATION_CANCELED)));
FirebaseAppDistributionException.ErrorMessages.UPDATE_CANCELED,
Status.INSTALLATION_CANCELED)));

updateConfirmationDialog.setOnCancelListener(
dialogInterface ->
showUpdateDialogTask.setException(
new FirebaseAppDistributionException(
ErrorMessages.UPDATE_CANCELED, Status.INSTALLATION_CANCELED)));
FirebaseAppDistributionException.ErrorMessages.UPDATE_CANCELED,
Status.INSTALLATION_CANCELED)));

updateConfirmationDialog.show();
});
Expand Down
Loading