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

@@ -25,7 +25,9 @@ import android.os.storage.VolumeInfo;
import android.view.View;
import android.widget.Button;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.overlay.FeatureFactory;
public class StorageWizardInit extends StorageWizardBase {
private Button mExternal;
@@ -68,6 +70,12 @@ public class StorageWizardInit extends StorageWizardBase {
}
public void onNavigateExternal(View view) {
if (view != null) {
// User made an explicit choice for external
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this,
MetricsEvent.ACTION_STORAGE_INIT_EXTERNAL);
}
if (mVolume != null && mVolume.getType() == VolumeInfo.TYPE_PUBLIC
&& mVolume.getState() != VolumeInfo.STATE_UNMOUNTABLE) {
// Remember that user made decision
@@ -85,6 +93,12 @@ public class StorageWizardInit extends StorageWizardBase {
}
public void onNavigateInternal(View view) {
if (view != null) {
// User made an explicit choice for internal
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this,
MetricsEvent.ACTION_STORAGE_INIT_INTERNAL);
}
StorageWizardFormatConfirm.showPrivate(this, mDisk.getId());
}
}