Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5e82400 authored by Sunny Shao's avatar Sunny Shao
Browse files

Add page creation latency for updatePreferenceStates

- The updatePreferenceStates is called in the onResume. Here creates a new enum to
  record the elapsed time.

Bug: 137558156
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.dashboard
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.core
Change-Id: I02bdbeecd61fbc0082eea19ea64cbfe7541a6970
parent e7ff0891
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -98,6 +98,10 @@ public abstract class InstrumentedPreferenceFragment extends ObservablePreferenc
        return -1;
    }

    protected void writeElapsedTimeMetric(int action, String key) {
        mVisibilityLoggerMixin.writeElapsedTimeMetric(action, key);
    }

    private void updateActivityTitleWithScreenTitle(PreferenceScreen screen) {
        if (screen != null) {
            final CharSequence title = screen.getTitle();
+4 −3
Original line number Diff line number Diff line
@@ -73,13 +73,12 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
            new ArrayMap<>();
    private final List<DynamicDataObserver> mRegisteredObservers = new ArrayList<>();
    private final List<AbstractPreferenceController> mControllers = new ArrayList<>();

    @VisibleForTesting
    UiBlockerController mBlockerController;
    private DashboardFeatureProvider mDashboardFeatureProvider;
    private DashboardTilePlaceholderPreferenceController mPlaceholderPreferenceController;
    private boolean mListeningToCategoryChange;
    private List<String> mSuppressInjectedTileKeys;
    @VisibleForTesting
    UiBlockerController mBlockerController;

    @Override
    public void onAttach(Context context) {
@@ -195,6 +194,8 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
    public void onResume() {
        super.onResume();
        updatePreferenceStates();
        writeElapsedTimeMetric(SettingsEnums.ACTION_DASHBOARD_VISIBLE_TIME,
                "isParalleledControllers:" + isParalleledControllers());
    }

    @Override