provide better instructions for adding settings views.
And provide a ready default constant.
Change-Id: I76c9ee50af5d97f9f83be7b0eb862f73fc9bfa7b
diff --git a/src/com/android/settings/InstrumentedFragment.java b/src/com/android/settings/InstrumentedFragment.java
index 96b7296..604af18 100644
--- a/src/com/android/settings/InstrumentedFragment.java
+++ b/src/com/android/settings/InstrumentedFragment.java
@@ -23,6 +23,16 @@
* Instrumented fragment that logs visibility state.
*/
public abstract class InstrumentedFragment extends PreferenceFragment {
+ // Declare new temproary categories here, starting after this value.
+ public static final int VIEW_CATEGORY_UNDECLARED = 100000;
+
+ /**
+ * Declare the view of this category.
+ *
+ * Categories are defined in {@link com.android.internal.logging.MetricsLogger}
+ * or if there is no relevant existing category you may define one in
+ * {@link com.android.settings.InstrumentedFragment}.
+ */
protected abstract int getMetricsCategory();
@Override
diff --git a/src/com/android/settings/InstrumentedPreferenceActivity.java b/src/com/android/settings/InstrumentedPreferenceActivity.java
index 8ad88b0..480d5c7 100644
--- a/src/com/android/settings/InstrumentedPreferenceActivity.java
+++ b/src/com/android/settings/InstrumentedPreferenceActivity.java
@@ -23,6 +23,13 @@
* Instrumented activity that logs visibility state.
*/
public abstract class InstrumentedPreferenceActivity extends PreferenceActivity {
+ /**
+ * Declare the view of this category.
+ *
+ * Categories are defined in {@link com.android.internal.logging.MetricsLogger}
+ * or if there is no relevant existing category you may define one in
+ * {@link com.android.settings.InstrumentedFragment}.
+ */
protected abstract int getMetricsCategory();
@Override
diff --git a/src/com/android/settings/InstrumentedPreferenceFragment.java b/src/com/android/settings/InstrumentedPreferenceFragment.java
index 1d86102..f56bce0 100644
--- a/src/com/android/settings/InstrumentedPreferenceFragment.java
+++ b/src/com/android/settings/InstrumentedPreferenceFragment.java
@@ -23,6 +23,13 @@
* Instrumented preference fragment that logs visibility state.
*/
public abstract class InstrumentedPreferenceFragment extends PreferenceFragment {
+ /**
+ * Declare the view of this category.
+ *
+ * Categories are defined in {@link com.android.internal.logging.MetricsLogger}
+ * or if there is no relevant existing category you may define one in
+ * {@link com.android.settings.InstrumentedFragment}.
+ */
protected abstract int getMetricsCategory();
@Override