Add a metrics for avatar

Add a metrics log when user click search bar avatar

Change-Id: I389d469cc3fe335ee934d72d642251a6f4fd038b
Fixes: 123560980
Test: compilation
This commit is contained in:
Sunny Shao
2019-01-30 16:06:41 +08:00
parent 6b3db61e53
commit 20aaf3d276

View File

@@ -17,6 +17,7 @@
package com.android.settings.accounts;
import android.accounts.Account;
import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
@@ -38,6 +39,7 @@ import androidx.lifecycle.OnLifecycleEvent;
import com.android.settings.R;
import com.android.settings.homepage.SettingsHomepageActivity;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.settingslib.utils.ThreadUtils;
import java.net.URISyntaxException;
@@ -91,6 +93,12 @@ public class AvatarViewMixin implements LifecycleObserver {
return;
}
final MetricsFeatureProvider metricsFeatureProvider = FeatureFactory.getFactory(
mContext).getMetricsFeatureProvider();
metricsFeatureProvider.action(SettingsEnums.PAGE_UNKNOWN,
SettingsEnums.CLICK_ACCOUNT_AVATAR, SettingsEnums.SETTINGS_HOMEPAGE,
null /* key */, Integer.MIN_VALUE /* value */);
// Here may have two different UI while start the activity.
// It will display adding account UI when device has no any account.
// It will display account information page when intent added the specified account.