Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
11 kB
1
Indexable
Never
Aaaa
package com.santander.app.homelogada.presentation;

/**
 * Created by Santander on 01/01/18.
 */


import static com.santander.app.homelogada.presentation.IdSantanderCallerKt.KEY_BLOCKED_ID_FLAG;
import static com.santander.app.homelogada.presentation.IdSantanderCallerKt.PREFS_BLOCKED_ID_SNT;
import static com.santander.app.homelogada.presentation.IdSantanderCallerKt.getDocumentKey;

import android.app.Dialog;
import android.content.Intent;
import android.content.IntentSender;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;

import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.fragment.app.Fragment;


import com.google.android.play.core.appupdate.AppUpdateInfo;
import com.google.android.play.core.appupdate.AppUpdateManager;
import com.google.android.play.core.appupdate.AppUpdateManagerFactory;
import com.google.android.play.core.install.model.AppUpdateType;
import com.google.android.play.core.install.model.UpdateAvailability;
import com.google.android.play.core.review.ReviewInfo;
import com.google.android.play.core.review.ReviewManager;
import com.google.android.play.core.review.ReviewManagerFactory;
import com.google.android.play.core.tasks.OnCompleteListener;
import com.google.android.play.core.tasks.OnFailureListener;
import com.google.android.play.core.tasks.Task;
import com.google.firebase.crashlytics.FirebaseCrashlytics;
import com.santander.app.MinhaConta;
import com.santander.app.R;
import com.santander.app.acessocanal.task.FutureCallBackTask;
import com.santander.app.analytics.AnalyticsTags;
import com.santander.app.analytics.PerformanceTraces;
import com.santander.app.analytics.firebase.Tags;
import com.santander.app.authentication.SantanderIdEnablingData;
import com.santander.app.avaliacaostore.presentation.AvaliacaoDialog;
import com.santander.app.avaliacaostore.presentation.contract.IAvaliarAppView;
import com.santander.app.avaliacaostore.presenter.AvaliacaoAppPresenter;
import com.santander.app.biometric.facial.register.RegisterFacialBiometricsApplicationStarter;
import com.santander.app.cartoes.parcelamentofatura.ParcelamentoFaturasApplicationStarter;
import com.santander.app.chat.Chat;
import com.santander.app.chat.ChatApplication;
import com.santander.app.chat.controller.ChatController;
import com.santander.app.components.view.SessionControlledActivity;
import com.santander.app.components.view.avisofinalano.AvisoFinalAnoActivity;
import com.santander.app.components.view.cardLayout.CardLayout;
import com.santander.app.contacorrente.domain.Conta;
import com.santander.app.crm.CrmShared;
import com.santander.app.crm.PageEnum;
import com.santander.app.datacontroller.ControllerResolver;
import com.santander.app.datacontroller.DataController;
import com.santander.app.dataservice.BannerService;
import com.santander.app.deeplink.DeepLinkType;
import com.santander.app.deeplink.MainDeepLinkRedirect;
import com.santander.app.ecommerce.view.ECommerceDialog;
import com.santander.app.ecommerce.view.ECommerceDialogImpl;
import com.santander.app.homelogada.interactor.MenuInteractor;
import com.santander.app.homelogada.interactor.MenuInteractorImpl;
import com.santander.app.homelogada.novahome.presentation.HomeLoggedFragment;
import com.santander.app.homelogada.presenter.HomeLogadaPresenter;
import com.santander.app.homelogada.presenter.HomeLogadaPresenterImpl;
import com.santander.app.idsantander.IdSantanderTipoConversaoEnum;
import com.santander.app.idsantander.habilitacaoIdRemoto.features.offer.presentation.IdSantanderRemoteOfferActivity;
import com.santander.app.idsantander.habilitargeolocalizacao.dialog.HabilitarIDGeoLocalizacao;
import com.santander.app.idsantander.presentation.IdSantanderHabilitacaoActivity;
import com.santander.app.idsantander.presentation.IdSantanderHabilitacaoSMSOfertaActivity;
import com.santander.app.idsantander.presentation.IdSantanderOfertaActivity;
import com.santander.app.idsantander.presentation.IdSantanderOtimizacaoActivity;
import com.santander.app.meugerente.MeuGerenteApplicationStarter;
import com.santander.app.meuperfil.presentation.EscolhaContaPreferencialActivity;
import com.santander.app.newmenu.utils.DefaultDialogUtils;
import com.santander.app.news.NewsActivity;
import com.santander.app.pagamentos.titulos.presentation.PagamentosCodigoBarrasActivity;
import com.santander.app.personaldataprotection.LgpdApplicationStarter;
import com.santander.app.propostasemaberto.presentation.PropostasEmAbertoActivity;
import com.santander.app.santanderon.controller.SantanderOnController;
import com.santander.app.santanderwebviewbridge.common.WebViewBridgeConstants;
import com.santander.app.santanderwebviewbridge.features.creditcardinvoicepayment.CreditCardInvoicePaymentApplicationStarter;
import com.santander.app.sessionmanagement.domain.ISession;
import com.santander.app.sessionmanagement.domain.Session;
import com.santander.app.util.AvaliarHelperKt;
import com.santander.app.util.DialogUtil;
import com.santander.app.util.ImageUtil;
import com.santander.app.util.NaoManterAtividadesHelperKt;
import com.santander.app.util.NaoManterProperties;
import com.santander.app.util.ReloadHomeServicesUtil;
import com.santander.app.util.SecurityUtil;
import com.santander.app.util.accessibility.AccessibilityUtil;
import com.santander.app.util.dynamicauth.DynamicAuthApp;
import com.santander.app.util.dynamicauth.DynamicAuthenticationService;
import com.santander.app.util.encryptation.KeyStoreHelper;
import com.santander.app.util.security.DeviceProfiler;
import com.santander.app.util.toolbar.ToolBarHandler;
import com.santander.app.validation.TipoUsuarioConsultivoEnum;
import com.santander.app.validation.presentation.IdSantanderUsuarioConsultivoActivity;
import com.santander.app.welcome.WelcomeLibApplicationStarter;
import com.santander.interact.repository.model.offer.InteractionPoint;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;

