Fix incorrect usage for the logging method to cause no data in WW
Fix incorrect usage for the logging method to cause the schedule type and percentage data is not logged into the WW, since MetricsFeatureProvider doesn't support log Pair.of() data into the WestWorld or Clearcut directly, it is used for EventLogWriter only Bug: 202906853 Test: make SettingsRoboTests Change-Id: I9f1d157c77df9bd74f441105318790a2505a9c01
This commit is contained in:
@@ -29,7 +29,6 @@ import android.os.UserHandle;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.DateUtils;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
@@ -87,6 +86,7 @@ public class AdvancedPowerUsageDetail extends DashboardFragment implements
|
||||
private static final String KEY_PREF_OPTIMIZED = "optimized_pref";
|
||||
private static final String KEY_PREF_RESTRICTED = "restricted_pref";
|
||||
private static final String KEY_FOOTER_PREFERENCE = "app_usage_footer_preference";
|
||||
private static final String PACKAGE_NAME_NONE = "none";
|
||||
|
||||
private static final int REQUEST_UNINSTALL = 0;
|
||||
private static final int REQUEST_REMOVE_DEVICE_ADMIN = 1;
|
||||
@@ -484,14 +484,14 @@ public class AdvancedPowerUsageDetail extends DashboardFragment implements
|
||||
}
|
||||
|
||||
if (metricCategory != 0) {
|
||||
final String packageName = mBatteryOptimizeUtils.getPackageName();
|
||||
FeatureFactory.getFactory(getContext()).getMetricsFeatureProvider()
|
||||
.action(
|
||||
getContext(),
|
||||
metricCategory,
|
||||
new Pair(ConvertUtils.METRIC_KEY_PACKAGE,
|
||||
mBatteryOptimizeUtils.getPackageName()),
|
||||
new Pair(ConvertUtils.METRIC_KEY_BATTERY_USAGE,
|
||||
getArguments().getString(EXTRA_POWER_USAGE_PERCENT)));
|
||||
/* attribution */ SettingsEnums.OPEN_APP_BATTERY_USAGE,
|
||||
/* action */ metricCategory,
|
||||
/* pageId */ SettingsEnums.OPEN_APP_BATTERY_USAGE,
|
||||
TextUtils.isEmpty(packageName) ? PACKAGE_NAME_NONE : packageName,
|
||||
getArguments().getInt(EXTRA_POWER_USAGE_AMOUNT));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user