package com.huawei.hms.update.note; import android.app.Activity; import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; import android.view.KeyEvent; import com.huawei.hms.activity.IBridgeActivityDelegate; import com.huawei.hms.availableupdate.b; import com.huawei.hms.support.log.HMSLog; import com.huawei.hms.update.ui.NotInstalledHmsDialogHelper; /* loaded from: classes2.dex */ public class NotInstalledHmsResolution implements IBridgeActivityDelegate { private Dialog a; private Activity b; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes2.dex */ public static class a implements DialogInterface.OnClickListener { private final Activity a; public a(Activity activity) { this.a = activity; } @Override // android.content.DialogInterface.OnClickListener public void onClick(DialogInterface dialogInterface, int i) { HMSLog.i("NotInstalledHmsResolution", ""); this.a.finish(); } } private void a(Activity activity) { a(); this.a = NotInstalledHmsDialogHelper.getDialogBuilder(activity).setPositiveButton(NotInstalledHmsDialogHelper.getConfirmResId(activity), new a(activity)).show(); } @Override // com.huawei.hms.activity.IBridgeActivityDelegate public int getRequestCode() { HMSLog.i("NotInstalledHmsResolution", ""); return 0; } @Override // com.huawei.hms.activity.IBridgeActivityDelegate public void onBridgeActivityCreate(Activity activity) { HMSLog.i("NotInstalledHmsResolution", ""); if (activity != null && !activity.isFinishing()) { this.b = activity; b.b.a(activity); a(activity); return; } HMSLog.e("NotInstalledHmsResolution", " activity is null or finishing"); } @Override // com.huawei.hms.activity.IBridgeActivityDelegate public void onBridgeActivityDestroy() { HMSLog.i("NotInstalledHmsResolution", ""); a(); b.b.b(this.b); } @Override // com.huawei.hms.activity.IBridgeActivityDelegate public boolean onBridgeActivityResult(int i, int i2, Intent intent) { HMSLog.i("NotInstalledHmsResolution", ""); return false; } @Override // com.huawei.hms.activity.IBridgeActivityDelegate public void onBridgeConfigurationChanged() { HMSLog.i("NotInstalledHmsResolution", ""); Activity activity = this.b; if (activity != null && !activity.isFinishing()) { a(this.b); } else { HMSLog.e("NotInstalledHmsResolution", " mActivity is null or finishing"); } } @Override // com.huawei.hms.activity.IBridgeActivityDelegate public void onKeyUp(int i, KeyEvent keyEvent) { HMSLog.i("NotInstalledHmsResolution", ""); } private void a() { Dialog dialog = this.a; if (dialog == null || !dialog.isShowing()) { return; } this.a.cancel(); } }