import app.santander.com.module.SantanderLogger;
import br.com.santander.analytics.SantanderAnalytics;
import br.com.santander.chatbot.elegibilidade.core.Constants;
import br.com.santander.commons.utils.firebase.FirebaseService;
import br.com.santander.crmlib.lightbox.LightboxAd;
import br.com.santander.modulo.mbbcoredomain.domain.UserProfile;
import br.com.santander.modulo.welcomesantander.WelcomeApplication;
import br.com.santander.modulo.welcomesantander.commons.WelcomeIDSantanderCallback;
import br.com.santander.modulo.welcomesantander.feature.task.domain.TaskCash;
import br.com.santander.modulo.welcomesantander.service.WelcomeService;
import br.com.santander.preferences.Preferences;
import br.com.santander.semaphore.SemaphoreApplication;
import br.com.santander.semaphore.domain.SemaphoreCode;
import br.com.santander.semaphore.interfaces.ISemaphoreCache;
import br.com.santander.syncstorage.domain.Property;
import br.com.santander.syncstorage.service.StorageService;
import br.com.santander.ui.dialog.view.SantanderDialog;
import br.com.santander.ui.iconBadge.SantanderIconWithBadge;


private void checkForAppUpdate() {
    AppUpdateManager appUpdateManager = AppUpdateManagerFactory.create(this);

    Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();

    appUpdateInfoTask.addOnSuccessListener(appUpdateInfo -> {
        if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE
                && appUpdateInfo.updatePriority() >= 4 /* high priority */
                && appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)) {
            try {
                appUpdateManager.startUpdateFlowForResult(
                        appUpdateInfo,
                        AppUpdateType.FLEXIBLE,
                        this,
                        100
                );
            } catch (IntentSender.SendIntentException e) {
                throw new RuntimeException(e);
            }
        }
    });
}

@Override
public void dialogAvaliarShow() {
    if (SemaphoreApplication.getInstance().getSemaphoreCache().isOn(SemaphoreCode.MBB_IN_APP_REVIEW)) {
        boolean showAvaliarDialog = AvaliarHelperKt.shouldShowAvaliarDialog(this);
        if (showAvaliarDialog) {
            final ReviewManager reviewManager = ReviewManagerFactory.create(this);

            Task<ReviewInfo> request = reviewManager.requestReviewFlow();
            request.addOnCompleteListener(new OnCompleteListener<ReviewInfo>() {
                @Override
                public void onComplete(@NonNull Task<ReviewInfo> task) {
                    if (task.isSuccessful()) {
                        ReviewInfo reviewInfo = task.getResult();
                        Task<Void> flow = reviewManager.launchReviewFlow(HomeLogadaActivity.this, reviewInfo);
                        flow.addOnCompleteListener(new OnCompleteListener<Void>() {
                            @Override
                            public void onComplete(@NonNull Task<Void> task) {
                                SantanderLogger.d("Caixa de diálogo de revisão do Google exibida");
                            }
                        });
                        flow.addOnFailureListener(new OnFailureListener() {
                            @Override
                            public void onFailure(Exception e) {
                                SantanderLogger.d("Google App Review - ", e.getMessage());
                            }
                        });
                    } else {
                        SantanderLogger.d("Problema ao mostrar o Google na avaliação do aplicativo");
                    }
                }
            });
        }
    }
}


/Users/t767903/Documents/Personal/ModulosLibs/gapzero-android/app/src/main/java/com/santander/app/homelogada/presentation/HomeLogadaActivity.java:340: error: incompatible types: com.google.android.gms.tasks.Task<AppUpdateInfo> cannot be converted to com.google.android.play.core.tasks.Task<AppUpdateInfo>
        Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();
                                                                                 ^