Add locale recommendation metrics

Bug: 275306065
Test: atest SettingsRoboTests:com.android.settings.localepicker
Change-Id: I7263c292eee51475274585fe4c0864f82fabf7d2
This commit is contained in:
Allen Su
2023-12-25 02:56:30 +00:00
parent b1ab7f0373
commit 30e1bf61b7
7 changed files with 31 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ package com.android.settings.localepicker;
import static com.android.settings.localepicker.AppLocalePickerActivity.EXTRA_APP_LOCALE;
import static com.android.settings.localepicker.AppLocalePickerActivity.EXTRA_NOTIFICATION_ID;
import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -26,6 +27,8 @@ import android.util.Log;
import androidx.annotation.VisibleForTesting;
import com.android.settings.overlay.FeatureFactory;
/**
* A Broadcast receiver that handles the locale notification which is swiped away.
*/
@@ -41,6 +44,8 @@ public class NotificationCancelReceiver extends BroadcastReceiver {
Log.i(TAG, "Locale notification is swiped away.");
if (savedNotificationID == notificationId) {
getNotificationController(context).incrementDismissCount(appLocale);
FeatureFactory.getFeatureFactory().getMetricsFeatureProvider().action(context,
SettingsEnums.ACTION_NOTIFICATION_SWIPE_FOR_SYSTEM_LOCALE);
}
}