Merge "Add visibility metrics to dialogs."
This commit is contained in:
committed by
Android (Google) Code Review
commit
295f5a03bc
@@ -36,6 +36,7 @@ import android.widget.TextView;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||
|
||||
public class PrivateVolumeForget extends SettingsPreferenceFragment {
|
||||
private static final String TAG_FORGET_CONFIRM = "forget_confirm";
|
||||
@@ -72,7 +73,13 @@ public class PrivateVolumeForget extends SettingsPreferenceFragment {
|
||||
}
|
||||
};
|
||||
|
||||
public static class ForgetConfirmFragment extends DialogFragment {
|
||||
public static class ForgetConfirmFragment extends InstrumentedDialogFragment {
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.DIALOG_VOLUME_FORGET;
|
||||
}
|
||||
|
||||
public static void show(Fragment parent, String fsUuid) {
|
||||
final Bundle args = new Bundle();
|
||||
args.putString(VolumeRecord.EXTRA_FS_UUID, fsUuid);
|
||||
|
@@ -59,6 +59,7 @@ import com.android.settings.Settings.StorageUseActivity;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.applications.ManageApplications;
|
||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||
import com.android.settings.deletionhelper.AutomaticStorageManagerSettings;
|
||||
import com.android.settings.deviceinfo.StorageSettings.MountTask;
|
||||
import com.android.settingslib.deviceinfo.StorageMeasurement;
|
||||
@@ -703,7 +704,7 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
||||
/**
|
||||
* Dialog that allows editing of volume nickname.
|
||||
*/
|
||||
public static class RenameFragment extends DialogFragment {
|
||||
public static class RenameFragment extends InstrumentedDialogFragment {
|
||||
public static void show(PrivateVolumeSettings parent, VolumeInfo vol) {
|
||||
if (!parent.isAdded()) return;
|
||||
|
||||
@@ -715,6 +716,11 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
||||
dialog.show(parent.getFragmentManager(), TAG_RENAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.DIALOG_VOLUME_RENAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Context context = getActivity();
|
||||
@@ -749,7 +755,7 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
||||
}
|
||||
}
|
||||
|
||||
public static class SystemInfoFragment extends DialogFragment {
|
||||
public static class SystemInfoFragment extends InstrumentedDialogFragment {
|
||||
public static void show(Fragment parent) {
|
||||
if (!parent.isAdded()) return;
|
||||
|
||||
@@ -758,6 +764,11 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
||||
dialog.show(parent.getFragmentManager(), TAG_SYSTEM_INFO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.DIALOG_STORAGE_SYSTEM_INFO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
return new AlertDialog.Builder(getActivity())
|
||||
@@ -767,7 +778,7 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
||||
}
|
||||
}
|
||||
|
||||
public static class OtherInfoFragment extends DialogFragment {
|
||||
public static class OtherInfoFragment extends InstrumentedDialogFragment {
|
||||
public static void show(Fragment parent, String title, VolumeInfo sharedVol) {
|
||||
if (!parent.isAdded()) return;
|
||||
|
||||
@@ -780,6 +791,11 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
||||
dialog.show(parent.getFragmentManager(), TAG_OTHER_INFO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.DIALOG_STORAGE_OTHER_INFO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Context context = getActivity();
|
||||
@@ -804,7 +820,7 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
||||
}
|
||||
}
|
||||
|
||||
public static class UserInfoFragment extends DialogFragment {
|
||||
public static class UserInfoFragment extends InstrumentedDialogFragment {
|
||||
public static void show(Fragment parent, CharSequence userLabel, CharSequence userSize) {
|
||||
if (!parent.isAdded()) return;
|
||||
|
||||
@@ -817,6 +833,11 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
||||
dialog.show(parent.getFragmentManager(), TAG_USER_INFO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.DIALOG_STORAGE_USER_INFO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Context context = getActivity();
|
||||
@@ -837,7 +858,7 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
||||
/**
|
||||
* Dialog to request user confirmation before clearing all cache data.
|
||||
*/
|
||||
public static class ConfirmClearCacheFragment extends DialogFragment {
|
||||
public static class ConfirmClearCacheFragment extends InstrumentedDialogFragment {
|
||||
public static void show(Fragment parent) {
|
||||
if (!parent.isAdded()) return;
|
||||
|
||||
@@ -846,6 +867,11 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
||||
dialog.show(parent.getFragmentManager(), TAG_CONFIRM_CLEAR_CACHE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.DIALOG_STORAGE_CLEAR_CACHE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Context context = getActivity();
|
||||
|
@@ -47,6 +47,7 @@ import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||
import com.android.settings.dashboard.SummaryLoader;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.search.Indexable;
|
||||
@@ -382,7 +383,7 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index
|
||||
}
|
||||
}
|
||||
|
||||
public static class VolumeUnmountedFragment extends DialogFragment {
|
||||
public static class VolumeUnmountedFragment extends InstrumentedDialogFragment {
|
||||
public static void show(Fragment parent, String volumeId) {
|
||||
final Bundle args = new Bundle();
|
||||
args.putString(VolumeInfo.EXTRA_VOLUME_ID, volumeId);
|
||||
@@ -393,6 +394,11 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index
|
||||
dialog.show(parent.getFragmentManager(), TAG_VOLUME_UNMOUNTED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.DIALOG_VOLUME_UNMOUNT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Context context = getActivity();
|
||||
@@ -428,7 +434,12 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index
|
||||
}
|
||||
}
|
||||
|
||||
public static class DiskInitFragment extends DialogFragment {
|
||||
public static class DiskInitFragment extends InstrumentedDialogFragment {
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.DIALOG_VOLUME_INIT;
|
||||
}
|
||||
|
||||
public static void show(Fragment parent, int resId, String diskId) {
|
||||
final Bundle args = new Bundle();
|
||||
args.putInt(Intent.EXTRA_TEXT, resId);
|
||||
|
@@ -33,7 +33,9 @@ import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.android.internal.logging.MetricsProto;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -168,7 +170,13 @@ public class StorageWizardFormatProgress extends StorageWizardBase {
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlowWarningFragment extends DialogFragment {
|
||||
public static class SlowWarningFragment extends InstrumentedDialogFragment {
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsProto.MetricsEvent.DIALOG_VOLUME_SLOW_WARNING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Context context = getActivity();
|
||||
|
Reference in New Issue
Block a user