summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/setupwizard/setup/DateTimePage.java
diff options
context:
space:
mode:
authorcretin45 <cretin45@gmail.com>2015-03-04 13:06:26 -0800
committercretin45 <cretin45@gmail.com>2015-03-04 13:08:00 -0800
commitef4cd78d5f5ca98cb2fdaa9e86d564bacb7f5f45 (patch)
treefe4c0d9d9c958856d789f7d6740274d8516ac4d3 /src/com/cyanogenmod/setupwizard/setup/DateTimePage.java
parentc9c13f20c9a86ad23381bef95a100189e0d08bca (diff)
downloadpackages_apps_SetupWizard-ef4cd78d5f5ca98cb2fdaa9e86d564bacb7f5f45.zip
packages_apps_SetupWizard-ef4cd78d5f5ca98cb2fdaa9e86d564bacb7f5f45.tar.gz
packages_apps_SetupWizard-ef4cd78d5f5ca98cb2fdaa9e86d564bacb7f5f45.tar.bz2
SetupWizard: Add metrics for internal builds that ship with CMStats
Change-Id: Id932a105c18332e32605530d1502ff99b7cf380a
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/setup/DateTimePage.java')
-rw-r--r--src/com/cyanogenmod/setupwizard/setup/DateTimePage.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/DateTimePage.java b/src/com/cyanogenmod/setupwizard/setup/DateTimePage.java
index 0e04fd9..15cfdca 100644
--- a/src/com/cyanogenmod/setupwizard/setup/DateTimePage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/DateTimePage.java
@@ -42,6 +42,7 @@ import android.widget.TextView;
import android.widget.TimePicker;
import com.cyanogenmod.setupwizard.R;
+import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
import org.xmlpull.v1.XmlPullParserException;
@@ -135,6 +136,8 @@ public class DateTimePage extends SetupPage {
mDateView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
+ SetupStats.addEvent(SetupStats.Categories.BUTTON_CLICK,
+ "date_picker");
showDatePicker();
}
});
@@ -142,6 +145,8 @@ public class DateTimePage extends SetupPage {
mTimeView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
+ SetupStats.addEvent(SetupStats.Categories.BUTTON_CLICK,
+ "time_picker");
showTimePicker();
}
});
@@ -162,11 +167,17 @@ public class DateTimePage extends SetupPage {
final Map<?, ?> map = (Map<?, ?>) adapterView.getItemAtPosition(position);
final String tzId = (String) map.get(KEY_ID);
if (mCurrentTimeZone != null && !mCurrentTimeZone.getID().equals(tzId)) {
+ SetupStats.addEvent(SetupStats.Categories.BUTTON_CLICK,
+ "timezone_picker");
// Update the system timezone value
final Activity activity = getActivity();
final AlarmManager alarm = (AlarmManager) activity.getSystemService(Context.ALARM_SERVICE);
alarm.setTimeZone(tzId);
mCurrentTimeZone = TimeZone.getTimeZone(tzId);
+ SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
+ SetupStats.Action.TIMEZONE_CHANGED,
+ SetupStats.Label.VALUE,
+ mCurrentTimeZone.getDisplayName());
}
}
@@ -209,6 +220,10 @@ public class DateTimePage extends SetupPage {
if (activity != null) {
setDate(activity, year, month, day);
updateTimeAndDateDisplay(activity);
+ SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
+ SetupStats.Action.DATE_CHANGED,
+ SetupStats.Label.VALUE,
+ month+"/"+day+"/"+year);
}
}
@@ -218,6 +233,10 @@ public class DateTimePage extends SetupPage {
if (activity != null) {
setTime(activity, hourOfDay, minute);
updateTimeAndDateDisplay(activity);
+ SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
+ SetupStats.Action.TIME_CHANGED,
+ SetupStats.Label.VALUE,
+ hourOfDay+":"+minute);
}
}