use of com.android.settingslib.core.instrumentation.MetricsFeatureProvider in project android_packages_apps_Settings by omnirom.
the class SetNewPasswordActivity method logSetNewPasswordIntent.
private void logSetNewPasswordIntent() {
final String callingAppPackageName = PasswordUtils.getCallingAppPackageName(getActivityToken());
// use int min value to denote absence of EXTRA_PASSWORD_COMPLEXITY
final int extraPasswordComplexity = getIntent().hasExtra(EXTRA_PASSWORD_COMPLEXITY) ? getIntent().getIntExtra(EXTRA_PASSWORD_COMPLEXITY, PASSWORD_COMPLEXITY_NONE) : Integer.MIN_VALUE;
final boolean extraDevicePasswordRequirementOnly = getIntent().getBooleanExtra(EXTRA_DEVICE_PASSWORD_REQUIREMENT_ONLY, false);
// Use 30th bit to encode extraDevicePasswordRequirementOnly, since the top bit (31th bit)
// encodes whether EXTRA_PASSWORD_COMPLEXITY has been absent.
final int logValue = extraPasswordComplexity | (extraDevicePasswordRequirementOnly ? 1 << 30 : 0);
// this activity is launched by either ACTION_SET_NEW_PASSWORD or
// ACTION_SET_NEW_PARENT_PROFILE_PASSWORD
final int action = ACTION_SET_NEW_PASSWORD.equals(mNewPasswordAction) ? SettingsEnums.ACTION_SET_NEW_PASSWORD : SettingsEnums.ACTION_SET_NEW_PARENT_PROFILE_PASSWORD;
final MetricsFeatureProvider metricsProvider = FeatureFactory.getFactory(this).getMetricsFeatureProvider();
metricsProvider.action(metricsProvider.getAttribution(this), action, SettingsEnums.SET_NEW_PASSWORD_ACTIVITY, callingAppPackageName, logValue);
}
Aggregations