Snap for 8758061 from 6685f5212500be05037f67ebfb34c1cd4e0d85f9 to studio-ee-release

Change-Id: If381bb0b72d46f7b9a01f6c814137190ad3b01bf
diff --git a/src/com/google/appindexing/ui/AppIndexingDialog.java b/src/com/google/appindexing/ui/AppIndexingDialog.java
index 4fb2328..3c4d5e4 100644
--- a/src/com/google/appindexing/ui/AppIndexingDialog.java
+++ b/src/com/google/appindexing/ui/AppIndexingDialog.java
@@ -44,14 +44,21 @@
 import com.intellij.ui.SortedComboBoxModel;
 import com.intellij.ui.TextFieldWithHistory;
 import com.intellij.ui.components.JBTextField;
+import java.awt.Font;
+import java.util.List;
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+import javax.swing.plaf.basic.BasicComboBoxEditor;
 import org.jetbrains.android.facet.AndroidFacet;
 import org.jetbrains.annotations.NotNull;
 
-import javax.swing.*;
-import javax.swing.plaf.basic.BasicComboBoxEditor;
-import java.awt.*;
-import java.util.List;
-
 /**
  * A dialog which setup config and start a Fetch as Google task.
  */
@@ -117,7 +124,8 @@
     myLoginButton.addActionListener(e -> {
       try {
         myLoginButton.setEnabled(false);
-        GoogleLogin.promptToLogIn(null, () -> ApplicationManager.getApplication().invokeLater(this::verifyInput, ModalityState.any()));
+        GoogleLogin.getInstance().logIn(null,
+                                        () -> ApplicationManager.getApplication().invokeLater(this::verifyInput, ModalityState.any()));
       }
       catch (Exception ex) {
         getLog().warn("Login fail", ex);
diff --git a/src/com/google/appindexing/ui/CheckErrorDialog.java b/src/com/google/appindexing/ui/CheckErrorDialog.java
index b71d24a..4df0d40 100644
--- a/src/com/google/appindexing/ui/CheckErrorDialog.java
+++ b/src/com/google/appindexing/ui/CheckErrorDialog.java
@@ -32,16 +32,16 @@
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.ui.ListCellRendererWrapper;
 import com.intellij.ui.SortedComboBoxModel;
+import java.util.Arrays;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
-import javax.swing.*;
-
-import java.util.Arrays;
-import java.util.stream.Collector;
-
-import static com.google.appindexing.ui.AppIndexingDialog.isModuleAccepted;
-
 /**
  * A dialog for users to select a module and login (if necessary) before checking app indexing errors.
  */
@@ -91,7 +91,8 @@
     myLoginButton.addActionListener(e -> {
       try {
         myLoginButton.setEnabled(false);
-        GoogleLogin.promptToLogIn(null, () -> ApplicationManager.getApplication().invokeLater(this::verifyInput, ModalityState.any()));
+        GoogleLogin.getInstance().logIn(null,
+                                        () -> ApplicationManager.getApplication().invokeLater(this::verifyInput, ModalityState.any()));
       }
       catch (Exception ex) {
         getLog().warn("Failed to login with your Google developer account.", ex);