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

Commit ea34b6df authored by Angela Wang's avatar Angela Wang Committed by Android (Google) Code Review
Browse files

Merge "Fix crash when calling sendActivityIfAvailable()" into main

parents 9095c262 ec2665d9
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.slices.SlicePreferenceController;
import com.android.settingslib.bluetooth.BluetoothUtils;
import com.android.settingslib.bluetooth.HearingAidStatsLogUtils;

import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.settingslib.search.SearchIndexable;

@@ -100,17 +99,22 @@ public class ConnectedDeviceDashboardFragment extends DashboardFragment {
        use(DiscoverableFooterPreferenceController.class)
                .setAlwaysDiscoverable(isAlwaysDiscoverable(callingAppPackageName, action));

        logPageEntrypoint(context, callingAppPackageName, intent);
    }

    @Override
    public void onResume() {
        super.onResume();

        // Show hearing devices survey if user is categorized as one of interested category
        final String category = HearingAidStatsLogUtils.getUserCategory(context);
        final String category = HearingAidStatsLogUtils.getUserCategory(getContext());
        if (category != null && !category.isEmpty()) {
            SurveyFeatureProvider provider =
                    FeatureFactory.getFeatureFactory().getSurveyFeatureProvider(context);
                    FeatureFactory.getFeatureFactory().getSurveyFeatureProvider(getContext());
            if (provider != null) {
                provider.sendActivityIfAvailable(category);
            }
        }

        logPageEntrypoint(context, callingAppPackageName, intent);
    }

    @VisibleForTesting