Search in sources :

Example 11 with MetricsFeatureProvider

use of com.android.settingslib.core.instrumentation.MetricsFeatureProvider in project Resurrection_packages_apps_Settings by ResurrectionRemix.

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;
    // 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, extraPasswordComplexity);
}
Also used : MetricsFeatureProvider(com.android.settingslib.core.instrumentation.MetricsFeatureProvider)

Example 12 with MetricsFeatureProvider

use of com.android.settingslib.core.instrumentation.MetricsFeatureProvider in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class BluetoothDevicePreference method onClicked.

void onClicked() {
    Context context = getContext();
    int bondState = mCachedDevice.getBondState();
    final MetricsFeatureProvider metricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider();
    if (mCachedDevice.isConnected()) {
        metricsFeatureProvider.action(context, SettingsEnums.ACTION_SETTINGS_BLUETOOTH_DISCONNECT);
        askDisconnect();
    } else if (bondState == BluetoothDevice.BOND_BONDED) {
        metricsFeatureProvider.action(context, SettingsEnums.ACTION_SETTINGS_BLUETOOTH_CONNECT);
        mCachedDevice.connect(true);
    } else if (bondState == BluetoothDevice.BOND_NONE) {
        metricsFeatureProvider.action(context, SettingsEnums.ACTION_SETTINGS_BLUETOOTH_PAIR);
        if (!mCachedDevice.hasHumanReadableName()) {
            metricsFeatureProvider.action(context, SettingsEnums.ACTION_SETTINGS_BLUETOOTH_PAIR_DEVICES_WITHOUT_NAMES);
        }
        pair();
    }
}
Also used : Context(android.content.Context) MetricsFeatureProvider(com.android.settingslib.core.instrumentation.MetricsFeatureProvider)

Example 13 with MetricsFeatureProvider

use of com.android.settingslib.core.instrumentation.MetricsFeatureProvider in project android_packages_apps_Settings by omnirom.

the class ConditionContextualCardRenderer method bindView.

@Override
public void bindView(RecyclerView.ViewHolder holder, ContextualCard contextualCard) {
    final ConditionalCardHolder view = (ConditionalCardHolder) holder;
    final ConditionalContextualCard card = (ConditionalContextualCard) contextualCard;
    final MetricsFeatureProvider metricsFeatureProvider = FeatureFactory.getFactory(mContext).getMetricsFeatureProvider();
    metricsFeatureProvider.visible(mContext, SettingsEnums.SETTINGS_HOMEPAGE, card.getMetricsConstant(), 0);
    initializePrimaryClick(view, card, metricsFeatureProvider);
    initializeView(view, card);
    initializeActionButton(view, card, metricsFeatureProvider);
}
Also used : MetricsFeatureProvider(com.android.settingslib.core.instrumentation.MetricsFeatureProvider)

Example 14 with MetricsFeatureProvider

use of com.android.settingslib.core.instrumentation.MetricsFeatureProvider in project android_packages_apps_Settings by omnirom.

the class PictureInPictureDetails method logSpecialPermissionChange.

@VisibleForTesting
void logSpecialPermissionChange(boolean newState, String packageName) {
    int logCategory = newState ? SettingsEnums.APP_PICTURE_IN_PICTURE_ALLOW : SettingsEnums.APP_PICTURE_IN_PICTURE_DENY;
    final MetricsFeatureProvider metricsFeatureProvider = FeatureFactory.getFactory(getContext()).getMetricsFeatureProvider();
    metricsFeatureProvider.action(metricsFeatureProvider.getAttribution(getActivity()), logCategory, getMetricsCategory(), packageName, 0);
}
Also used : MetricsFeatureProvider(com.android.settingslib.core.instrumentation.MetricsFeatureProvider) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 15 with MetricsFeatureProvider

use of com.android.settingslib.core.instrumentation.MetricsFeatureProvider in project android_packages_apps_Settings by omnirom.

the class VrListenerSettings method logSpecialPermissionChange.

@VisibleForTesting
void logSpecialPermissionChange(boolean enable, String packageName) {
    int logCategory = enable ? SettingsEnums.APP_SPECIAL_PERMISSION_VRHELPER_ALLOW : SettingsEnums.APP_SPECIAL_PERMISSION_VRHELPER_DENY;
    final MetricsFeatureProvider metricsFeatureProvider = FeatureFactory.getFactory(getContext()).getMetricsFeatureProvider();
    metricsFeatureProvider.action(metricsFeatureProvider.getAttribution(getActivity()), logCategory, getMetricsCategory(), packageName, 0);
}
Also used : MetricsFeatureProvider(com.android.settingslib.core.instrumentation.MetricsFeatureProvider) VisibleForTesting(androidx.annotation.VisibleForTesting)

Aggregations

MetricsFeatureProvider (com.android.settingslib.core.instrumentation.MetricsFeatureProvider)41 VisibleForTesting (androidx.annotation.VisibleForTesting)12 Context (android.content.Context)6 Test (org.junit.Test)4 PendingIntent (android.app.PendingIntent)3 SliceMetadata (androidx.slice.SliceMetadata)3 SliceAction (androidx.slice.core.SliceAction)3 JobWorkItem (android.app.job.JobWorkItem)2 ContentResolver (android.content.ContentResolver)2 Intent (android.content.Intent)2 UserHandle (android.os.UserHandle)2 UserManager (android.os.UserManager)2 ImageView (android.widget.ImageView)2 BatteryUtils (com.android.settings.fuelgauge.BatteryUtils)2 PowerUsageFeatureProvider (com.android.settings.fuelgauge.PowerUsageFeatureProvider)2 ContextualCardFeatureProvider (com.android.settings.homepage.contextualcards.ContextualCardFeatureProvider)2 ArrayList (java.util.ArrayList)2 CardDatabaseHelper (com.android.settings.homepage.contextualcards.CardDatabaseHelper)1 PowerAllowlistBackend (com.android.settingslib.fuelgauge.PowerAllowlistBackend)1 PowerWhitelistBackend (com.android.settingslib.fuelgauge.PowerWhitelistBackend)1