Add EventLogging for Login success / failure

This commit is contained in:
YuviPanda 2013-02-19 01:20:59 +05:30
parent 6e2c3341b7
commit 34eb356108
2 changed files with 9 additions and 2 deletions

View file

@ -59,7 +59,7 @@ public class CommonsApplication extends Application {
public static final String EVENTLOG_URL = "https://bits.wikimedia.org/event.gif";
public static final Object[] EVENT_UPLOAD_ATTEMPT = {"MobileAppUploadAttempts", 5241449L};
public static final Object[] EVENT_LOGIN_ATTEMPT = {"MobileAppLoginAttempts", 5240393L};
public static final Object[] EVENT_LOGIN_ATTEMPT = {"MobileAppLoginAttempts", 5254859L};
public static final String DEFAULT_EDIT_SUMMARY = "Uploaded using Android Commons app";

View file

@ -4,6 +4,7 @@ import java.io.IOException;
import android.content.ContentResolver;
import org.wikimedia.commons.CommonsApplication;
import org.wikimedia.commons.EventLog;
import org.wikimedia.commons.R;
import org.wikimedia.commons.R.id;
import org.wikimedia.commons.R.layout;
@ -47,6 +48,12 @@ public class LoginActivity extends AccountAuthenticatorActivity {
protected void onPostExecute(String result) {
super.onPostExecute(result);
Log.d("Commons", "Login done!");
EventLog.schema(CommonsApplication.EVENT_LOGIN_ATTEMPT)
.param("username", username)
.param("result", result)
.log();
if (result.equals("Success")) {
dialog.dismiss();
Toast successToast = Toast.makeText(context, R.string.login_success, Toast.LENGTH_SHORT);