Merge "Move legacy hide applications in usage screen list to SettingsGoogle" into sc-v2-dev am: 11d6ba6f57
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15737567 Change-Id: Ic2fb658dc7e42e87660564e6b3cf28df06fb0b43
This commit is contained in:
@@ -123,10 +123,12 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
|
||||
mIs24HourFormat = DateFormat.is24HourFormat(context);
|
||||
mNotAllowShowSummaryPackages = context.getResources()
|
||||
.getTextArray(R.array.allowlist_hide_summary_in_battery_usage);
|
||||
mNotAllowShowEntryPackages = context.getResources()
|
||||
.getTextArray(R.array.allowlist_hide_entry_in_battery_usage);
|
||||
mMetricsFeatureProvider =
|
||||
FeatureFactory.getFactory(mContext).getMetricsFeatureProvider();
|
||||
mNotAllowShowEntryPackages =
|
||||
FeatureFactory.getFactory(mContext)
|
||||
.getPowerUsageFeatureProvider(context)
|
||||
.getHideApplicationEntries(mContext);
|
||||
if (lifecycle != null) {
|
||||
lifecycle.addObserver(this);
|
||||
}
|
||||
|
@@ -302,10 +302,10 @@ public final class ConvertUtils {
|
||||
private static void purgeLowPercentageAndFakeData(
|
||||
final Context context,
|
||||
final Map<Integer, List<BatteryDiffEntry>> indexedUsageMap) {
|
||||
final List<CharSequence> backgroundUsageTimeHideList =
|
||||
final Set<CharSequence> backgroundUsageTimeHideList =
|
||||
FeatureFactory.getFactory(context)
|
||||
.getPowerUsageFeatureProvider(context)
|
||||
.getHideBackgroundUsageTimeList(context);
|
||||
.getHideBackgroundUsageTimeSet(context);
|
||||
for (List<BatteryDiffEntry> entries : indexedUsageMap.values()) {
|
||||
final Iterator<BatteryDiffEntry> iterator = entries.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
|
@@ -24,8 +24,8 @@ import android.util.SparseIntArray;
|
||||
import com.android.internal.os.BatterySipper;
|
||||
import com.android.settingslib.fuelgauge.Estimate;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Feature Provider used in power usage
|
||||
@@ -150,7 +150,12 @@ public interface PowerUsageFeatureProvider {
|
||||
Uri getBatteryHistoryUri();
|
||||
|
||||
/**
|
||||
* Returns {@link List} for hidding applications background usage time.
|
||||
* Returns {@link Set} for hidding applications background usage time.
|
||||
*/
|
||||
List<CharSequence> getHideBackgroundUsageTimeList(Context context);
|
||||
Set<CharSequence> getHideBackgroundUsageTimeSet(Context context);
|
||||
|
||||
/**
|
||||
* Returns package names for hidding application in the usage screen.
|
||||
*/
|
||||
CharSequence[] getHideApplicationEntries(Context context);
|
||||
}
|
||||
|
@@ -27,9 +27,9 @@ import com.android.internal.os.BatterySipper;
|
||||
import com.android.internal.util.ArrayUtils;
|
||||
import com.android.settingslib.fuelgauge.Estimate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider {
|
||||
|
||||
@@ -177,7 +177,12 @@ public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CharSequence> getHideBackgroundUsageTimeList(Context context) {
|
||||
return new ArrayList<>();
|
||||
public Set<CharSequence> getHideBackgroundUsageTimeSet(Context context) {
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence[] getHideApplicationEntries(Context context) {
|
||||
return new CharSequence[0];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user