Loading apex/jobscheduler/framework/java/com/android/server/usage/AppStandbyInternal.java +3 −5 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ import android.app.usage.UsageEvents; import android.app.usage.UsageStatsManager.StandbyBuckets; import android.app.usage.UsageStatsManager.SystemForcedReasons; import android.content.Context; import android.os.Looper; import android.util.IndentingPrintWriter; import java.io.PrintWriter; Loading @@ -21,13 +20,12 @@ public interface AppStandbyInternal { * TODO AppStandbyController should probably be a binder service, and then we shouldn't need * this method. */ static AppStandbyInternal newAppStandbyController(ClassLoader loader, Context context, Looper looper) { static AppStandbyInternal newAppStandbyController(ClassLoader loader, Context context) { try { final Class<?> clazz = Class.forName("com.android.server.usage.AppStandbyController", true, loader); final Constructor<?> ctor = clazz.getConstructor(Context.class, Looper.class); return (AppStandbyInternal) ctor.newInstance(context, looper); final Constructor<?> ctor = clazz.getConstructor(Context.class); return (AppStandbyInternal) ctor.newInstance(context); } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException | ClassNotFoundException e) { throw new RuntimeException("Unable to instantiate AppStandbyController!", e); Loading apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java +3 −2 Original line number Diff line number Diff line Loading @@ -110,6 +110,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.app.IBatteryStats; import com.android.internal.util.ArrayUtils; import com.android.internal.util.ConcurrentUtils; import com.android.server.JobSchedulerBackgroundThread; import com.android.server.LocalServices; import com.android.server.pm.parsing.pkg.AndroidPackage; import com.android.server.usage.AppIdleHistory.AppUsageHistory; Loading Loading @@ -418,8 +419,8 @@ public class AppStandbyController implements AppStandbyInternal { } } public AppStandbyController(Context context, Looper looper) { this(new Injector(context, looper)); public AppStandbyController(Context context) { this(new Injector(context, JobSchedulerBackgroundThread.get().getLooper())); } AppStandbyController(Injector injector) { Loading services/usage/java/com/android/server/usage/UsageStatsService.java +1 −2 Original line number Diff line number Diff line Loading @@ -215,8 +215,7 @@ public class UsageStatsService extends SystemService implements mHandler = new H(BackgroundThread.get().getLooper()); mAppStandby = AppStandbyInternal.newAppStandbyController( UsageStatsService.class.getClassLoader(), getContext(), BackgroundThread.get().getLooper()); UsageStatsService.class.getClassLoader(), getContext()); mAppTimeLimit = new AppTimeLimitController( new AppTimeLimitController.TimeLimitCallbackListener() { Loading Loading
apex/jobscheduler/framework/java/com/android/server/usage/AppStandbyInternal.java +3 −5 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ import android.app.usage.UsageEvents; import android.app.usage.UsageStatsManager.StandbyBuckets; import android.app.usage.UsageStatsManager.SystemForcedReasons; import android.content.Context; import android.os.Looper; import android.util.IndentingPrintWriter; import java.io.PrintWriter; Loading @@ -21,13 +20,12 @@ public interface AppStandbyInternal { * TODO AppStandbyController should probably be a binder service, and then we shouldn't need * this method. */ static AppStandbyInternal newAppStandbyController(ClassLoader loader, Context context, Looper looper) { static AppStandbyInternal newAppStandbyController(ClassLoader loader, Context context) { try { final Class<?> clazz = Class.forName("com.android.server.usage.AppStandbyController", true, loader); final Constructor<?> ctor = clazz.getConstructor(Context.class, Looper.class); return (AppStandbyInternal) ctor.newInstance(context, looper); final Constructor<?> ctor = clazz.getConstructor(Context.class); return (AppStandbyInternal) ctor.newInstance(context); } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException | ClassNotFoundException e) { throw new RuntimeException("Unable to instantiate AppStandbyController!", e); Loading
apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java +3 −2 Original line number Diff line number Diff line Loading @@ -110,6 +110,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.app.IBatteryStats; import com.android.internal.util.ArrayUtils; import com.android.internal.util.ConcurrentUtils; import com.android.server.JobSchedulerBackgroundThread; import com.android.server.LocalServices; import com.android.server.pm.parsing.pkg.AndroidPackage; import com.android.server.usage.AppIdleHistory.AppUsageHistory; Loading Loading @@ -418,8 +419,8 @@ public class AppStandbyController implements AppStandbyInternal { } } public AppStandbyController(Context context, Looper looper) { this(new Injector(context, looper)); public AppStandbyController(Context context) { this(new Injector(context, JobSchedulerBackgroundThread.get().getLooper())); } AppStandbyController(Injector injector) { Loading
services/usage/java/com/android/server/usage/UsageStatsService.java +1 −2 Original line number Diff line number Diff line Loading @@ -215,8 +215,7 @@ public class UsageStatsService extends SystemService implements mHandler = new H(BackgroundThread.get().getLooper()); mAppStandby = AppStandbyInternal.newAppStandbyController( UsageStatsService.class.getClassLoader(), getContext(), BackgroundThread.get().getLooper()); UsageStatsService.class.getClassLoader(), getContext()); mAppTimeLimit = new AppTimeLimitController( new AppTimeLimitController.TimeLimitCallbackListener() { Loading