use of androidx.annotation.VisibleForTesting in project Resurrection_packages_apps_Settings by ResurrectionRemix.
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);
}
use of androidx.annotation.VisibleForTesting in project Resurrection_packages_apps_Settings by ResurrectionRemix.
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);
}
use of androidx.annotation.VisibleForTesting in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class PremiumSmsAccess method logSpecialPermissionChange.
@VisibleForTesting
void logSpecialPermissionChange(int smsState, String packageName) {
int category = SmsUsageMonitor.PREMIUM_SMS_PERMISSION_UNKNOWN;
switch(smsState) {
case SmsUsageMonitor.PREMIUM_SMS_PERMISSION_ASK_USER:
category = SettingsEnums.APP_SPECIAL_PERMISSION_PREMIUM_SMS_ASK;
break;
case SmsUsageMonitor.PREMIUM_SMS_PERMISSION_NEVER_ALLOW:
category = SettingsEnums.APP_SPECIAL_PERMISSION_PREMIUM_SMS_DENY;
break;
case SmsUsageMonitor.PREMIUM_SMS_PERMISSION_ALWAYS_ALLOW:
category = SettingsEnums.APP_SPECIAL_PERMISSION_PREMIUM_SMS_ALWAYS_ALLOW;
break;
}
if (category != SmsUsageMonitor.PREMIUM_SMS_PERMISSION_UNKNOWN) {
// TODO(117860032): Category is wrong. It should be defined in SettingsEnums.
final MetricsFeatureProvider metricsFeatureProvider = FeatureFactory.getFactory(getContext()).getMetricsFeatureProvider();
metricsFeatureProvider.action(metricsFeatureProvider.getAttribution(getActivity()), category, getMetricsCategory(), packageName, smsState);
}
}
use of androidx.annotation.VisibleForTesting in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class AppDataUsage method bindData.
@VisibleForTesting
void bindData(int position) {
final long backgroundBytes, foregroundBytes;
if (mUsageData == null || position >= mUsageData.size()) {
backgroundBytes = foregroundBytes = 0;
mCycle.setVisible(false);
} else {
mCycle.setVisible(true);
final NetworkCycleDataForUid data = mUsageData.get(position);
backgroundBytes = data.getBackgroudUsage();
foregroundBytes = data.getForegroudUsage();
}
final long totalBytes = backgroundBytes + foregroundBytes;
mTotalUsage.setSummary(DataUsageUtils.formatDataUsage(mContext, totalBytes));
mForegroundUsage.setSummary(DataUsageUtils.formatDataUsage(mContext, foregroundBytes));
mBackgroundUsage.setSummary(DataUsageUtils.formatDataUsage(mContext, backgroundBytes));
}
use of androidx.annotation.VisibleForTesting in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class DataUsageSummaryPreference method launchWifiDataUsage.
@VisibleForTesting
static void launchWifiDataUsage(Context context) {
final Bundle args = new Bundle(1);
args.putParcelable(DataUsageList.EXTRA_NETWORK_TEMPLATE, NetworkTemplate.buildTemplateWifiWildcard());
args.putInt(DataUsageList.EXTRA_NETWORK_TYPE, ConnectivityManager.TYPE_WIFI);
final SubSettingLauncher launcher = new SubSettingLauncher(context).setArguments(args).setDestination(DataUsageList.class.getName()).setSourceMetricsCategory(SettingsEnums.PAGE_UNKNOWN);
launcher.setTitleRes(R.string.wifi_data_usage);
launcher.launch();
}
Aggregations