[Regional Preference] Need to remove the metrics by the metrics concil
team's comment. Bug: 296544040 Test: manual Change-Id: I8eecba55288bfad6f81b5c8c1a8290afccdd5ef8
This commit is contained in:
@@ -204,8 +204,6 @@ public class LocaleDialogFragment extends InstrumentedDialogFragment {
|
||||
bundle.putInt(ARG_DIALOG_TYPE, DIALOG_CONFIRM_SYSTEM_DEFAULT);
|
||||
intent.putExtras(bundle);
|
||||
mParent.onActivityResult(DIALOG_CONFIRM_SYSTEM_DEFAULT, result, intent);
|
||||
mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_CHANGE_LANGUAGE,
|
||||
changed);
|
||||
}
|
||||
mShouldKeepDialog = false;
|
||||
}
|
||||
|
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.settings.localepicker;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.os.Bundle;
|
||||
@@ -39,7 +38,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.android.internal.app.LocalePicker;
|
||||
import com.android.internal.app.LocaleStore;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.shortcut.ShortcutsUpdateTask;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
@@ -53,7 +51,6 @@ class LocaleDragAndDropAdapter
|
||||
private static final String TAG = "LocaleDragAndDropAdapter";
|
||||
private static final String CFGKEY_SELECTED_LOCALES = "selectedLocales";
|
||||
private static final String CFGKEY_DRAG_LOCALE = "dragLocales";
|
||||
private static final String CFGKEY_DRAG_LOCALES_TO_POSITION = "dragLocales_end";
|
||||
|
||||
private final Context mContext;
|
||||
private final ItemTouchHelper mItemTouchHelper;
|
||||
@@ -61,7 +58,6 @@ class LocaleDragAndDropAdapter
|
||||
private List<LocaleStore.LocaleInfo> mFeedItemList;
|
||||
private List<LocaleStore.LocaleInfo> mCacheItemList;
|
||||
private RecyclerView mParentView = null;
|
||||
private LocaleListEditor mParent;
|
||||
private boolean mRemoveMode = false;
|
||||
private boolean mDragEnabled = true;
|
||||
private NumberFormat mNumberFormatter = NumberFormat.getNumberInstance();
|
||||
@@ -94,7 +90,6 @@ class LocaleDragAndDropAdapter
|
||||
|
||||
LocaleDragAndDropAdapter(LocaleListEditor parent, List<LocaleStore.LocaleInfo> feedItemList) {
|
||||
mFeedItemList = feedItemList;
|
||||
mParent = parent;
|
||||
mCacheItemList = new ArrayList<>(feedItemList);
|
||||
mContext = parent.getContext();
|
||||
|
||||
@@ -230,12 +225,6 @@ class LocaleDragAndDropAdapter
|
||||
"Negative position in onItemMove %d -> %d", fromPosition, toPosition));
|
||||
}
|
||||
|
||||
if (fromPosition != toPosition) {
|
||||
FeatureFactory.getFeatureFactory().getMetricsFeatureProvider()
|
||||
.action(mContext, SettingsEnums.ACTION_REORDER_LANGUAGE,
|
||||
mDragLocale.getLocale().toLanguageTag() + " move to " + toPosition);
|
||||
}
|
||||
|
||||
notifyItemChanged(fromPosition); // to update the numbers
|
||||
notifyItemChanged(toPosition);
|
||||
notifyItemMoved(fromPosition, toPosition);
|
||||
@@ -274,9 +263,6 @@ class LocaleDragAndDropAdapter
|
||||
for (int i = itemCount - 1; i >= 0; i--) {
|
||||
localeInfo = mFeedItemList.get(i);
|
||||
if (localeInfo.getChecked()) {
|
||||
FeatureFactory.getFeatureFactory().getMetricsFeatureProvider()
|
||||
.action(mContext, SettingsEnums.ACTION_REMOVE_LANGUAGE,
|
||||
localeInfo.getLocale().toLanguageTag());
|
||||
mFeedItemList.remove(i);
|
||||
}
|
||||
}
|
||||
|
@@ -216,8 +216,6 @@ public class LocaleListEditor extends RestrictedSettingsFragment implements View
|
||||
localeInfo = mayAppendUnicodeTags(localeInfo, preferencesTags);
|
||||
mAdapter.addLocale(localeInfo);
|
||||
updateVisibilityOfRemoveMenu();
|
||||
mMetricsFeatureProvider.action(getContext(), SettingsEnums.ACTION_ADD_LANGUAGE,
|
||||
localeInfo.getLocale().toLanguageTag());
|
||||
} else if (requestCode == DIALOG_CONFIRM_SYSTEM_DEFAULT) {
|
||||
localeInfo = mAdapter.getFeedItemList().get(0);
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
|
@@ -24,7 +24,6 @@ import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.LocaleList;
|
||||
@@ -52,7 +51,6 @@ public class NumberingSystemItemControllerTest {
|
||||
private NumberingPreferencesFragment mFragment;
|
||||
private PreferenceScreen mPreferenceScreen;
|
||||
private LocaleList mCacheLocale;
|
||||
private FakeFeatureFactory mFeatureFactory;
|
||||
|
||||
@Before
|
||||
@UiThreadTest
|
||||
@@ -61,7 +59,6 @@ public class NumberingSystemItemControllerTest {
|
||||
Looper.prepare();
|
||||
}
|
||||
mApplicationContext = ApplicationProvider.getApplicationContext();
|
||||
mFeatureFactory = FakeFeatureFactory.setupForTest();
|
||||
mFragment = spy(new NumberingPreferencesFragment());
|
||||
PreferenceManager preferenceManager = new PreferenceManager(mApplicationContext);
|
||||
mPreferenceScreen = preferenceManager.createPreferenceScreen(mApplicationContext);
|
||||
@@ -97,10 +94,6 @@ public class NumberingSystemItemControllerTest {
|
||||
}
|
||||
|
||||
assertTrue(isCallingStartActivity);
|
||||
verify(mFeatureFactory.metricsFeatureProvider).action(
|
||||
mApplicationContext,
|
||||
SettingsEnums.ACTION_CHOOSE_LANGUAGE_FOR_NUMBERS_PREFERENCES,
|
||||
"I_am_the_key");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -121,9 +114,6 @@ public class NumberingSystemItemControllerTest {
|
||||
mController.handlePreferenceTreeClick(preference);
|
||||
|
||||
verify(mFragment).setArguments(any());
|
||||
verify(mFeatureFactory.metricsFeatureProvider).action(
|
||||
mApplicationContext, SettingsEnums.ACTION_SET_NUMBERS_PREFERENCES,
|
||||
"test_key");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user