Increment TeX counters for the HCT migration notification.

See the corresponding TeX change for more details.

Bug: 369906140
Flag: com.android.graphics.hwui.flags.high_contrast_text_small_text_rect
Test: run statsd_testdrive 644 and verify the output when the
      notification appears
Test: ensure that rotating / restarting the activity does not trigger
      multiple increments to the counter
Change-Id: Iea01962611e3e327cfbde6f3451f7f1ec54b955e
This commit is contained in:
Daniel Norman
2025-01-21 21:49:32 +00:00
parent ffb64450e0
commit 5b2a769765
2 changed files with 16 additions and 0 deletions

View File

@@ -34,6 +34,8 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import com.android.graphics.hwui.flags.Flags;
import com.android.modules.expresslog.Counter;
import com.android.settings.R;
import com.android.settings.accessibility.AccessibilityDialogUtils.DialogEnums;
import com.android.settings.dashboard.DashboardFragment;
@@ -84,6 +86,7 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
EntryPoint.SUW_ANYTHING_ELSE,
EntryPoint.DISPLAY_SETTINGS,
EntryPoint.ACCESSIBILITY_SETTINGS,
EntryPoint.HIGH_CONTRAST_TEXT_NOTIFICATION,
})
@interface EntryPoint {
int UNKNOWN_ENTRY = 0;
@@ -91,6 +94,7 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
int SUW_ANYTHING_ELSE = 2;
int DISPLAY_SETTINGS = 3;
int ACCESSIBILITY_SETTINGS = 4;
int HIGH_CONTRAST_TEXT_NOTIFICATION = 5;
}
@VisibleForTesting
@@ -121,6 +125,14 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
rootView.setAccessibilityPaneTitle(getString(
R.string.accessibility_text_reading_options_title));
}
if (Flags.highContrastTextSmallTextRect()) {
updateEntryPoint();
if (mEntryPoint == EntryPoint.HIGH_CONTRAST_TEXT_NOTIFICATION
// Only log this counter during the first launch, not during activity refresh
&& savedInstanceState == null) {
Counter.logIncrement("accessibility.value_hct_notification_opened_settings");
}
}
}
@Override