Loading src/com/android/settings/localepicker/AppLocalePickerActivity.java +2 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,8 @@ public class AppLocalePickerActivity extends SettingsBaseActivity localeInfo.getFullNameNative()), getString(R.string.desc_system_locale_addition), localeTag); mMetricsFeatureProvider.action(this, SettingsEnums.ACTION_NOTIFICATION_FOR_SYSTEM_LOCALE); } } catch (PackageManager.NameNotFoundException e) { Log.e(TAG, "Unable to find info for package: " + mPackageName); Loading src/com/android/settings/localepicker/LocaleListEditor.java +3 −0 Original line number Diff line number Diff line Loading @@ -245,6 +245,7 @@ public class LocaleListEditor extends RestrictedSettingsFragment implements View } mAdapter.setCacheItemList(); } else if (requestCode == DIALOG_ADD_SYSTEM_LOCALE) { int action = SettingsEnums.ACTION_CANCEL_SYSTEM_LOCALE_FROM_RECOMMENDATION; if (resultCode == Activity.RESULT_OK) { localeInfo = (LocaleStore.LocaleInfo) data.getExtras().getSerializable( LocaleDialogFragment.ARG_TARGET_LOCALE); Loading @@ -252,7 +253,9 @@ public class LocaleListEditor extends RestrictedSettingsFragment implements View getContext().getContentResolver(), Settings.System.LOCALE_PREFERENCES); mAdapter.addLocale(mayAppendUnicodeTags(localeInfo, preferencesTags)); action = SettingsEnums.ACTION_ADD_SYSTEM_LOCALE_FROM_RECOMMENDATION; } mMetricsFeatureProvider.action(getContext(), action); } super.onActivityResult(requestCode, resultCode, data); } Loading src/com/android/settings/localepicker/NotificationActionActivity.java +5 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static com.android.settings.localepicker.AppLocalePickerActivity.EXTRA_NO import static com.android.settings.localepicker.LocaleListEditor.EXTRA_SYSTEM_LOCALE_DIALOG_TYPE; import static com.android.settings.localepicker.LocaleListEditor.LOCALE_SUGGESTION; import android.app.settings.SettingsEnums; import android.content.Context; import android.content.Intent; import android.os.Bundle; Loading @@ -32,6 +33,8 @@ import androidx.activity.result.contract.ActivityResultContracts; import androidx.annotation.VisibleForTesting; import androidx.appcompat.app.AppCompatActivity; import com.android.settings.overlay.FeatureFactory; /** * An Activity that launches the system locale settings page. */ Loading Loading @@ -60,6 +63,8 @@ public class NotificationActionActivity extends AppCompatActivity { actionIntent.putExtra(EXTRA_APP_LOCALE, appLocale); actionIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); getLauncher().launch(actionIntent); FeatureFactory.getFeatureFactory().getMetricsFeatureProvider().action(this, SettingsEnums.ACTION_NOTIFICATION_CLICK_FOR_SYSTEM_LOCALE); finish(); return; } Loading src/com/android/settings/localepicker/NotificationCancelReceiver.java +5 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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. */ Loading @@ -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); } } Loading tests/robotests/src/com/android/settings/localepicker/AppLocalePickerActivityTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -314,6 +314,8 @@ public class AppLocalePickerActivityTest { assertThat(info.getNotificationCount()).isEqualTo(1); assertThat(info.getDismissCount()).isEqualTo(0); assertThat(info.getLastNotificationTimeMs()).isNotEqualTo(0); verify(mFeatureFactory.metricsFeatureProvider).action( any(), eq(SettingsEnums.ACTION_NOTIFICATION_FOR_SYSTEM_LOCALE)); mDataManager.clearLocaleNotificationMap(); } Loading Loading
src/com/android/settings/localepicker/AppLocalePickerActivity.java +2 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,8 @@ public class AppLocalePickerActivity extends SettingsBaseActivity localeInfo.getFullNameNative()), getString(R.string.desc_system_locale_addition), localeTag); mMetricsFeatureProvider.action(this, SettingsEnums.ACTION_NOTIFICATION_FOR_SYSTEM_LOCALE); } } catch (PackageManager.NameNotFoundException e) { Log.e(TAG, "Unable to find info for package: " + mPackageName); Loading
src/com/android/settings/localepicker/LocaleListEditor.java +3 −0 Original line number Diff line number Diff line Loading @@ -245,6 +245,7 @@ public class LocaleListEditor extends RestrictedSettingsFragment implements View } mAdapter.setCacheItemList(); } else if (requestCode == DIALOG_ADD_SYSTEM_LOCALE) { int action = SettingsEnums.ACTION_CANCEL_SYSTEM_LOCALE_FROM_RECOMMENDATION; if (resultCode == Activity.RESULT_OK) { localeInfo = (LocaleStore.LocaleInfo) data.getExtras().getSerializable( LocaleDialogFragment.ARG_TARGET_LOCALE); Loading @@ -252,7 +253,9 @@ public class LocaleListEditor extends RestrictedSettingsFragment implements View getContext().getContentResolver(), Settings.System.LOCALE_PREFERENCES); mAdapter.addLocale(mayAppendUnicodeTags(localeInfo, preferencesTags)); action = SettingsEnums.ACTION_ADD_SYSTEM_LOCALE_FROM_RECOMMENDATION; } mMetricsFeatureProvider.action(getContext(), action); } super.onActivityResult(requestCode, resultCode, data); } Loading
src/com/android/settings/localepicker/NotificationActionActivity.java +5 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static com.android.settings.localepicker.AppLocalePickerActivity.EXTRA_NO import static com.android.settings.localepicker.LocaleListEditor.EXTRA_SYSTEM_LOCALE_DIALOG_TYPE; import static com.android.settings.localepicker.LocaleListEditor.LOCALE_SUGGESTION; import android.app.settings.SettingsEnums; import android.content.Context; import android.content.Intent; import android.os.Bundle; Loading @@ -32,6 +33,8 @@ import androidx.activity.result.contract.ActivityResultContracts; import androidx.annotation.VisibleForTesting; import androidx.appcompat.app.AppCompatActivity; import com.android.settings.overlay.FeatureFactory; /** * An Activity that launches the system locale settings page. */ Loading Loading @@ -60,6 +63,8 @@ public class NotificationActionActivity extends AppCompatActivity { actionIntent.putExtra(EXTRA_APP_LOCALE, appLocale); actionIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); getLauncher().launch(actionIntent); FeatureFactory.getFeatureFactory().getMetricsFeatureProvider().action(this, SettingsEnums.ACTION_NOTIFICATION_CLICK_FOR_SYSTEM_LOCALE); finish(); return; } Loading
src/com/android/settings/localepicker/NotificationCancelReceiver.java +5 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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. */ Loading @@ -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); } } Loading
tests/robotests/src/com/android/settings/localepicker/AppLocalePickerActivityTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -314,6 +314,8 @@ public class AppLocalePickerActivityTest { assertThat(info.getNotificationCount()).isEqualTo(1); assertThat(info.getDismissCount()).isEqualTo(0); assertThat(info.getLastNotificationTimeMs()).isNotEqualTo(0); verify(mFeatureFactory.metricsFeatureProvider).action( any(), eq(SettingsEnums.ACTION_NOTIFICATION_FOR_SYSTEM_LOCALE)); mDataManager.clearLocaleNotificationMap(); } Loading