Java Code Examples for com.google.android.play.core.install.model.InstallStatus#FAILED

The following examples show how to use com.google.android.play.core.install.model.InstallStatus#FAILED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommcareFlexibleAppUpdateManager.java    From commcare-android with Apache License 2.0 6 votes vote down vote up
/**
 * Gets {@link AppUpdateState} using {@link #mUpdateAvailability} and {@link #mInstallStatus}
 */
private AppUpdateState getAppUpdateState() {
    AppUpdateState state = AppUpdateState.UNAVAILABLE;
    switch (mInstallStatus) {
        case InstallStatus.PENDING:
        case InstallStatus.DOWNLOADING:
            state = AppUpdateState.DOWNLOADING;
            break;
        case InstallStatus.DOWNLOADED:
            state = AppUpdateState.DOWNLOADED;
            break;
        case InstallStatus.FAILED:
            state = AppUpdateState.FAILED;
            break;
    }
    if (state == AppUpdateState.UNAVAILABLE && mUpdateAvailability == UpdateAvailability.UPDATE_AVAILABLE) {
        state = AppUpdateState.AVAILABLE;
    }
    return state;
}
 
Example 2
Source File: CommcareFlexibleAppUpdateManager.java    From commcare-android with Apache License 2.0 5 votes vote down vote up
@Override
public void startUpdate(Activity activity) {
    try {
        boolean success = mAppUpdateManager.startUpdateFlowForResult(
                mAppUpdateInfo, AppUpdateType.FLEXIBLE, activity, IN_APP_UPDATE_REQUEST_CODE);
        if (!success) {
            Logger.log(TAG, "startUpdate|requested update cannot be started");
        }
    } catch (IntentSender.SendIntentException exception) {
        mInstallStatus = InstallStatus.FAILED;
        mInstallErrorCode = InstallErrorCode.ERROR_INTERNAL_ERROR;
        Logger.log(TAG, "startUpdate|failed with : " + exception.getMessage());
        publishStatus();
    }
}
 
Example 3
Source File: InAppUpdateStatus.java    From android-inapp-update with Apache License 2.0 4 votes vote down vote up
public boolean isFailed() {
    if (installState != null)
        return installState.installStatus() == InstallStatus.FAILED;

    return false;
}