Metrics for user choices in storage wizard.

These metrics help us understand more about how users in the field
are interacting with adoptable storage.

Bug: 37284068
Test: atest com.android.settings.ui.StorageWizardTest
Change-Id: I2bb9b5b3683c6ed080233aa595c2626685384923
This commit is contained in:
Jeff Sharkey
2018-05-02 16:12:05 -06:00
parent 4c89530ff2
commit f6e47386b1
3 changed files with 37 additions and 0 deletions

View File

@@ -23,7 +23,9 @@ import android.os.storage.VolumeInfo;
import android.text.TextUtils;
import android.view.View;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.overlay.FeatureFactory;
public class StorageWizardFormatSlow extends StorageWizardBase {
private boolean mFormatPrivate;
@@ -55,6 +57,9 @@ public class StorageWizardFormatSlow extends StorageWizardBase {
@Override
public void onNavigateBack(View view) {
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this,
MetricsEvent.ACTION_STORAGE_BENCHMARK_SLOW_ABORT);
final Intent intent = new Intent(this, StorageWizardInit.class);
startActivity(intent);
finishAffinity();
@@ -62,6 +67,16 @@ public class StorageWizardFormatSlow extends StorageWizardBase {
@Override
public void onNavigateNext(View view) {
if (view != null) {
// User made an explicit choice to continue when slow
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this,
MetricsEvent.ACTION_STORAGE_BENCHMARK_SLOW_CONTINUE);
} else {
// User made an implicit choice to continue when fast
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this,
MetricsEvent.ACTION_STORAGE_BENCHMARK_FAST_CONTINUE);
}
final String forgetUuid = getIntent().getStringExtra(EXTRA_FORMAT_FORGET_UUID);
if (!TextUtils.isEmpty(forgetUuid)) {
mStorage.forgetVolume(forgetUuid);