use of com.android.settings.fuelgauge.anomaly.AnomalyPreference in project android_packages_apps_Settings by crdroidandroid.
the class PowerUsageAnomalyDetails method refreshUi.
void refreshUi() {
mAbnormalListGroup.removeAll();
for (int i = 0, size = mAnomalies.size(); i < size; i++) {
final Anomaly anomaly = mAnomalies.get(i);
Preference pref = new AnomalyPreference(getPrefContext(), anomaly);
pref.setSummary(mBatteryUtils.getSummaryResIdFromAnomalyType(anomaly.type));
Drawable icon = getBadgedIcon(anomaly.packageName, UserHandle.getUserId(anomaly.uid));
if (icon != null) {
pref.setIcon(icon);
}
mAbnormalListGroup.addPreference(pref);
}
}
use of com.android.settings.fuelgauge.anomaly.AnomalyPreference in project android_packages_apps_Settings by SudaMod.
the class PowerUsageAnomalyDetails method onPreferenceTreeClick.
@Override
public boolean onPreferenceTreeClick(Preference preference) {
if (preference instanceof AnomalyPreference) {
AnomalyPreference anomalyPreference = (AnomalyPreference) preference;
final Anomaly anomaly = anomalyPreference.getAnomaly();
AnomalyDialogFragment dialogFragment = AnomalyDialogFragment.newInstance(anomaly, MetricsProto.MetricsEvent.FUELGAUGE_ANOMALY_DETAIL);
dialogFragment.setTargetFragment(this, REQUEST_ANOMALY_ACTION);
dialogFragment.show(getFragmentManager(), TAG);
return true;
}
return super.onPreferenceTreeClick(preference);
}
use of com.android.settings.fuelgauge.anomaly.AnomalyPreference in project android_packages_apps_Settings by SudaMod.
the class PowerUsageAnomalyDetails method refreshUi.
void refreshUi() {
mAbnormalListGroup.removeAll();
for (int i = 0, size = mAnomalies.size(); i < size; i++) {
final Anomaly anomaly = mAnomalies.get(i);
Preference pref = new AnomalyPreference(getPrefContext(), anomaly);
pref.setSummary(mBatteryUtils.getSummaryResIdFromAnomalyType(anomaly.type));
Drawable icon = getBadgedIcon(anomaly.packageName, UserHandle.getUserId(anomaly.uid));
if (icon != null) {
pref.setIcon(icon);
}
mAbnormalListGroup.addPreference(pref);
}
}
use of com.android.settings.fuelgauge.anomaly.AnomalyPreference in project android_packages_apps_Settings by DirtyUnicorns.
the class PowerUsageAnomalyDetails method refreshUi.
void refreshUi() {
mAbnormalListGroup.removeAll();
for (int i = 0, size = mAnomalies.size(); i < size; i++) {
final Anomaly anomaly = mAnomalies.get(i);
Preference pref = new AnomalyPreference(getPrefContext(), anomaly);
pref.setSummary(mBatteryUtils.getSummaryResIdFromAnomalyType(anomaly.type));
Drawable icon = getBadgedIcon(anomaly.packageName, UserHandle.getUserId(anomaly.uid));
if (icon != null) {
pref.setIcon(icon);
}
mAbnormalListGroup.addPreference(pref);
}
}
use of com.android.settings.fuelgauge.anomaly.AnomalyPreference in project platform_packages_apps_Settings by BlissRoms.
the class PowerUsageAnomalyDetails method refreshUi.
void refreshUi() {
mAbnormalListGroup.removeAll();
for (int i = 0, size = mAnomalies.size(); i < size; i++) {
final Anomaly anomaly = mAnomalies.get(i);
Preference pref = new AnomalyPreference(getPrefContext(), anomaly);
pref.setSummary(mBatteryUtils.getSummaryResIdFromAnomalyType(anomaly.type));
Drawable icon = getBadgedIcon(anomaly.packageName, UserHandle.getUserId(anomaly.uid));
if (icon != null) {
pref.setIcon(icon);
}
mAbnormalListGroup.addPreference(pref);
}
}
Aggregations