Merge "Count modifications to user's power allowlist" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
91355ffc74
@@ -100,6 +100,7 @@ import com.android.internal.util.ArrayUtils;
|
||||
import com.android.internal.util.DumpUtils;
|
||||
import com.android.internal.util.FastXmlSerializer;
|
||||
import com.android.internal.util.XmlUtils;
|
||||
import com.android.modules.expresslog.Counter;
|
||||
import com.android.server.am.BatteryStatsService;
|
||||
import com.android.server.deviceidle.ConstraintController;
|
||||
import com.android.server.deviceidle.DeviceIdleConstraintTracker;
|
||||
@@ -300,6 +301,12 @@ public class DeviceIdleController extends SystemService
|
||||
implements AnyMotionDetector.DeviceIdleCallback {
|
||||
private static final String TAG = "DeviceIdleController";
|
||||
|
||||
private static final String USER_ALLOWLIST_ADDITION_METRIC_ID =
|
||||
"battery.value_app_added_to_power_allowlist";
|
||||
|
||||
private static final String USER_ALLOWLIST_REMOVAL_METRIC_ID =
|
||||
"battery.value_app_removed_from_power_allowlist";
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private static final boolean COMPRESS_TIME = false;
|
||||
@@ -2805,6 +2812,7 @@ public class DeviceIdleController extends SystemService
|
||||
if (mPowerSaveWhitelistUserApps.put(name, UserHandle.getAppId(ai.uid))
|
||||
== null) {
|
||||
numAdded++;
|
||||
Counter.logIncrement(USER_ALLOWLIST_ADDITION_METRIC_ID);
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Slog.e(TAG, "Tried to add unknown package to power save whitelist: " + name);
|
||||
@@ -2826,6 +2834,7 @@ public class DeviceIdleController extends SystemService
|
||||
reportPowerSaveWhitelistChangedLocked();
|
||||
updateWhitelistAppIdsLocked();
|
||||
writeConfigFileLocked();
|
||||
Counter.logIncrement(USER_ALLOWLIST_REMOVAL_METRIC_ID);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user