Removed toast message for updating credentials when user manually accessed to the...
[pub/Android/ownCloud.git] / src / com / owncloud / android / authentication / AuthenticatorActivity.java
index 3c34be6..015be51 100644 (file)
@@ -84,6 +84,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
     public static final String EXTRA_USER_NAME = "USER_NAME";\r
     public static final String EXTRA_HOST_NAME = "HOST_NAME";\r
     public static final String EXTRA_ACTION = "ACTION";\r
+    public static final String EXTRA_ENFORCED_UPDATE = "ENFORCE_UPDATE";\r
 \r
     private static final String KEY_HOST_URL_TEXT = "HOST_URL_TEXT";\r
     private static final String KEY_OC_VERSION = "OC_VERSION";\r
@@ -110,7 +111,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
 \r
     public static final byte ACTION_CREATE = 0;\r
     public static final byte ACTION_UPDATE_TOKEN = 1;\r
-    \r
+\r
     private String mHostBaseUrl;\r
     private OwnCloudVersion mDiscoveredVersion;\r
 \r
@@ -205,7 +206,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
             }\r
             mOAuth2Check.setChecked(oAuthRequired);\r
             changeViewByOAuth2Check(oAuthRequired);\r
-\r
+            mJustCreated = true;\r
 \r
         } else {\r
             /// connection state and info\r
@@ -260,7 +261,6 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
         }\r
 \r
         mPasswordInput.setText("");     // clean password to avoid social hacking (disadvantage: password in removed if the device is turned aside)\r
-        mJustCreated = true;\r
 \r
         /// bind view elements to listeners\r
         mHostUrlInput.setOnFocusChangeListener(this);\r
@@ -369,7 +369,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
         super.onResume();\r
         // the state of mOAuth2Check is automatically recovered between configuration changes, but not before onCreate() finishes; so keep the next lines here\r
         changeViewByOAuth2Check(mOAuth2Check.isChecked());  \r
-        if (mAction == ACTION_UPDATE_TOKEN && mJustCreated) {\r
+        if (mAction == ACTION_UPDATE_TOKEN && mJustCreated && getIntent().getBooleanExtra(EXTRA_ENFORCED_UPDATE, false)) {\r
             if (mOAuth2Check.isChecked())\r
                 Toast.makeText(this, R.string.auth_expired_oauth_token_toast, Toast.LENGTH_LONG).show();\r
             else\r