Update detectSettingsAnomaly API to detectPowerAnomaly(1/2)
Since the detectSettingsAnomaly method does not only detect settings but also other power related anomalies. Change the method name to detectPowerAnomaly to make it more reflects what it really does. Bug: 320404576 Test: make SettingsGoogleRoboTests Change-Id: I4b5bec3aba81cd0dc6fef2c976eae3d64da3ede5
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.settings.fuelgauge;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
@@ -110,8 +111,9 @@ public interface PowerUsageFeatureProvider {
|
||||
/** Returns {@code true} if delay the hourly job when device is booting */
|
||||
boolean delayHourlyJobWhenBooting();
|
||||
|
||||
/** Returns {@link Bundle} for settings anomaly detection result */
|
||||
PowerAnomalyEventList detectSettingsAnomaly(
|
||||
/** Returns {@link Bundle} for power anomaly detection result */
|
||||
@Nullable
|
||||
PowerAnomalyEventList detectPowerAnomaly(
|
||||
Context context, double displayDrain, DetectRequestSourceType detectRequestSourceType);
|
||||
|
||||
/** Gets an intent for one time bypass charge limited to resume charging. */
|
||||
|
@@ -18,6 +18,7 @@ package com.android.settings.fuelgauge;
|
||||
|
||||
import static com.android.settings.Utils.SYSTEMUI_PACKAGE_NAME;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
@@ -179,7 +180,8 @@ public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public PowerAnomalyEventList detectSettingsAnomaly(
|
||||
@Nullable
|
||||
public PowerAnomalyEventList detectPowerAnomaly(
|
||||
Context context, double displayDrain, DetectRequestSourceType detectRequestSourceType) {
|
||||
return null;
|
||||
}
|
||||
|
@@ -137,7 +137,7 @@ public final class BatteryUsageDataLoader {
|
||||
.isEmpty()))) {
|
||||
FeatureFactory.getFeatureFactory()
|
||||
.getPowerUsageFeatureProvider()
|
||||
.detectSettingsAnomaly(
|
||||
.detectPowerAnomaly(
|
||||
context,
|
||||
/* displayDrain= */ 0,
|
||||
DetectRequestSourceType.TYPE_DATA_LOADER);
|
||||
|
@@ -262,7 +262,7 @@ public class PowerUsageAdvanced extends PowerUsageBase {
|
||||
final PowerUsageFeatureProvider powerUsageFeatureProvider =
|
||||
FeatureFactory.getFeatureFactory().getPowerUsageFeatureProvider();
|
||||
final PowerAnomalyEventList anomalyEventList =
|
||||
powerUsageFeatureProvider.detectSettingsAnomaly(
|
||||
powerUsageFeatureProvider.detectPowerAnomaly(
|
||||
getContext(),
|
||||
/* displayDrain= */ 0,
|
||||
DetectRequestSourceType.TYPE_USAGE_UI);
|
||||
|
Reference in New Issue
Block a user