IdleMaint: run IdleMaint if battery is charging

We've got reports where this ate battery too much during 3 to 4 AM.

Bug: 170441569
Bug: 168083554
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I8f41a8922034d3d625b90f70a523155d7f1c51e4
Merged-In: I8f41a8922034d3d625b90f70a523155d7f1c51e4
diff --git a/services/core/java/com/android/server/MountServiceIdler.java b/services/core/java/com/android/server/MountServiceIdler.java
index 6bc1a57..0f4c94b 100644
--- a/services/core/java/com/android/server/MountServiceIdler.java
+++ b/services/core/java/com/android/server/MountServiceIdler.java
@@ -113,6 +113,7 @@
         JobInfo.Builder builder = new JobInfo.Builder(MOUNT_JOB_ID, sIdleService);
         builder.setRequiresDeviceIdle(true);
         builder.setRequiresBatteryNotLow(true);
+        builder.setRequiresCharging(true);
         builder.setMinimumLatency(nextScheduleTime);
         tm.schedule(builder.build());
     }